Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Dovecot provides a master login (a master user name and password that can log into all user accounts).

I've setup Dovecot as per:

Here's my problem.

The only way I can authenticate successfully is if I try to authenticate through telnet twice.

$ telnet 143
Connected to
Escape character is '^]'.
* OK Dovecot ready.
1 login*master my_password
1 NO Authentication failed.
1 login*master my_password
1 OK Logged in.

imapsync (the tool I need to use to migrate over emails from Dovecot to Zimbra) won't work.

    $ imapsync --nosyncacls --syncinternaldates --host1 --user1*master --authmech1 PLAIN --password1 my_password --host2 --user2 --authmech2 PLAIN --ssl2 --password2 user2_password
$RCSfile: imapsync,v $ $Revision: 1.286 $ $Date: 2009/07/24 15:53:04 $ 
Here is a [linux] system (Linux mylinuxbox 2.6.32-30-generic #59-Ubuntu SMP Tue Mar 1 21:30:21 UTC 2011 i686)
with perl 5.10.1
Mail::IMAPClient  3.21
IO::Socket        1.31
Digest::MD5       2.39
Term::ReadKey     2.30
 and the module Mail::IMAPClient version used here is 3.21
Command line used:
/usr/bin/imapsync --nosyncacls --syncinternaldates --host1 --user1 user@server*master --authmech1 PLAIN --password1 MASKED --host2 --user2 --authmech2 PLAIN --ssl2 --password2 MASKED
Turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
Will try to use PLAIN authentication on host1
Will try to use PLAIN authentication on host2
From imap server [] port [143] user [*master]
To   imap server [] port [993] user []
Banner: * OK Dovecot ready.
Error login: [] with user [user@server*master] auth [PLAIN]: 2 NO Authentication failed.
Error login: [] with user [user@server*master] auth [PLAIN]: 2 NO Authentication failed.

If I try without the master user it works. Please help.

share|improve this question
When you created everyone's Zimbra accounts, where did you get their passwords from? Can you use those? Can you change people's passwords before you migrate their email? – Andrew Apr 27 '11 at 5:14
@Andrew I can't use those passwords. The point of the master login is to bypass everyone's password and use one master password. I cannot change everyone's password before they migrate because they'll still have access to the old system. My problem has nothing to do with user passwords but with the dovecot master authentication. – hfranco Apr 27 '11 at 23:45
From the page you linked to: "If you had any problems, set auth_debug=yes and look at the logs." - Anything in the logs? – rthomson May 1 '11 at 6:26
You've messed something up. The master login doesn't require you log in twice. Perhaps you forgot to add pass=yes to the master passdb section? Or perhaps your checkpassword tool is configured wrong? Perhaps tracing the authentication process will help. – geocar May 1 '11 at 12:41

The imapsync --authuser1 option explained by Jazzy Pierre may solve your issue. Have a try.

(I wrote imapsync).

share|improve this answer

I've successfully used imapsync to migrate from dovecot to zimbra using a master password. I did change the master user separator from * to +, because the * causes the shell to process it as a wildcard.

Find this line in your dovecot.conf and change it to read:

auth_master_user_separator = +

Here's the command I typically use:

/usr/bin/imapsync \
 --host1 $DOVECOTHOST --user1 "${USER}+mail-admin" --passfile1 /root/.dovecot-master \
 --host2 $ZIMBRAHOST  --user2  $ZMUSER --passfile2 $ZMPASS \
 --authmech1 PLAIN --authmech2 PLAIN \
 --exclude Trash --subscribe --syncinternaldates

Hope that helps.

share|improve this answer

Have you looked at the mail migration page on Zimbra's wiki? There are scripts for importing directly from mbox or maildir mail stores into Zimbra. That strategy may be faster and simpler than using imapsync.

If you do need to use imapsync, I second the comment about the Dovecot auth logs. Something is clearly going wrong with the master password authentication. What version of Dovecot are you using? Could you post the relevant parts of your Dovecot configuration?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.