SpamAssassin can write any header, but it always prepends X-Spam-
to the configured name. The headers are defined in the /usr/share/spamassassin/10_misc.cf
configuration file, using the add_header
directive. The add_header
directive has the following syntax:
add_header {spam | ham | all } header_name string
The add_header
directive tells SpamAssassin that a header is being declared. The second part can be spam, ham
, or all
; this indicates that the header will be written if an email is spam, if it is ham, or alternatively all the time.
This is followed by the header name. This can be any alphanumeric tag that begins with an alphabetic character. When the header is written in an email, it is prefixed with X-Spam-
, so a header configured with name CustomHeader
would appear in an email as X-Spam-CustomHeader
.
The tag can also include one or more text macros, for which SpamAssassin substitutes particular values. Here is a list of predefined macros:
Macro |
Meaning |
---|---|
_YESNOCAPS_ |
"YES... |