[PLUG] Mail Filters

Eric Wilhelm enobacon at gmail.com
Fri Sep 30 19:23:25 UTC 2011


# from Ronald Chmara on Thursday 29 September 2011 18:53:
>I have discovered (just now) that gmail not only allows me to
>block/delete all email with a specific origin mail address, it also
>does deep message scanning, so I can block all emails that even
>mention that specific email address (or any arbitrary string, really)
>anywhere in the body. It's in the "gear thing on the top right"->Mail
>Settings->Filters

I use cyrus sieve to sort my mail as it arrives into my IMAP server.  
Sadly, sieve does not have a built-in way to prune a thread based on 
the address of a sender (because you would need data which is external 
to the message.)

So, I have been looking at using the "References" and "In-Reply-To" 
headers to manage this -- which should do a fairly decent job on trolls 
who have their own domain, since the Message-ID would always contain 
that string.  This also assumes that everyone else's mail client 
includes the threading headers correctly.

  if anyof(
    header :contains "Message-ID"  "example.com",
    header :contains "References"  "example.com",
    header :contains "In-Reply-To" "example.com"
    ) {
    addflag ["\\Seen", "Troll"];
  }

The action could have been 'fileinto "INBOX.trash"; stop;', but I have 
decided to keep the messages and let them fall-through into the folder 
sorting later.

Meanwhile, my sieve rules are now running up against some kind of 32KB 
limit in cyrus?  Time to move on to some mail filtering tech which is a 
bit more modern?

--Eric



More information about the PLUG mailing list