[Mimedefang] action_change_subject

Ryan Hardy rhardy at lodging.com
Tue Apr 15 12:48:00 EDT 2003

> I'd like mail tagged as spam by SpamAssassin have subject like:
>  *****SPAM**** + original subject

>From the mimedefang-filter man page:

    action_change_header($hdr, $val, $index)
         Changes an existing header in the message. This can be used in
         filter_begin or filter_end.  The $hdr parameter is the header name
         without the colon, and $val is the header value.  If the header
         not exist, then a header with the given name and value is added.

         The $index parameter is optional; it defaults to 1.  If you supply
         then the $index'th occurrence of the header is changed, if there is
         more than one header with the same name.  (This is common with the
         Received: header, for example.)

So, you would probably want something like this in your SpamAssassin block:

        if ($hits >= $req) {
	      # Other actions to take
            action_change_header("Subject", "*****SPAM***** " . $Subject);

Hope this helps,

Ryan N. Hardy
Unix Systems Administrator

More information about the MIMEDefang mailing list