Re: [exim] How to modify the Subject header

Top Page
Delete this message
Reply to this message
Author: John Hall
Date:  
To: exim-users
CC: nospam.list
Subject: Re: [exim] How to modify the Subject header
On 6/3/06, Yves Goergen <nospam.list@???> wrote:

> I want to make my users aware of the new spam filter service and make
> them find an appropriate spam score threshold to deny incoming mails at.
> There is already added a X-Spam-Score header to all incoming mails but
> most of the users probably don't know how to read mail header lines. So
> I thought it would be best to add the spam score to the subject of every
> message if it's greater than 5. Now how does that work? I found how to
> add new headers but this adds a second Subject header at the end. The
> present header won't be changed. I couldn't find anything related in the
> documentation. Is that possible at all?


I'm running SpamAssassin in the data ACL. I have the following in my
ACLS that adds a modified subject header:

 warn  message = X-Local-NewSubject: [spam $spam_score] $h_Subject:
        condition = ${if >{$spam_score_int}{50}{1}{0}}


And then in the system filter I replace the original header with the new one:

if $h_X-Local-NewSubject: is not "" then
        headers add "X-Local-OldSubject: $h_Subject"
        headers remove "Subject"
        headers add "Subject: $h_X-Local-NewSubject"
        headers remove "X-Local-NewSubject"
endif


Cheers,
John