Morgins Mail

I spent a little time this morning sorting out some issues with mail on Morgins. Filtering now works (#Exim Filter does anyway), so you can create a .forward file in $home and send your spam elsewhere…

---
al@morgins ~ $ cat .forward
# Exim filter

if
  $h_X-Spam_bar: CONTAINS "+++++"
then
  save $home/.maildir/.Spam/
  finish
endif
---

in this case mail with a spam score of 5 or more will get saves into a maildir folder called Spam. I have also edited Exim to allow ‘foo+bar’ users to work (like they used to with Sendmail on Avoriaz), so ‘al+test’ will be delivered to ‘al’… I wondered why I had not been receiving some mail! D’oh!

Still not quite happy though. I wanted to add headers for spam based on conditions, but when I tried it thinks didn’t work. What I tried was:

---
  warn     message    = X-Spam-Score: $spam_score ($spam_bar)n
           condition  = ${if <{$spam_score_int}{50}{1}{0}}
           spam       = nobody:true

  warn     message    = X-Spam-Flag: YESn
                        X-Spam-Score: $spam_score ($spam_bar)n
                        X-Spam-Report: $spam_reportn
           condition  = ${if >{$spam_score_int}{50}{1}{0}}
           spam       = nobody:true
---

but this did not do what I expected. What I wanted was just an X-Spam_Score header for a $spam_score_int of less than 50, and then additional X-Spam-Flag and X-Spam-Report if $spam_score_int is more than 50 (hmm, what happens if it /is/ 50?). Ideas?


Posted

in

,

by

Tags:

Comments

3 responses to “Morgins Mail”

  1. nslm avatar
    nslm

    Assuming you configure SA correctly I think the following should do what you wanted…

    warn message = X-Spam-Score: $spam_score ($spam_bar)\n\
    spam = nobody:true

    warn message = X-Spam-Flag: YES\n\
    X-Spam-Report: $spam_report\n\
    spam = nobody

    spam = nobody:true means SA gets run as nobody, but the answer then gets or-ed with true, so always appears in the headers. spam = nobody means that if SA run as nobody returns that the message is spam, it’ll add the tags.

    With regards the who > < 50 thing http://www.exim.org/exim-html-4.60/doc/html/spec.html/ch11.html#SECTexpcond You've got >= and <= available as well.

  2. al_bullit avatar
    al_bullit

    Thanks NSLM, that make sense. Don’t know why but if I try the above I get the same odd headers I had before, like this:

    ---
    X-Spam-score: ()
    X-ACL-Warn: spam = nobody:true
    X-Spam-report:
    X-ACL-Warn: spam = nobody
    ---
  3. nslm avatar
    nslm

    That would be me (possibly only partially) typo-ing…

    ---
    warn message = X-Spam-Score: $spam_score ($spam_bar)
       spam = nobody:true
    
    warn message = X-Spam-Flag: YES\n\
                   X-Spam-Report: $spam_report
       spam = nobody
    ---

    Note: the six characters missing from this version…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.