[Dovecot] General approach question - am I doing this the right way?
Quick outline of my current working setup:
I'm running dovecot 1.0.5 as an IMAP mail server on my ubuntu home server, which i connect to with my phone and several other machines to check my mail etc.
i use getmail to collect mail from my various pop accounts. getmail filters the mail using spamassassin via a Filter_external, before moving it to my Maildir on the home server.
Then when I connect to the home server from my various machines, IMAP manages the status of all the mail, so unread messages are common etc.
All works very nicely. However I'd like to fix a minor annoyance...
...Spamassassin marks mail as SPAM but the mail client has to do the job of moving it to the Junk folder. I'd like the mail to be filtered on the home server on receipt.
Am I just making things really complicated for myself? Is there a simpler setup for what I'm trying to do?
Thanks in advance for any thoughts or suggestions
Alan Bates wrote:
Quick outline of my current working setup:
I'm running dovecot 1.0.5 as an IMAP mail server on my ubuntu home server, which i connect to with my phone and several other machines to check my mail etc.
i use getmail to collect mail from my various pop accounts. getmail filters the mail using spamassassin via a Filter_external, before moving it to my Maildir on the home server.
Then when I connect to the home server from my various machines, IMAP manages the status of all the mail, so unread messages are common etc.
All works very nicely. However I'd like to fix a minor annoyance...
...Spamassassin marks mail as SPAM but the mail client has to do the job of moving it to the Junk folder. I'd like the mail to be filtered on the home server on receipt.
Sieve can do that.
http://wiki.dovecot.org/LDA/Sieve
~Seth
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 12 Mar 2009, Seth Mattinen wrote:
Alan Bates wrote:
...Spamassassin marks mail as SPAM but the mail client has to do the job of moving it to the Junk folder. I'd like the mail to be filtered on the home server on receipt.
Sieve can do that.
Which assumes that Dovecot deliver is invoked by getmail as LDA/MDA.
Actually it depends on how getmail drops the mail into the Maildir.
Bye.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBSboc1nWSIuGy1ktrAQJS2ggAqxBkn8US4G6cNstRi+wjwLA6y8uataPL sfATbylPn2JJd2IYx8pvU2R8VfHge34PHXXxobI+uKte/eaozxkq4IlrIZZ2w+Ai kzb+DK4VxSLFc76o0QRnSmiOI1ifo9bChNYb0nWQs2lKzCKeCbiXFOi4fDy08GtN H4ZV5B7ONmdLxXIIBJr2O2LibqBFNyLTE+778Dddu+Pf90HsO0Gqw51u9kk7uLCO pe7/yix6Adqgg5p6i2CVyiQ3/9pPtZ+ylfes/Eg/KRy6vOg5AoVt6WlbDt5IuQU2 6qqJR03kXSrmaOsryrQaRXEw6gdgIru6gQWR1ZR3FjAesKHFZo7Aog== =hfmy -----END PGP SIGNATURE-----
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...
On Thu, Mar 12, 2009 at 4:48 PM, Seth Mattinen sethm@rollernet.us wrote:
Alan Bates wrote:
Quick outline of my current working setup:
I'm running dovecot 1.0.5 as an IMAP mail server on my ubuntu home server, which i connect to with my phone and several other machines to check my mail etc.
i use getmail to collect mail from my various pop accounts. getmail filters the mail using spamassassin via a Filter_external, before moving it to my Maildir on the home server.
Then when I connect to the home server from my various machines, IMAP manages the status of all the mail, so unread messages are common etc.
All works very nicely. However I'd like to fix a minor annoyance...
...Spamassassin marks mail as SPAM but the mail client has to do the job of moving it to the Junk folder. I'd like the mail to be filtered on the home server on receipt.
Sieve can do that.
http://wiki.dovecot.org/LDA/Sieve
~Seth
Alan Bates wrote:
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...
Or procmail:
:0:
- ^X-Spam-Status: Yes Maildir/.Junk/
Never used getmail personally so I have no idea what it can do.
~Seth
Quoting Alan Bates
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
brilliant - all working perfectly. thank you so much andreas!
participants (4)
-
Alan Bates
-
Andreas Ntaflos
-
Seth Mattinen
-
Steffen Kaiser