[Dovecot] Server-side mail archiving - possible dovecot lda feature?

Johannes Berg johannes at sipsolutions.net
Fri Nov 3 15:00:26 UTC 2006

On Fri, 2006-11-03 at 09:29 -0500, Charles Marcus wrote:

> Why not? Have you ever googled on what is available for an integrated 
> email archiving solution? There are no (good) OSS solutions available, 
> and there are only a few commercial ones, most of those aimed at 
> Exchange servers. I did quite a bit of googling, and there doesn't seem 
> to be a good OSS solution to archiving all email on a server, which is 
> why I am asking about this here.

Well, you see, there is no OSS solution to email like exchange that
provides all of MTA, LDA and IMAP/POP server. Hence, there's no way to
have an integrated archiving solution. Outgoing mail is only visible to
the MTA and incoming mail is visible to all three. Hence, the most
logical place to put archiving would be the MTA (not dovecot but postfix
for you).

But then you'll probably complain that the archive isn't visible in

> > For archive.inbox, simply make your MTA deliver a second copy to there,
> Postfix has an 'always_bcc' option, but it does not preserve the message 
> with all of the headers intact, so this is not an option.

Use a saner MTA then.

> For a programmer, maybe - but sadly I am not. But at least you have 
> partially answered my question - apparently it *is* possible to do this 
> with dovecots lda. Thanks...

Ho humm, last I checked dovecot lda supported mail filtering by way of
config files. So you can always force a config file that first drops a
copy to the archive and then invokes the user's filter file.

> It does indeed sound like dovecots LDA is fully capable of doing this, 
> at least for the 'incoming' mail,

Yes, and I'm confident that no hacking is required for that. I
personally use maildrop, and it initially always reads /etc/maildroprc
before the user's ~/.mailfilter. I could, if I wanted to, force it to
copy the message to the archive in that case.

>  and it sounds like it would also work 
> for outgoing mail if you have your MTA configured to use the dovecot 
> LDA.

No, you obviously haven't understood mail flow yet. Read up on what MTAs
do. For outgoing mail, no LDA ("*local* delivery agent" after all) is
involved at all.

> What I'd like to know is, is it *feasible* to consider hiring 
> someone to modify the LDA to fully support this using documented 
> switches? Or via a new plug-in?

No. See above. The LDA never gets a copy of outgoing mail.

For the MTA, I can only point to how exim can do it:

Has it ever occurred to you that a product as you want is not even
possible because if written for postfix it won't work on another system
that uses exim or sendmail or ....? And if it serves the archive with
cyrus and uses maildrop, then it won't work with dovecot/dovecot-lda?


More information about the dovecot mailing list