1

Topic: Partial migration

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

iRedMail 0.9.9
downloadable installer
Debian 9.9
LDAP
Nginx
Not iRedAdmin-Pro


Hello
Have some issues with my config.
First of all, I have an ISP mail server with about 100 mailboxes and need to migrate to my server within some time. I can’t migrate them in one day.

I’ve installed iRedMail, added mydomain.com as additional and created test mailbox on both servers, installed and configured fetchmail, per sender smtp relay through ISP server, tested to/from external mail address - everything works fine.

But when I started user migration I faced some difficulties:

Postfix returns sender not found and not deliver when fetchmail sends it message to user1@mydomain.com from user2@mydomain.com and user2 doesn’t exist on iRedMail server.

I’ve duplicated ALL mailboxes from ISP to iRedMail server, now postfix and fetchmail deliver everything.

But, now postfix delivers ALL messages from user1@mydomain.com to user2@mydomain.com locally and not send them to ISP. It will be ok, when I migrate ALL users to iRedMail, but not now.

How to modify config of iRedMail for this mail flow?

2

Re: Partial migration

Hi,

Iredmail works as it is designed to. The problem is not iredmail, the problem is that your methodology to migrate mailboxes is incorrect.

Let's say you have a user named John. John current mail is john@isp.com. So you create a new mailbox on your iredmail server named john@mydomain.com then import all john data from his ISP account to his iredmail account.

Once this is done, you go to john ISP account settings and enable forwarding all mails from john@isp.com to john@mydomain.com and ask john to change his old email address everywhere he registered on a website with it. From this moment on you ask john to stop using his ISP account and start using his iredmail account (through iredmail webmail or by setting it up on his phone / computer client).

John will keep receiving mails from his ISP account to his iredmail account, and when that happens it must be a reminder for him to change the mail address on the service linked to it.

After some time John will stop receiving mail from his ISP account, this is where you close it and the migration is complete.

3

Re: Partial migration

Neutro wrote:

Let's say you have a user named John. John current mail is john@isp.com. So you create a new mailbox on your iredmail server named john@mydomain.com then import all john data from his ISP account to his iredmail account.

If it was possible way, it would be much easier.
My ISP addresses is @mydomain.com already and I should use them.
It’s possible configuration, named “split domain” or something like that.
I’ve tried configuration with only few user moved to iRedMail server (split domain as it should be), but stuck on fetchmail partial delivery.

4 (edited by Neutro 2019-07-29 23:50:20)

Re: Partial migration

If you wanna keep the same domain name when changing server you don't have much choice: you must migrate all mailboxes then once it's done you change the mail server address on your domain DNS and you switch everyone from ISP server to your iredmail server at once.

If something goes wrong you just have to change your domain DNS back to what it was.

Plan to do this on a weekend and warn your users ahead to check if their mail are working properly once it's done if they can, so if something goes wrong it wont matter too much in the weekend anyway.

But be ready early monday morning when business starts to address any problems wink

5

Re: Partial migration

Neutro wrote:

If you wanna keep the same domain name when changing server you don't have much choice: you must migrate all mailboxes then once it's done you change the mail server address on your domain DNS and you switch everyone from ISP server to your iredmail server at once.

If something goes wrong you just have to change your domain DNS back to what it was.

Plan to do this on a weekend and warn your users ahead to check if their mail are working properly once it's done if they can, so if something goes wrong it wont matter too much in the weekend anyway.

But be ready early monday morning when business starts to address any problems wink

Negative.
First of all I can't change MX for domain to iRedMail server because it hasn't real IP today. And will not have at weekend smile only month or may be even two later.
Second, my ISP mailserver requires authentication and I can't manage it, so simple config with uplink smtp relay is impossible.

I read about config similar I want to create: https://forum.iredmail.org/topic5126-ir … dmail.html
But not understood what and where should do exactly.

6

Re: Partial migration

This is a bad idea. If your iredmail server doesn't even have an external IP address it's like you're driving a car with no engine.

I told you the right way to do this earlier. If you're afraid to do it one shot, get a second domain name and use the method i gave you in my first post.

If you're skilled enough the 1 shot migration using DNS mail server change could go transparently for your users.

But the first thing to do is to get a proper mail server with a dedicated optical fiber internet line and external IP address.

If the company for whom you're working does not have a broadband internet line nor additional external IP addresses, rent a dedicated server online. For a server with 100 mailboxes a cheap 5€/month server is powerful enough to manage them:
https://www.online.net/en/dedicated-ser … hor-start, though if you company can afford it a server a bit more powerful and with more ram wouldn't hurt.

7

Re: Partial migration

Sad to say there is no easy way to migrate from an old server to a new server with the same domain name. Here is one which we did about 3 months ago. We migrated +200 user mailboxes and +50 aliases from and old server hosted by provider A to a new server hosted by provider B.

1. Install iRedMail on the new server. Sounds like you’ve done this.
2. Configure the DNS records for the new server. Add your SPF and DKIM records. Test to make sure your DKIM works.
3. Test your install to make sure everything works.
4. We batch created all +200 user on the new server using the method described here https://docs.iredmail.org/ldap.bulk.cre … sers.html. In our case the old user was using /etc/passwd authentication. So we took the passwd file and extracted the usernames. The new server used LDAP authentication.
5. We were fortunate that the old server was running dovecot. So we configured replication between the old server and the new server. This sync’ed the mailboxes from the old server to the new server. For this to work your usernames must match between the old and new server. If for whatever reason it doesn’t, you’ll need to do it manually either using doveadm or imapsync (https://imapsync.lamiral.info).
6. Migration process. We sent email to 25 users at a time with the new server URL along with their new password, and instructed them to change their password. The email also contained instructions on how to configure their email client. Because their mailbox is sync’ed with the old server, they can see their emails when they login.
7. We dumped the LDAP db every night and do a diff from the night before. This tells us who hasn’t changed their password yet.
8. After the migration is complete, you add the new server to you MX record and remove the old server.  And you are done.

Hope this helps. Please test this before you actually do it. Good luck.