J4K
2011-Feb-21 15:53 UTC
[Dovecot] [Q] A mix-up between /%d/%u/ and /%d/%n for virtual users
Hi there,
I have noticed I misconfigured a dovect 1.2.n server with virtual email.
Mistakingly, I used /%d/%u/ for mail_location, but /%d/%n userdb:
mail_location: maildir:/var/vmail/%d/%u/
userdb:
driver: static
args: uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
As a result I have maildirs being created for both (e.g):
/var/vmail/bigdomain.com/dirk at bigdomain.com
/var/vmail/bigdomain.com/dirk
The actual email is placed in
/var/vmail/bigdomain.com/dirk at bigdomain.com, which I am happy with.
I would liek to tidy up the configuration so that these extra maildirs
are not created, without breaking everything. Would someone recommend
what the best steps are? (other than reinstalling and starting from
scratch - Its in production).
Best regards, S.
-----------------------------------------------------------
Full dovecot -n is here:
# dovecot -n
# 1.2.15: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-cgmemcap-smack x86_64 Debian 6.0 ext4
log_timestamp: %Y-%m-%d %H:%M:%S
listen: 127.0.0.1:3993
ssl_listen: *:993
ssl: required
ssl_ca_file: /etc/ssl/certs/startcomIntermediateCA.pem
ssl_cert_file: /etc/ssl/private/bigdomain.com.ssl.crt
ssl_key_file: /etc/ssl/private/bigdomain.com.nopassphase_ssl.key
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
login_processes_count: 9
login_max_processes_count: 512
valid_chroot_dirs: /var/vmail
mail_max_userip_connections: 40
first_valid_uid: 106
mail_privileged_group: mail
mail_location: maildir:/var/vmail/%d/%u/
maildir_very_dirty_syncs: yes
mbox_write_locks: fcntl dotlock
mail_plugins: quota
lda:
log_path:
auth_socket_path: /var/run/dovecot/auth-master
postmaster_address: postmaster at bigdomain.com
mail_plugins: sieve quota
sieve_global_path: /var/vmail/globalsieverc
auth default:
mechanisms: plain login
verbose: yes
passdb:
driver: sql
args: /etc/dovecot/dovecot-mysql.conf
userdb:
driver: static
args: uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
userdb:
driver: sql
args: /etc/dovecot/dovecot-mysql.conf
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
master:
path: /var/run/dovecot/auth-master
mode: 384
user: vmail
plugin:
quota_rule: *:storage=262144:messages=20000
quota_rule2: Trash:storage=282144:messages=23000
dict:
quotadict: mysql:/etc/dovecot/dovecot-dict-quota.conf
Timo Sirainen
2011-Feb-22 08:53 UTC
[Dovecot] [Q] A mix-up between /%d/%u/ and /%d/%n for virtual users
On Mon, 2011-02-21 at 16:53 +0100, J4K wrote:> > As a result I have maildirs being created for both (e.g): > /var/vmail/bigdomain.com/dirk at bigdomain.com > /var/vmail/bigdomain.com/dirk > > > The actual email is placed in > /var/vmail/bigdomain.com/dirk at bigdomain.com, which I am happy with. > > I would liek to tidy up the configuration so that these extra maildirs > are not created, without breaking everything. Would someone recommend > what the best steps are? (other than reinstalling and starting from > scratch - Its in production).Write a script that moves all mails from %n to %u directory and then deletes the %n directory. Stop Dovecot, run the script, start Dovecot.
J4K
2011-Feb-22 09:38 UTC
[Dovecot] [Q] A mix-up between /%d/%u/ and /%d/%n for virtual users
On 02/22/2011 09:53 AM, Timo Sirainen wrote:> On Mon, 2011-02-21 at 16:53 +0100, J4K wrote: >> As a result I have maildirs being created for both (e.g): >> /var/vmail/bigdomain.com/dirk at bigdomain.com >> /var/vmail/bigdomain.com/dirk >> >> >> The actual email is placed in >> /var/vmail/bigdomain.com/dirk at bigdomain.com, which I am happy with. >> >> I would liek to tidy up the configuration so that these extra maildirs >> are not created, without breaking everything. Would someone recommend >> what the best steps are? (other than reinstalling and starting from >> scratch - Its in production). > Write a script that moves all mails from %n to %u directory and then > deletes the %n directory. Stop Dovecot, run the script, start Dovecot. > >Hi Timo, Ahh, I see now. %u = the whole email address e.g fred at fred.com, whereas %n = the user name e.g fred, but not fred at fred.com. I thought it was the other way around. Thus I require %d %u to keep the format /var/vmail/fred.com/fred at fred.com. Thank-you. S.
J4K
2011-Feb-22 09:44 UTC
[Dovecot] [Q] A mix-up between /%d/%u/ and /%d/%n for virtual users
On 02/22/2011 10:38 AM, J4K wrote:> On 02/22/2011 09:53 AM, Timo Sirainen wrote: >> On Mon, 2011-02-21 at 16:53 +0100, J4K wrote: >>> As a result I have maildirs being created for both (e.g): >>> /var/vmail/bigdomain.com/dirk at bigdomain.com >>> /var/vmail/bigdomain.com/dirk >>> >>> >>> The actual email is placed in >>> /var/vmail/bigdomain.com/dirk at bigdomain.com, which I am happy with. >>> >>> I would liek to tidy up the configuration so that these extra maildirs >>> are not created, without breaking everything. Would someone recommend >>> what the best steps are? (other than reinstalling and starting from >>> scratch - Its in production). >> Write a script that moves all mails from %n to %u directory and then >> deletes the %n directory. Stop Dovecot, run the script, start Dovecot. >> >> > Hi Timo, > > Ahh, I see now. > %u = the whole email address e.g fred at fred.com, whereas > %n = the user name e.g fred, but not fred at fred.com. > I thought it was the other way around. > > Thus I require %d %u to keep the format /var/vmail/fred.com/fred at fred.com. > Thank-you. > > S.is it possible that this is the entry that is incorrect: userdb static { args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes } and it ought to be written: userdb static { args = uid=5000 gid=5000 home=/var/vmail/%d/%u allow_all_users=yes }