Differences between revisions 10 and 11
Revision 10 as of 2005-03-26 21:58:48
Size: 2388
Editor: DanKohn
Comment: Added X-MsMail-Priority test to procmail script
Revision 11 as of 2009-09-20 23:16:35
Size: 2394
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
A [http://article.gmane.org/gmane.mail.spam.spamassassin.general/52651 nice idea] from a person called Matt was to change the mail's priority to low, because this is something that OE can use for filtering.
This can be done using [http://www.procmail.org/ procmail], as scripted by DanKohn or using [http://www.courier-mta.org/maildrop/ maildrop] as scripted by Kai Bolay.
A [[http://article.gmane.org/gmane.mail.spam.spamassassin.general/52651|nice idea]] from a person called Matt was to change the mail's priority to low, because this is something that OE can use for filtering.
This can be done using [[http://www.procmail.org/|procmail]], as scripted by DanKohn or using [[http://www.courier-mta.org/maildrop/|maildrop]] as scripted by Kai Bolay.

Filter mails in Outlook Express

If SpamAssassin only adds some mail headers (like X-Spam-Flag) to tag spam and you don't want the subject to be mangled, Outlook Express cannot filter spam to a separate folder. A nice idea from a person called Matt was to change the mail's priority to low, because this is something that OE can use for filtering. This can be done using procmail, as scripted by DanKohn or using maildrop as scripted by Kai Bolay.

This procmail version has been updated to first remove low priority headers from messages before filtering:

# Remove low priority headers by piping through formail.
# If end-users filter on low priority headers, this will avoid
# false positives.  This is a procmail "or" rule requiring any
# of the four headers to trigger.

:0fw: formail1.lock
* ^X-Priority: 5|\
  ^Priority: Non-Urgent|\
  ^Importance: low|\
  ^X-MSMail-Priority: Low
| formail -I "X-Priority" -I "Priority" -I "Importance" -I "X-MSMail-Priority"

:0fw: spamassassin.lock
* < 256000
| spamassassin

# Pipe likely spam through formail adding
# the four headers that represent low priority

:0fw: formail2.lock
* ^X-Spam-Flag: YES
| formail -I "X-Priority: 5" -I "Priority: Non-Urgent" -I "Importance: low" -I "X-MSMail-Priority: Low"

The same with maildrop:

if ($SIZE < 256000)
{
   exception {
     xfilter "spamassassin"
   }
}

if (/^X-Spam-Flag: YES$/)
{
   # add the four headers that represent low priority
   exception {
     xfilter 'reformail -I "X-Priority: 5" \
                        -I "Priority: Non-Urgent"
                        -I "Importance: low" \
                        -I "X-MSMail-Priority: Low"'
   }
}
else
{
   if (/^X-Priority: 5$/ || \
       /^Priority: Non-Urgent$/ || \
       /^Importance: low$/ || \
       /^X-MSMail-Priority: Low$/)
   {
     # Remove low priority headers by piping through reformail.
     # If end-users filter on low priority headers, this will avoid
     # false positives.
     exception {
       xfilter 'reformail -I "X-Priority:" \
                          -I "Priority:" \
                          -I "Importance:" \
                          -I "X-MSMail-Priority:"'
   }
}

OeFilter (last edited 2009-09-20 23:16:35 by localhost)