How do I change the SpamAssassin template for messages recognized as spam?

Browse by products and services

  • Applies to: All DV
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, root or sudo access


You can add your own template to /etc/mail/spamassassin/ There is an example one at /usr/share/spamassassin/


Before you start, this article has the following dependencies:


The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. Please take a moment to review the Statement of Support.

Sample template

Below is a snippet of that file:

Filename: /etc/mail/spamassassin/

report Spam detection software, running on the system "_HOSTNAME_", has
report identified this incoming email as possible spam.  The original message
report has been attached to this so you can view it (if it isn't spam) or label
report similar future email.  If you have any questions, see
report _CONTACTADDRESS_ for details.
report Content preview:  _PREVIEW_
report Content analysis details:   (_SCORE_ points, _REQD_ required)
report " pts rule name              description"
report  ---- ---------------------- -----------------------------------------
report _SUMMARY_

Restart SpamAssassin after making any changes with the command:

/etc/init.d/psa-spamassassin restart