Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

I've setup Dovecot as per: http://wiki1.dovecot.org/Authentication/MasterUsers

Here's my problem.

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

$ telnet mail01.server.com 143
Trying 10.10.10.10...
Connected to mail01.server.com.
Escape character is '^]'.
* OK Dovecot ready.
1 login user@server.com*master my_password
1 NO Authentication failed.
1 login user@server.com*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 mail01.server.com --user1 user@server.com*master --authmech1 PLAIN --password1 my_password --host2 mail02.server.com --user2 user@server.com --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
IO::Socket::SSL   
Digest::MD5       2.39
Digest::HMAC_MD5  
Term::ReadKey     2.30
Date::Manip       
 and the module Mail::IMAPClient version used here is 3.21
Command line used:
/usr/bin/imapsync --nosyncacls --syncinternaldates --host1 mail01.server.com --user1 user@server*master --authmech1 PLAIN --password1 MASKED --host2 mail02.server.com --user2 user2@server.com --authmech2 PLAIN --ssl2 --password2 MASKED
Turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
TimeZone:[america/new_york]
Will try to use PLAIN authentication on host1
Will try to use PLAIN authentication on host2
From imap server [mail01.server.com] port [143] user [user@server.com*master]
To   imap server [mail02.server.com] port [993] user [user2@server.com]
Banner: * OK Dovecot ready.
Host mail01.server.com says it has CAPABILITY for AUTHENTICATE PLAIN
Error login: [mail01.server.com] with user [user@server*master] auth [PLAIN]: 2 NO Authentication failed.
Error login: [mail01.server.com] 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
add comment

4 Answers 4

up vote 3 down vote accepted
+50

I use to run about 5-6 [any] to Zimbra migration per month, and I use ImapSync (latest 'paid' version, but should be no problem if you are using an older one) with delegated access 90% of the times.

Have you tried the --authuser1 and --authuser2 options?

The line you use could be modified as:

imapsync --nosyncacls --syncinternaldates --host1 mail01.server.com --user1 user@server.com --authmech1 PLAIN --authuser1 master --password1 master_password --host2 mail02.server.com --user2 user@server.com --authmech2 PLAIN --ssl2 --password2 user2_password

(eventually add --authuser2 admin@mail02.server.com after --authmech2 PLAIN if you want to use delegated access on Zimbra too)

share|improve this answer
add comment

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

(I wrote imapsync).

share|improve this answer
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.