[Dovecot] Detecting duplicate messages with sieve

Aleksandar Lazic al-dovecot at none.at
Fri Sep 16 01:02:46 EEST 2011


Dear Listmember,

I use http://www.courier-mta.org/reformail.html for

"Detecting duplicate messages"

###
The -D option implements a simple way to delete duplicate messages in
incoming mail. filename is a file that will be approximately 'len' bytes
long. This file will be used by reformail to save message IDs seen in
recent mail. reformail reads the message on standard input. If the
message has a Message-ID: header that's already in the cache file,
reformail terminates with the exit code set to 0. Otherwise, reformail
terminates with the exit code set to 1.
###

### my entry in mailfilter
`reformail -D 8192 $HOME/.msg.cache`
if ($RETURNCODE == 0)
{
   /^From: *!.*/
   FROM1=${MATCH2}

   /^Subject: *!.*/

   log "$FROM (${FROM1}) => Not Delivered duplicate MSG-ID. Subject
   ${MATCH2}\n"
   exit
}
###

Is there a similar feature in sieve or can I still use the upper setup?

Another question is about to add this header line in every mail.

xfilter "${REFORMAIL} -a\"Lines: $LINES\""

Thanks for your help.

BR
Aleks



More information about the dovecot mailing list