[Dovecot] Renaming user account / mailbox

Timo Sirainen tss at iki.fi
Wed Feb 1 22:29:51 EET 2012


On 31.1.2012, at 14.07, Nikolaos Milas wrote:

> I am running dovecot-2.0.13-1_128.el5 x86_64 RPM on CentOS 5.7.
> 
> I would like to rename userx with email: userx at example.com to ux at example.com with a mailbox of ux (currently: userx)
> 
> Of course the idea is that new mail will continue to be delivered to the same mailbox, although it has been renamed.
> 
> How can I achieve it? Would it be enough (after changing the associated data in the associated LDAP entry) to simply rename the virtual user directory name, e.g. from /home/vmail/userx to /home/vmail/ux ?

Yes, you can just kill the user's existing connections, rename the directory and update the LDAP entry. If you do all of that quickly in a script, it's unlikely that you'll run into trouble. If a mail is being delivered at the same time, it could tempfail but will be retried again. (A more complex method would be using dsync, but probably not worth the trouble.)




More information about the dovecot mailing list