Mailcow-dockerized: Migrating from basic Dovecot

Created on 13 Aug 2018  路  9Comments  路  Source: mailcow/mailcow-dockerized

Hello.
I'm sorry if this has been asked before, I've been searching but couldn't find anything about this.
I have a basic mail server (Dovecot + Postfix + Spamassassin + etc...) which has 200+ domains and quite a lot of mailboxes. The server is old and we need to move everything to a new machine.
I would like to use Mailcow in the new server, the problem is that I don't know if the mailboxes DB is compatible.
I think that the mailbox password is stored in a custom md5 hash ${magic}${salt}${password} and I don't know if Mailcow still uses that method for storing them. Since I don't have all the passwords for the mailboxes, and I can't ask all the customers to change their passwords, does Mailcow still support that password hashing method?

Most helpful comment

Ah, that's good and something I can easily implement. :-) I will try to do so asap.

All 9 comments

Hi,

Can you provide a hash example for the string "admin"? I can try to integrate it. But SOGo still needs to be able to read it, too.

Hi @andryyy
I've been searching about this and I've found how Roundcube and PostfixAdmin implement this kind of hashing. These are the links to the files:

https://github.com/roundcube/roundcubemail/blob/master/plugins/password/helpers/dovecot_hmacmd5.php
https://github.com/postfixadmin/postfixadmin/blob/master/scripts/snippets/dovecot_crypt.php

I've also found information about it in the Dovecot documentation. They call it MD5-CRYPT: Dovecot PasswordSchemes

MD5-CRYPT: A weak but common scheme often used in /etc/shadow. The encrypted password will start with $1$

This is the hash for the string "admin11": $1$e06247ba$7mE2AMf5w5MYIj/Aw/.wS0
I had to use numbers because password policies, sorry.

Ah, that's good and something I can easily implement. :-) I will try to do so asap.

Thank you @andryyy, I really appreciate it ^^

Hi @andryyy thank you. When you will get this easy implement done.
I really need this to migrate our mailserver to mailcow

thx

Hi, sorry it took so long, will push a fix now.

You will need to prepend {MD5-CRYPT} to the hash! Like {MD5-CRYPT}$1$e06247ba$7mE2AMf5w5MYIj/Aw/.wS0

working! Thank you :D

Hello,

I'm trying to migrate from an older cPanel server to the new mailcow-dockerized - but can't make it to work.

I've done the following:

  1. copied emails from the old server; directory structure is as described here: https://www.thecpaneladmin.com/understanding-courier-imap-and-maildir/
  2. put files to:
  3. /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/
    so that the structure is /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/example.com/username
  4. chown'd everything to 5000:5000
  5. ran docker-compose exec dovecot-mailcow doveadm quota recalc -A
  6. restarted docker

Question 1:
How do I actually associate password data from old server's /home/username/etc/shadow to migrated mailboxes?

Question 2:
Where do I get private and public*.pem keys which are required in the encrypt script ?

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgleim picture lgleim  路  3Comments

bonanza123 picture bonanza123  路  3Comments

zkryakgul picture zkryakgul  路  3Comments

CrAazZyMaN21 picture CrAazZyMaN21  路  3Comments

schoebelh picture schoebelh  路  3Comments