[Dovecot] recipient_delimiter deux

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Thu Oct 24 09:37:36 EEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 23 Oct 2013, LuKreme wrote:

> OK, I've been banging my head on why my procmail setup for virtual users is no longer working (difficult to test, since enabling it breaks live user's mail). There are only a few virtual users who have any sort of filters in place anyway (the heavy procmail users are local, not virtual), and they are fairly simple, so I think I can recreate them with sieve.
>
> I think I have everything I need for sieve to work, but now what?
>
> The first thing I want to do is have sieve process recipient_delimiter into a separate mailbox (creating it, if needed). Googling just for example sieve scripts comes up empty (well, directing to the dovecot wiki which at least on the links that come up, does not have sample scripts).
>
> so, foo+bar at example.com will go into foo's mailstore in the folder .bar/new/
>
> On 27 Sep 2013, at 00:24 , Steffen Kaiser <skdovecot at smail.inf.fh-brs.de> wrote:
>> Dovecot LDA uses the "-m" option and only lda_mailbox_autocreate and lda_mailbox_autosubscribe, no need for recipient_delimiter to override the default mailbox.
>
> Which I still don't understand.
>
> recipient_delimiter = + is the default, so I shouldn't need to set it in my confs, I just need to setup a sieve recipe (is that what it is called? script?) that will process these messages, right? What would that look like?
>
> I have to setup the SQL users so that LMTP or LDA is used for deliver, but I want that to apply only to the sql users. Something like this, maybe?

This particular step is done in your MTA. So, how do you deliver your 
messages from the MTA into the mail storage of the user? If you want to 
use procmail for system users and Dovecot's LDA/LMTP for virtual users, 
you need to configure a separation _there_ already. The MTA decides with 
LDA to use: procmail vs. Dovecot.

My reply above applies to the branch, when the MTA uses Dovecot LDA to 
deliver messages (to virtual users). Then use the -m option of the Dovecot 
LDA, no need for a Sieve script. See http://wiki2.dovecot.org/LDA/Postfix 
If you use Dovecot's LMTP service, set lmtp_save_to_detail_mailbox = yes, 
no need for Sieve script either. However, Sieve can override this default 
mailbox with fileinto, actually both variants just replace the default 
mailbox (aka INBOX).

If you want to use a Sieve script, you need to get the "subaddress" of the 
envelope recipient address. I've never done this.
See http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples 2nd example in 
section "Plus Addressed mail filtering", however some MTA do not pass 
envelope information to Dovecot LDA, LMTP would be required then. See 
remark below that example, too.

> userdb {
>  args = /etc/dovecot/dovecot-sql.conf.ext
>  default_fields = uid=vpopmail gid=vchkpw mail_location=/usr/local/virtual/%u mail=maildir:/usr/local/virtual/%u sieve=/var/sieve/%u.sieve protocol_lda=$mailplugins sieve
>  driver = sql
> }
>
> I'm sure that protoco_lda isn't the right syntax though.
>
> If I set sieve=/var/sieve/%u.sieve as above would users still be able to use sieve-manage to manage their own sieve files? And what MUAs support this?
>
> If I left that out, do I put ~/.dovecot.sieve in with the other mailboxes and {cur,new,tmp} and the index files, or will there be issues? If I put a dovecot.sieve file there will it just be seen, processed, and work?
>
> (SQL user's $HOME is their maildir)
>
> $ doveconf -n
> # 2.2.5: /usr/local/etc/dovecot/dovecot.conf
> # OS: FreeBSD 9.1-RELEASE i386
> auth_mechanisms = PLAIN LOGIN
> disable_plaintext_auth = no
> first_valid_uid = 89
> login_log_format_elements = user=<%u> %r %m %c
> mail_location = maildir:~/Maildir
> mail_max_userip_connections = 90
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
> namespace inbox {
>  inbox = yes
>  location =
>  mailbox Drafts {
>    special_use = \Drafts
>  }
>  mailbox Junk {
>    auto = subscribe
>    special_use = \Junk
>  }
>  mailbox NotJunk {
>    auto = subscribe
>  }
>  mailbox Sent {
>    special_use = \Sent
>  }
>  mailbox "Sent Messages" {
>    special_use = \Sent
>  }
>  mailbox Trash {
>    special_use = \Trash
>  }
>  prefix =
> }
> passdb {
>  driver = pam
> }
> passdb {
>  args = /etc/dovecot/dovecot-sql.conf.ext
>  driver = sql
> }
> protocols = imap sieve
> service auth {
>  unix_listener /var/spool/postfix/private/auth {
>    mode = 0666
>  }
> }
> service imap-login {
>  inet_listener imaps {
>    port = 993
>    ssl = yes
>  }
> }
> ssl_cert = </etc/ssl/certs/dovecot.pem
> ssl_key = </etc/ssl/private/dovecot.pem
> userdb {
>  driver = passwd
> }
> userdb {
>  args = /etc/dovecot/dovecot-sql.conf.ext
>  default_fields = uid=vpopmail gid=vchkpw mail_location=/usr/local/virtual/%u mail=maildir:/usr/local/virtual/%u
>  driver = sql
> }
>

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUmjAMV3r2wJMiz2NAQIjTAf+OtgoNRi0BYkOFPGT1YGb1aTKvsv05hfV
CPD7iapbP3DYNe7UyVYfWqA+rtyHQizByzDZaOdZdxigQ6Ae9d/3ewtoIyj6ZypJ
8i8egoNM9w4IOHCPYBcticqNTfHkzg6T+TJEftf7ohHEmBqnoHZ+uX33sG1bBCgS
U0MzgSu3DL4WSnMfvGxuWNjsrpx0ChkfOY3uxPWhbCTQrIKo31tYfiqeIdlLgHbA
hWhndufYhQNChdzY2WMwqeMDrR7yo04tuj5Bhx8HfIVwdPkyXRvaYu4D3pqmZ57Y
sOAWEwrH1LdHTgxRCa7VfwvrTYg/LdvOKd3d7s61StQFeuC98V1SLw==
=MnJi
-----END PGP SIGNATURE-----


More information about the dovecot mailing list