Transitioning away from mail_location = maildir:~

Charles Marcus tanstaafl at libertytrek.org
Sun Mar 5 16:28:15 UTC 2017


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.


More information about the dovecot mailing list