[Dovecot] General approach question - am I doing this the right way?

Andreas Ntaflos daff at pseudoterminal.org
Fri Mar 13 16:10:58 EET 2009


Quoting Alan Bates <chupame at gmail.com>:

> Sure - I looked at sieve, but as i understood it, i'm bypassing any LDA
> stage, using getmail to deliver direct to the maildir.
>
> i suppose i could use getmail to deliver to a holding maildir, then use an
> LDA to filter and deliver that mail...

Way too complicated. Or is there a reason you don't want to use  
Dovecot's LDA directly?

I use getmail, Dovecot's LDA and Sieve in a setup very much like the  
one you described and it couldn't work better. Have a look at the  
relevant section of a typical rc-file for getmail:

[destination]
type = MDA_external
path = /usr/local/libexec/dovecot/deliver

That's all that's needed. You especially don't need any command-line  
arguments when you deliver for local users. Also see my .dovecot.sieve:

if anyof (
     header :contains ["Subject"] ["***Spam***"],
     header :contains ["X-Spam-Flag"] ["YES"]
     ) {
     # I discard spam immediately
     discard;
     stop;
}

if header :contains ["Subject"] ["[SPAM?]"] {
     # File into spam when unsure
     fileinto "INBOX.Spam";
     stop;
}

This way getmail hands retrieved mail to Dovecot's LDA (deliver) which  
looks at the Sieve rules you have defined (if any) and puts the mail  
in the correct location in your Maildir. Simple and elegant.

This of course assumes that the LDA protocol is configured correctly  
in dovecot.conf and knows where to deliver the mail (basically set a  
correct mail_location). And you have to have support for Sieve  
compiled in and set up correctly, which I assume is the case for  
Ubuntu. Read up on LDA and Sieve on the Dovecot wiki pages for more  
information.

Hope I didn't forget anything. I find using getmail with Dovecot  
enjoyably easy. I generally find using Dovecot enjoyably easy but I  
don't think anyone would argue that point :)

HTH Andreas
-- 
Andreas Ntaflos
Vienna, Austria

GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC  7E65 397C E2A8 090C A9B4


More information about the dovecot mailing list