Spamassassin - Message Tagging Options

rewrite_subject { 0 | 1 } (default: 0)
By default, the subject lines of suspected spam will not be tagged. This can be enabled here.
fold_headers { 0 | 1 } (default: 1)
By default, headers added by SpamAssassin will be whitespace folded. In other words, they will be broken up into multiple lines instead of one very long one and each other line will have a tabulator prepended to mark it as a continuation of the preceding one.

The automatic wrapping can be disabled here (which can generate very long lines).

add_header { spam | ham | all } header_name string
Customized headers can be added to the specified type of messages (spam, ham, or ``all'' to add to either). All headers begin with X-Spam- (so a header_name Foo will generate a header called X-Spam-Foo).

string can contain tags as explained above in the TAGS section. You can also use \n and \t in the header to add newlines and tabulators as desired. A backslash has to be written as \\, any other escaped chars will be silently removed.

All headers will be folded if fold_headers is set to 1. Note: Manually adding newlines via \n disables any further automatic wrapping (ie: long header lines are possible). The lines will still be properly folded (marked as continuing) though.

For backwards compatibility, some headers are (still) added by default. You can customize existing headers with add_header (only the specified subset of messages will be changed).

See also clear_headers for removing headers.

Here are some examples (these are the defaults in 2.60):

 add_header spam Flag _YESNOCAPS_
add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
add_header all Level _STARS(*)_
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_
remove_header { spam | ham | all } header_name
Headers can be removed from the specified type of messages (spam, ham, or ``all'' to remove from either). All headers begin with X-Spam- (so header_name will be appended to X-Spam-).

See also clear_headers for removing all the headers at once.

Note that X-Spam-Checker-Version is not removable because the version information is needed by mail administrators and developers to debug problems. Without at least one header, it might not even be possible to determine that SpamAssassin is running.

clear_headers
Clear the list of headers to be added to messages. You may use this before any add_header options to prevent the default headers from being added to the message.

Note that X-Spam-Checker-Version is not removable because the version information is needed by mail administrators and developers to debug problems. Without at least one header, it might not even be possible to determine that SpamAssassin is running.

report_safe_copy_headers header_name ...
If using report_safe, a few of the headers from the original message are copied into the wrapper header (From, To, Cc, Subject, Date, etc.) If you want to have other headers copied as well, you can add them using this option. You can specify multiple headers on the same line, separated by spaces, or you can just use multiple lines.
subject_tag STRING ... (default: *****SPAM*****)
Text added to the Subject: line of mails that are considered spam, if rewrite_subject is 1. Tags can be used here as with the add_header option. If report_safe is not used (see below), you may only use the _HITS_ and _REQD_ tags, or SpamAssassin will not be able to remove this markup from your message.
report_safe { 0 | 1 | 2 } (default: 1)
if this option is set to 1, if an incoming message is tagged as spam, instead of modifying the original message, SpamAssassin will create a new report message and attach the original message as a message/rfc822 MIME part (ensuring the original message is completely preserved, not easily opened, and easier to recover).

If this option is set to 2, then original messages will be attached with a content type of text/plain instead of message/rfc822. This setting may be required for safety reasons on certain broken mail clients that automatically load attachments without any action by the user. This setting may also make it somewhat more difficult to extract or view the original message.

If this option is set to 0, incoming spam is only modified by adding some X-Spam- headers and no changes will be made to the body. In addition, a header named X-Spam-Report will be added to spam. You can use the remove_header option to remove that header after setting report_safe to 0.

report_charset CHARSET (default: unset)
Set the MIME Content-Type charset used for the text/plain report which is attached to spam mail messages.
report ...some text for a report...
Set the report template which is attached to spam mail messages. See the 10_misc.cf configuration file in /usr/share/spamassassin for an example.

If you change this, try to keep it under 78 columns. Each report line appends to the existing template, so use clear_report_template to restart.

Tags can be included as explained above.

clear_report_template
Clear the report template.
report_contact ...text of contact address...
Set what _CONTACTADDRESS_ is replaced with in the above report text. By default, this is 'the administrator of that system', since the hostname of the system the scanner is running on is also included.
unsafe_report ...some text for a report...
Set the report template which is attached to spam mail messages which contain a non-text/plain part. See the 10_misc.cf configuration file in /usr/share/spamassassin for an example.

Each unsafe-report line appends to the existing template, so use clear_unsafe_report_template to restart.

Tags can be used in this template (see above for details).

clear_unsafe_report_template
Clear the unsafe_report template.
spamtrap ...some text for spamtrap reply mail...
A template for spam-trap responses. If the first few lines begin with Xxxxxx: yyy where Xxxxxx is a header and yyy is some text, they'll be used as headers. See the 10_misc.cf configuration file in /usr/share/spamassassin for an example.

Unfortunately tags can not be used with this option.

clear_spamtrap_template
Clear the spamtrap template.
describe SYMBOLIC_TEST_NAME description ...
Used to describe a test. This text is shown to users in the detailed report.

Note that test names which begin with '__' are reserved for meta-match sub-rules, and are not scored or listed in the 'tests hit' reports.

Also note that by convention, rule descriptions should be limited in length to no more than 50 characters.