You are hereFiltering duplicate emails with procmail
Filtering duplicate emails with procmail
PMDIR=$HOME/.procmail
:0 Whc: msgid.lock
| formail -D 4096 $PMDIR/idcache
:0 a:
Mail/duplicates
:0 Whc: msgid.lock This sends the headers to formail and makes a carbon copy of the mail and creates a lock file while we are doing this. | formail -D 4096 $PMDIR/idcache This pipes the output of the previous line to formail, formail will append the msgid of the message to the file idcache if it doesn't already exist. If the msgid exists, then it will exit with success, if it does not then it will append the msgid to the file (removing anything over 4096 bytes) and return failure. :0 a: We use the a: to see if there was success on the previous rule. Mail/duplicates We then send the message to the folder Mail/duplicates. We could send to /dev/null, but I'm too chicken for that...
Perfect, short, sweet, and thanks for the explanation. This is just what I needed, but my friends told me to go with a client-side solution. I told them I have committed to central email filtering and this won't stop me :)
[...] taki trick ;) ¿eby "nie duplikowa³"/"nie dostarcza³" duplikatu wiadomo¶ci. http://ramblings.narrabilis.com/wp/f...with-procmail/ http://partmaps.org/era/procmail/tony.html [...]
Post new comment