Migration mail account between exim server ?

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
293
I need to migrate mail accounts between exim servers but I do not know user passwords. And do not want to change or disturb users.

Old server (vestapanel) uses passwd file in format (MD5-CRYPT):

{MD5}$1$s3jmZ3Rg$ja/jVRKSojRyNJmahoarI0

And new server (directadmin) uses passwd file in format (SHA512-CRYPT):

$6$MnPsMdkM$N1WcJJPMIvpkFK905rCO9IWnPcqf6NlFFEKlwsajByfpN9EI3Obg2OfRD839Wl5k7JCzb9rCX.5BKTFeiVtcI0

So I think (please advise if any easy and better way), if I can manage to update old server passwd file to SHA512-CRYPT then I can copy and paste password hashes to new server after I created with a random password. I tested copy and paste hash in passwd file is fine.

But how can I update pass hash to SHA512-CRYPT ? On dovecot page https://wiki2.dovecot.org/HowTo/ConvertPasswordSchemes it shows and example for mysql context but I need to update passwd file.

Can you please guide me?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,818
Location
GMT +7.00
Hello,

The password hashes are one-way encrypted and you can not decrypt them. So no conversion is possible.
I've just checked one of the servers and I see many of them are md5 hashes:

Code:
cat /etc/virtual/*/passwd
and they work all fine.
 

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
293
Problem is this, when I copy md5 hash to sha512 type (from old server to DA- md5 to sha512), I can only login with imap. Pop clients can not use passwords. If I re-set same password in DA, they can login too. So I ended up with converting hashes https://wiki2.dovecot.org/HowTo/ConvertPasswordSchemes
But can I tell exim to use md5 hash along with SHA512 ? So then maybe pop client can auth. too.
Or I would be happy if you can tell me any other way to move users between these servers with out changing and knowing userpasses. :)
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,818
Location
GMT +7.00
What do you mean under copy md5 hash to sha512 type? How do you do that?

I have on my own server both type password hashes under
/etc/virtual/*/passwd:


Code:
support:$1$SVsX4htD$SHgF4R/Csg7v........
sendout:$6$66jdBvTG$Q4.OplHLo0G4........

and I don't have any issue with them.

I believe you are trying to solve a wrong issue.... which is not a root cause of your real issue....
 

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
293
Thank you for the sample. In old server, $1$ pass has a {MD5} prefix which was probably causig smtp not working. After I remove it. Now it works fine. I meant that I was copying that string between passwd files.
 
Top