Hi, I have been using this setup for years: mail_home = /var/mail/vhosts/%d/%n mail_location = maildir:~ I have since learned that mail_home and mail_location should be different. I plan to use this: mail_home = /var/mail/vhosts/%d/%n mail_location = maildir:~/mail I would like the transition to be transparent for my email clients. I don't want mail/directories/sieve_scripts to disappear. 1. Should I manually create the maildir:~/mail directories? 2. Should I move files from /var/mail/vhosts/%d/%n into maildir:~/mail? Which files? (In other words: which files are "home directory" files and which files are "mail files"?) Thank you, Chris Example home directory: drwx------ . drwxr-xr-x .. drwx------ .Archives drwx------ .Archives.2016 drwx------ .Archives.2017 drwx------ .Drafts drwx------ .Junk drwx------ .Notes drwx------ .Sent drwx------ .Sent drwx------ .Trash drwx------ .work drwx------ .home drwx------ .todo lrwx------ .dovecot.sieve -rw------- .dovecot.sieve.log -rw------- .dovecot.sieve.log.0 -rw------- .dovecot.svbin drwx------ cur -rw------- dovecot-keywords -rw------- dovecot-uidlist -rw------- dovecot-uidvalidity -r--r--r-- dovecot-uidvalidity.55411048 -rw------- dovecot.index -rw------- dovecot.index.cache -rw------- dovecot.index.log -rw------- dovecot.mailbox.log drwx------ new drwx------ sieve -rw------- subscriptions drwx------ tmp $ dovecot -n # 2.2.27 (c0f36b0): /usr/local/etc/dovecot/dovecot.conf # Pigeonhole version 0.4.16 (fed8554) # OS: FreeBSD 10.3-RELEASE-p11 amd64 lmtp_save_to_detail_mailbox = yes mail_gid = 1002 mail_home = /var/mail/vhosts/%d/%n mail_location = maildir:~ mail_privileged_group = vpostfix mail_uid = 1002 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 index ihave duplicate mime foreverypart extracttext namespace inbox { inbox = yes location mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix } passdb { args = scheme=CRYPT username_format=%u /usr/local/etc/dovecot/users driver = passwd-file } plugin { recipient_delimiter = - sieve = file:~/sieve;active=~/.dovecot.sieve } protocols = imap pop3 lmtp sieve recipient_delimiter = - service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = postfix mode = 0600 user = postfix } } service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0666 user = postfix } } service managesieve-login { inet_listener sieve { port = 4190 } } ssl_cert = xxx ssl_key = xxx userdb { args = username_format=%u /usr/local/etc/dovecot/users driver = passwd-file } protocol lmtp { mail_plugins = " sieve" postmaster_address = xxx } protocol lda { mail_plugins = " sieve" }
I can't provide specific details as I'm on the road, but I successfully used mmv utility to accomplish something similar - changed mail home from domain/local at domain to just domain/local for about 65 users, took less than a second once I worked out the command (it supports wildcards) . The tricky part was changing the sql backend (was using postfixadmin) after the mmv - I ended up just dumping the sql db, editing the file, then pausing postfix/dovecot, performing the mmv, then restoring the db, and restarted postfix/dovecot, was down for maybe 20 seconds or less... On March 4, 2017 7:41:53 PM EST, Chris Stankevitz <chris at stankevitz.com> wrote:>Hi, > >I have been using this setup for years: > >mail_home = /var/mail/vhosts/%d/%n >mail_location = maildir:~ > >I have since learned that mail_home and mail_location should be >different. I plan to use this: > >mail_home = /var/mail/vhosts/%d/%n >mail_location = maildir:~/mail > >I would like the transition to be transparent for my email clients. I >don't want mail/directories/sieve_scripts to disappear. > >1. Should I manually create the maildir:~/mail directories? > >2. Should I move files from /var/mail/vhosts/%d/%n into maildir:~/mail? > >Which files? (In other words: which files are "home directory" files >and which files are "mail files"?) > >Thank you, > >Chris > >Example home directory: > >drwx------ . >drwxr-xr-x .. >drwx------ .Archives >drwx------ .Archives.2016 >drwx------ .Archives.2017 >drwx------ .Drafts >drwx------ .Junk >drwx------ .Notes >drwx------ .Sent >drwx------ .Sent >drwx------ .Trash >drwx------ .work >drwx------ .home >drwx------ .todo >lrwx------ .dovecot.sieve >-rw------- .dovecot.sieve.log >-rw------- .dovecot.sieve.log.0 >-rw------- .dovecot.svbin >drwx------ cur >-rw------- dovecot-keywords >-rw------- dovecot-uidlist >-rw------- dovecot-uidvalidity >-r--r--r-- dovecot-uidvalidity.55411048 >-rw------- dovecot.index >-rw------- dovecot.index.cache >-rw------- dovecot.index.log >-rw------- dovecot.mailbox.log >drwx------ new >drwx------ sieve >-rw------- subscriptions >drwx------ tmp > >$ dovecot -n ># 2.2.27 (c0f36b0): /usr/local/etc/dovecot/dovecot.conf ># Pigeonhole version 0.4.16 (fed8554) ># OS: FreeBSD 10.3-RELEASE-p11 amd64 >lmtp_save_to_detail_mailbox = yes >mail_gid = 1002 >mail_home = /var/mail/vhosts/%d/%n >mail_location = maildir:~ >mail_privileged_group = vpostfix >mail_uid = 1002 >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 index ihave duplicate mime foreverypart >extracttext >namespace inbox { > inbox = yes > location > mailbox Drafts { > special_use = \Drafts > } > mailbox Junk { > special_use = \Junk > } > mailbox Sent { > special_use = \Sent > } > mailbox "Sent Messages" { > special_use = \Sent > } > mailbox Trash { > special_use = \Trash > } > prefix >} >passdb { > args = scheme=CRYPT username_format=%u /usr/local/etc/dovecot/users > driver = passwd-file >} >plugin { > recipient_delimiter = - > sieve = file:~/sieve;active=~/.dovecot.sieve >} >protocols = imap pop3 lmtp sieve >recipient_delimiter = - >service auth { > unix_listener /var/spool/postfix/private/auth { > group = postfix > mode = 0666 > user = postfix > } > unix_listener auth-userdb { > group = postfix > mode = 0600 > user = postfix > } >} >service lmtp { > unix_listener /var/spool/postfix/private/dovecot-lmtp { > group = postfix > mode = 0666 > user = postfix > } >} >service managesieve-login { > inet_listener sieve { > port = 4190 > } >} >ssl_cert = xxx >ssl_key = xxx >userdb { > args = username_format=%u /usr/local/etc/dovecot/users > driver = passwd-file >} >protocol lmtp { > mail_plugins = " sieve" > postmaster_address = xxx >} >protocol lda { > mail_plugins = " sieve" >}-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Hi Chris,>I have since learned that mail_home and mail_location should be>different. I plan to use this:I'm interested about any sources for this ? I find dovecot to be very flexible, so much that you can actual have the home dir inside the maildir instead of the traditional other way around, which is actually my setup ! In /etc/dovecot/conf.d/auth-sql.conf.ext userdb { driver = static args = uid=vmail gid=vmail home=/var/vmail/%d/%n/dovecot } In /etc/dovecot/conf.d/10-mail.conf mail_location = Maildir:~/../ So in my case, the maildir is /var/vmail/%d/%n/ and the home dir is inside the maildir in a directory I named dovecot (home=/var/vmail/%d/%n/dovecot). This is because I migrated from courier which had the maildir directly in /var/vmail/%d/%n/, but since sieve scripts are also put there they are presented as maildir folders (which they're not of course), and this confused my users. So I used this little trick to hide the sieve scripts inside the dovecot directory and still have them working correctly. -- Yassine.
It's even listed as a possible setup in dovecot's wiki, see : http://genius.it/wiki.dovecot.org/VirtualUsers/Home (annotated version). -- Yassine.
Am 06.03.2017 um 09:06 schrieb chaouche yacine:> Hi Chris, > >> I have since learned that mail_home and mail_location should be > >> different. I plan to use this: > > I'm interested about any sources for this ?http://wiki.dovecot.org/VirtualUsers/Home "Home directory shouldn't be the same as mail directory with mbox or Maildir formats (but with dbox/obox it's fine). It's possible to do that, but you might run into trouble with it sooner or later." -- Alex JOST
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 4 Mar 2017, Chris Stankevitz wrote:> mail_home = /var/mail/vhosts/%d/%n > mail_location = maildir:~/mailthe default for maildir-type would be ~/Maildir :-) that enables auto-detection as well.> 1. Should I manually create the maildir:~/mail directories? > > 2. Should I move files from /var/mail/vhosts/%d/%n into maildir:~/mail? Which > files? (In other words: which files are "home directory" files and which > files are "mail files"?)> drwx------ . > drwxr-xr-x .. > drwx------ .Archivesany dir with dot at the beginning except . and ..> drwx------ cur > drwx------ new > drwx------ tmpthese dirs hold the messages of the INBOX> -rw------- dovecot-keywords > -rw------- dovecot-uidlist > -rw------- dovecot-uidvalidity > -r--r--r-- dovecot-uidvalidity.55411048 > -rw------- dovecot.index > -rw------- dovecot.index.cache > -rw------- dovecot.index.log > -rw------- dovecot.mailbox.log > -rw------- subscriptionsmake it: dovecot.index* dovecot-uid* You do not seem to use mailbox sharing or ACLs, those features would add some other entries. == These not! They belong to Sieve in home:> lrwx------ .dovecot.sieve > -rw------- .dovecot.sieve.log > -rw------- .dovecot.sieve.log.0 > -rw------- .dovecot.svbin > drwx------ sieveKeep any directory without leading dot (except cur, new,& tmp) in home as well. - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBWL1aPXz1H7kL/d9rAQJO1Qf+LlWcW0yMVAYHurp4+LglYXmZiUiOpJl0 d/7K4pw0yiF0KMrvQaxxugkVJCvQoErWvCiNu9mld1dkg+zzNNBlunRVi/UiJweb /Mp7tdmF7LQeDCdPnetqX9ASI2wr7TBtorOY/VWu+Haq98ZyLLbuhE/zz3CmF1gZ 80hdiOmsnzbakViIk37L0J9+gBZqbcHYQ2voey3UUw7cgd0yECGYCFJFuWK1X95a qB8/nyMUiWAIySZT1jQirMpg21DFYY3qOqsD6VTXkMz0B5ZE4mxq2L7gTQ0Gs73u m1v95QmLAKl8Y5cH7vuZivLt4ElIAAsTlL5Y7SHMkA7jIGjlhMUV3g==Hgrg -----END PGP SIGNATURE-----
Reasonably Related Threads
- Transitioning away from mail_location = maildir:~
- Problem with sieve_before[solved]
- quota-warning: possible to have size also?
- Studying dovecot source code (searching for mail_deliver_hook_set)
- Studying dovecot source code (searching for mail_deliver_hook_set)