[Dovecot] duplicates with multiple To/CC and sieve redirect copy

Adam Szpakowski as at 3a.pl
Wed Feb 22 01:15:30 EET 2012

On 22.02.2012 00:09, Timo Sirainen wrote:
> On 22.2.2012, at 1.02, Adam Szpakowski wrote:
>> On 21.02.2012 23:57, Timo Sirainen wrote:
>>> On 22.2.2012, at 0.46, Adam Szpakowski wrote:
>>>> In one installation we are using sieve "redirect :copy" to create copy of the incoming email (local boss gets copy of its employees mails).
>>>> There is a problem when the incoming email has multiple To/CC entries with local users. Multiple copy/redirects are created (one for each employee) and there are multiple copies in "boss" account.
>>> Could this instead be implemented by MTA as automatic bcc: boss of all incoming mails?
>> Unfortunately no. The employee/boss structure is quite complicated. Some employees have multiple "bosses", there are also some "project" emails when the structure is even more complicated.
>> We are using dedicated sieve_before script for each user based on %u variable.
> Well, it would be possible to build a doveadm script that deletes the duplicates after delivery, but currently there's no implementation to avoid delivering duplicate Message-IDs in the first place.
> I don't really like such a Message-ID-based deduplication feature enabled by default, but something like this could be nice:
> fileinto :copy :x-deduplicate "boss";
> Anyway, probably not going to be implemented anytime soon.
Maybe there is a way to use a procmail with something like this:

:0 Wh: msgid.lock
| formail -D 8192 .msgid.cache

But is there a safe way to use it together with sieve? Using Pigeonhole 
Sieve Pipe Plugin?

Adam Szpakowski

More information about the dovecot mailing list