Dear lazyweb...
There's a rather simple recipe in the procmail examples for filtering out duplicate e-mail messages using their message ID:
:0 Whc: msgid.lock
| formail -D 8192 msgid.cache
:0 a:
duplicates
I'm wondering, and Google fails me, is there an easy way to achieve this same effect* in an exim filter?
* Or something close. Specifically the ability to remember what message IDs have already been seen, and if the message ID has been seen already, deliver the duplicate message somewhere else.
Something like the following.... (Score:1)
logfile $home/.msgid.log
if ${lookup{$h_message-id:}lsearch{$home/.msgid.log}} is "seen"
then
seen
finish
else
save $home/inbox
logwrite "$h_message-id: seen"
endif
Re: (Score:2)
I had been thinking that something structured like this might work. But
lsearchwill be O(n), won't it? And if most message IDs aren't repeated, then most searches will be for the whole file. Whereas using a DBM file would be O(1), wouldn't it? But would require writing a custom program to insert seen message IDs into the DBM file, which is a fork hit.Re: (Score:1)
Re: (Score:2)
I'm not root, so I'm not in a position to link with perl. Even if I were, I prefer the decoupling provided by a separate program, so I went with
${readsocket[perl.org]. Thanks for the help