Re: [exim] LMTP deliver to subfolders

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Mike Cardwell
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] LMTP deliver to subfolders
* on the Wed, May 28, 2014 at 02:47:41PM +0200, Michal G. wrote:

> Today LDA was replaced with LMTP. It is working good but I have one
> problem: I can't deliver messages marked as spam to Spam folder. With
> LDA-deliver I was using:


[snip]

> On dovecot and exim wiki there is no information about how deliver
> messages to INBOX subfolders. I don't believe that sieve filters are
> the only way to resolve the problem.


I do exactly what you are describing, using sieve. Exim adds a header
to messages which appear to be spam. Exim then delivers that message to
Dovecot via LMTP. I installed the Dovecot Sieve plugin (in Debian:
apt-get install dovecot-sieve). I then configured the Sieve plugin to
read from ~/.sieve and added the following config to my .sieve file:

########################################################################

require [ "imap4flags" ];

if exists ["X-Is-Spam"] {
    addflag  "\\Seen";
    fileinto "Junk E-mail";
    stop;
}


########################################################################

I have a lot more stuff in my .sieve file. The above definition is just
the bit which handles spam.

Why can't you use sieve for this? If you're using LMTP, there is no
way to inform Dovecot over that LMTP connection, which folder to
route the mail into. Well, there might be some hackish methods
involving encoding that information in the LMTP "RCPT TO", but I don't
want to think about that.

-- 
Mike Cardwell  https://grepular.com https://emailprivacytester.com
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3   B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1   BF1B 295C 3C78 3EF1 46B4