1

Topic: Domain alias with some users migrated to iRedMail

Hello

I have domain alias + shadowAddress setup on iRedMail so together with mails going to old mail server and being forwarded to the iRedMail to be delivered to the new mail server.

i.e.

* old mail server - domain mail.mydomain.com with user myuser@mydomain.com -> this user has alias setup to send any mails to myuser@mydomain2.com

* new mail server (iRedMail) - domain mail.mydomain.com with user myuser@mydomain.com and shadowAddress of myuser@mydomain2.com

MX record for mydomain still pointing to old server
MX record for mydomain2 pointing to iRedMail server

What i have noticed is when myuser sends email out to any other user to the mydomain.com on iRedMail, they get 'no virtual mailbox' error since i assume it knows because iRedMail has the mydomain.com domain, it is not consulting the mx record but sending it internally. (correct me if i am wrong)

But what i would like to do is iRedMail to still send mails to mydomain.com to the old mailserver while i migrate the mail box/MX record etc

can this be done?

thanks in advance

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Domain alias with some users migrated to iRedMail

Why not host only mydomain2 on iRedMail?

3

Re: Domain alias with some users migrated to iRedMail

ZhangHuangbin wrote:

Why not host only mydomain2 on iRedMail?

Hi - thanks for getting back to me

i did think about that but was not sure if iRedMail allowed you to use both the hosted user name AND shadowAddress to login/fetch mails. i need to have the old domain because eventually its going to be migrated over to new mail server.

So can iRedMail do this?

* Just host mydomain2.com on iRedMail and create shadowAddress myuser@mydomain.com (i.e. reverse of what i have set up)
* Then migrate myuser@mydomain.com user to new iRedMail server
* When myuser@mydomain.com on the NEW iRedMail server logs in and sends email to anotheruser@mydomain.com, would iRedMail work out that to send it to the old mail server and not sending it internally (i suspect not because the hosted domain will be mydomain2.com on iRedMail?)
* And the myuser on the new iRedMail can still use the old myuser@mydomain.com to login and fetch mail from iRedMail ? i.e. use the shadowAddress

Do you follow what i'm trying to do?

4

Re: Domain alias with some users migrated to iRedMail

Would the following achieve what i want to do?

http://www.iredmail.org/forum/topic334- … ution.html

5

Re: Domain alias with some users migrated to iRedMail

Hello? Is any of the DEVs around? Is posting to this forum best way to get support as 'paid' customer?

6

Re: Domain alias with some users migrated to iRedMail

How about this:

* Host mydomain on old server
* Host mydomain and mydomain2 on iRedMail, mydomain2 is an alias domain of mydomain.
* Add necessary accounts on iRedMail server, e.g. myuser.
* Add one more lookup file in /etc/postfix/main.cf on iRedMail, query users which stored in old server. e.g.

virtual_mailbox_maps =
    proxy:ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf,
    proxy:ldap:/etc/postfix/virtual_mailbox_on_old_server.cf    # <-- add this line.

* Configure /etc/postfix/virtual_mailbox_on_old_server.cf, it should be like /etc/postfix/ldap_virtual_mailbox_maps.cf, for example:

server_host     = x.x.x.x         # This is IP address of your old server.
server_port     = 389
version         = 3
bind            = yes
start_tls       = no
bind_dn         = cn=vmail,dc=iredmail,dc=org      # <-- Use bind dn on your old server
bind_pw         = RvIwFtOOLbnwOcvmuT5TtY3nVQw7Uy
search_base     = o=domains,dc=iredmail,dc=org
scope           = sub
query_filter    = (&(objectClass=mailUser)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))
result_attribute= mailMessageStore
debuglevel      = 0

Of course you may want to modify more settings in this file.

* Use 'postmap' to test it. for example:

# postmap -q 'user@domain.ltd' ldap:/etc/postfix/virtual_mailbox_on_old_server.cf

Here, 'user@domain.ltd' is one of mail accounts on your old server.

That's all.

P.S. To be clear, purchasing iRedAdmin-Pro doesn't means purchasing support for iRedMail.
I try my best to response as quick as possible, but i'm not living in this forum, so, please forgive me, and please be gentle.

7

Re: Domain alias with some users migrated to iRedMail

ZhangHuangbin wrote:

How about this:

...

P.S. To be clear, purchasing iRedAdmin-Pro doesn't means purchasing support for iRedMail.
I try my best to response as quick as possible, but i'm not living in this forum, so, please forgive me, and please be gentle.

Many many thanks for your reply.
I will have a look at your solution although as my old mail server is not based on LDAP AFAIK, i'm not sure if i can use your solution as is but it certainly gave me a a good guidance on where to start.

And I am sorry for the urgent nature of entries that has been made in previous posts - i did not mean to cause any offence and certainly did not expect you to be looking at the forum 24x7 so for that i apologise. I have certainly had great quick responses from yourself from my previous questions on this forum.

many thanks again

8

Re: Domain alias with some users migrated to iRedMail

cerics wrote:

I will have a look at your solution although as my old mail server is not based on LDAP AFAIK,

Of course you can use mysql lookup instead. This is just a sample.