[exim] adding selective headers

Top Page
Delete this message
Reply to this message
Author: Brian
Date:  
To: exim-users
Subject: [exim] adding selective headers
We have some people that wish us not to filter their mail at all. No
dnsbl, no sender verify, and no sa.

so what we've done is put in an accept which lookups their email address
in a cdb.

acl_check_rcpt:

...

accept
  condition      =  ${lookup {${lc:$local_part@$domain}} 
cdb*@{EXIM_DIR/cdb/iwantspam.cdb}{yes}{no}}


..

drop dnsbl check
drop sender check
deny recipient check

#add headers
warn message = X-MailFrom: $sender_address
warn message = X-Rcptto: $local_part@domain

drop

in this case if the user is listed in the iwantspam.cdb it gets
accepted, BUT, it still seems to get the two headers that we add. Which
to us it odd, but good.

Also in the acl_check_data:

drop malware

warn message = X-Antivirus: Clean

...

# continue with no filtering
accept
  message        = X-WANTSPAM: Yes
  condition      =  ${lookup {${lc:$recipients}} 
cdb*@{EXIM_DIR/cdb/iwantspam.cdb}{yes}{no}}


deny mime checks

#just no SA
accept
  message        = X-NOSA: Yes
  condition      = ${lookup {${lc:$recipients}} 
cdb*@{EXIM_DIR/cdb/nosa.cdb}{yes}{no}}


then spamassassin check

What we don't get is a header saying X-WANTSPAM or X-NOSA when people
are found to be in these lists.

Our setup works, but we would just like to add headers so that we know
what's going on so when people complain about the spam they are
getting.. we can say 'yes you wanted to be removed'.

How would we add headers to messages that are accepted for the people
found in these lists?

and

Why do the X-Mailfrom and X-Rcptto get added if the message was already
accepted?

We currently use a system.filter for the subject rewriting for the case
that SA finds a 'hit'.

accept
  condition      = ${if >={$message_size}{200k}{1}{0}}


drop message    = ** Attention **\n \
                 This message has been rejected!\n \
                 This message has a SPAM score of: $spam_score points.\n
  spam           = spamd
  condition      = ${if >{$spam_score_int}{100}{1}{0}}
  log_message    = [SA Reject] $spam_score


warn message    = X-New-Subject: [SPAM] $h_subject:
  spam           = spamd
  log_message    = [SPAM] $spam_score



and this is our system.filter:


# Exim filter

if "${if def:header_X-New-Subject: {there}}" is there
then
         headers remove Subject
         headers add "Subject: $h_X-New-Subject:"
         headers add "X-Spam-Status: Yes"
         headers remove X-New-Subject
endif



Would this be how we would accomplish what we are looking for? Is there
a more efficient way to do what we are doing? Should we be putting this
header information that we are looking to write into the system.filter
rather than in the configure file itself?

TIA