1

Topic: Sharing mails between 2 domains in iRedMail and Exchange

====- iRedMail version: 0.8.6 (Free Version)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 6.5
- Related log if you're reporting an issue:
====

Hello,

Got a domain1.com set on iRedMail and a domain2.com set on MS Exchange.

I would like to setup the same domain2.com also on iRedMail.
How can this be set on iRedMail ? as a normal domain creation !?
How can I set the iRedMail to check first IF exists a user@domain2.com on iRedMail IF NOT check
user@domain2.com on MS Exchange.

How can I manage to get this to work?
Thank you.

----

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

2

Re: Sharing mails between 2 domains in iRedMail and Exchange

Just curious, why add domain2.com on iRedMail since it's hosted on MS Exchange?

3

Re: Sharing mails between 2 domains in iRedMail and Exchange

ZhangHuangbin wrote:

Just curious, why add domain2.com on iRedMail since it's hosted on MS Exchange?

MS Exchange hardware limitation (physical machine) users quota hitting the storage limit, a new virtual machine for iRedMail !

4

Re: Sharing mails between 2 domains in iRedMail and Exchange

Any ideas ?

Some help is welcome!
Thank you.

5

Re: Sharing mails between 2 domains in iRedMail and Exchange

Are you going to host mail domain 'domain2.com' on both MS Exchange and iRedMail? Which has higher priority in DNS MX record?

6

Re: Sharing mails between 2 domains in iRedMail and Exchange

Thanks for your attention!

Exchange will have ONLY domain2.com and higher priority in DNS MX record.
iRedMail will have both domains, domain1.com AND domain2.com and lower priority in DNS MX record.

7

Re: Sharing mails between 2 domains in iRedMail and Exchange

If you host 'domain2.com' on iRedMail, when you sent email from iRedMail server to user '@domain2.com', emails will be delivered locally (on iRedMail), not delivered to MS Exchange.

8

Re: Sharing mails between 2 domains in iRedMail and Exchange

Have you looked at this:  http://www.iredmail.org/forum/topic334- … ution.html

This setup would allow you to direct each user in a single domain to the mail server of your choice on an individual basis.

9

Re: Sharing mails between 2 domains in iRedMail and Exchange

Thanks slefevre!

Looks close to what I need! "Relay all mails for one domain to another mail server"

I don't want to relay "ALL" of them to another mail server, I only need to relay to other mail server IF the user don't exist on server domain!

Image 2 mail servers with only one domain! How can they check/deliver mails between them if half users are created on server A and the other half on server B?


Let me explain better:

iReadMail - has 2 domains = domain1.com + domain2.com  (some local users: user1@domain1.com, user2@domain2.com)
MS Exchange - has 1 domain = domain2.com (some local users: user3@domain2.com)

domain2.com is a common  domain between them !

Scenario 1: Email arrives to user2@domain2.com, the mail server knows that mailbox is created on iRedMail so keeps it and stores on iRedMail!

Scenario 2: Email arrives to user3@domain2.com, the mail server (iRedMail) should check for that mailbox IF NOT EXIST relay's to MS Exchange mail server !

help is welcome smile

10

Re: Sharing mails between 2 domains in iRedMail and Exchange

Any ideas ?
Some help is welcome!
Thank you.

11

Re: Sharing mails between 2 domains in iRedMail and Exchange

digitalbit wrote:

I don't want to relay "ALL" of them to another mail server, I only need to relay to other mail server IF the user don't exist on server domain!

With default iRedMail settings, it cannot check whether or not this user doesn't exist on MS Exchange. But if Exchange stores mail accounts in Active Directory, you can add addition LDAP queries in Postfix (on iRedMail server) to query existing mail users.

digitalbit wrote:

Image 2 mail servers with only one domain! How can they check/deliver mails between them if half users are created on server A and the other half on server B?

Although you MAY configure iRedMail to query mail users hosted on MS Exchange, but i don't think you can configure Exchange to query users hosted on iRedMail.

digitalbit wrote:

Let me explain better:
...
Scenario 1: Email arrives to user2@domain2.com, the mail server knows that mailbox is created on iRedMail so keeps it and stores on iRedMail!
Scenario 2: Email arrives to user3@domain2.com, the mail server (iRedMail) should check for that mailbox IF NOT EXIST relay's to MS Exchange mail server !

12

Re: Sharing mails between 2 domains in iRedMail and Exchange

digitalbit wrote:

I don't want to relay "ALL" of them to another mail server, I only need to relay to other mail server IF the user don't exist on server domain!

With default iRedMail settings, it cannot check whether or not this user doesn't exist on MS Exchange. But if Exchange stores mail accounts in Active Directory, you can add addition LDAP queries in Postfix (on iRedMail server) to query existing mail users.

digitalbit wrote:

Image 2 mail servers with only one domain! How can they check/deliver mails between them if half users are created on server A and the other half on server B?

Although you MAY configure iRedMail to query mail users hosted on MS Exchange, but i don't think you can configure Exchange to query users hosted on iRedMail.

digitalbit wrote:

Let me explain better:
...
Scenario 1: ...
Scenario 2: Email arrives to user3@domain2.com, the mail server (iRedMail) should check for that mailbox IF NOT EXIST relay's to MS Exchange mail server !

13

Re: Sharing mails between 2 domains in iRedMail and Exchange

digitalbit wrote:

I don't want to relay "ALL" of them to another mail server, I only need to relay to other mail server IF the user don't exist on server domain!

With default iRedMail settings, it cannot check whether or not this user doesn't exist on MS Exchange. But if Exchange stores mail accounts in Active Directory, you can add addition LDAP queries in Postfix (on iRedMail server) to query existing mail users.

digitalbit wrote:

Image 2 mail servers with only one domain! How can they check/deliver mails between them if half users are created on server A and the other half on server B?

Although you MAY configure iRedMail to query mail users hosted on MS Exchange, but i don't think you can configure Exchange to query users hosted on iRedMail.

digitalbit wrote:

Let me explain better:
...
Scenario 1: ...
Scenario 2: ...

your scenario is wrong.

Sender mail servers (e.g. Gmail) will connect to mail server which has higher priority defined in MX record. Let's say iRedMail server has higher priority, then Gmail will always deliver emails to iRedMail servers. So what you need to do is just make sure iRedMail will relay required mails to Exchange. Unless you have both servers has the same priority.

@slefevre already gave you doc link of how to set per-user relay, you will need this doc.

14

Re: Sharing mails between 2 domains in iRedMail and Exchange

Dear ZhangHuangbin,

Your explanation makes perfect sense !

Need your help to setup a different approach then.

1 - How to setup a iRedmail server with 2 domains, domain1.com = Authoritative and domain2.com = Non-Authoritative ?
2 - How to setup the non-authoritative domain2.com to relay per-domain email with MySQL (not LDAP) ?

I appreciate your grateful help.

15

Re: Sharing mails between 2 domains in iRedMail and Exchange

It's mentioned in this thread.

1: authoritative: Just priority in MX DNS record.
2: Per-domain relay/transport. You can set it in SQL table "vmail.domain", column "transport".

16

Re: Sharing mails between 2 domains in iRedMail and Exchange

Thank you very much ZhangHuangbin.

Just one more question on the same context.

Is there a any to make a domain Non-Authoritative in master.cf or main.cf on postfix ? If yes, how to ?

17

Re: Sharing mails between 2 domains in iRedMail and Exchange

digitalbit wrote:

Is there a any to make a domain Non-Authoritative in master.cf or main.cf on postfix ? If yes, how to ?

Do you mean backupmx? If so, you can update SQL column "domain.backupmx" to mark domain as backupmx.

18

Re: Sharing mails between 2 domains in iRedMail and Exchange

It's not a backupMX! It's a Non-Authoritative domain2.com (this one will work Per-domain relay/transport)
Is it possible to setup a Non-Authoritative domain2.com in master.cf or main.cf on postfix?

19

Re: Sharing mails between 2 domains in iRedMail and Exchange

Sorry, i don't understand what "Non-Authoritative" domain is. sad

20

Re: Sharing mails between 2 domains in iRedMail and Exchange

Thank you very much for the support ZhangHuangbin.

Basically the need for a non-authoritative domain in my scenario, is that I need to setup domain2.com to receive emails from a domain that his not the owner (authoritative) of the domain!

*http://technet.microsoft.com/en-us/library/bb124423(v=exchg.150).aspx

How can I setup the second domain in iRedMail (domain2.com) with postfix being able to receive emails from a domain that he (iRedMail ) his not the authoritative owner!

Thanks again!

21

Re: Sharing mails between 2 domains in iRedMail and Exchange

According to the Microsoft doc link in your post, i believe what you're looking for is "relay" in Postfix.

* "authoritative domains" in Exchange => The mail domains you hosted in iRedMail, you have mail accounts under these domains, users sent email through your server, and other mail servers deliver emails sent to these users to your server.

* "relay domains" in Exchange => Relay domains in Postfix.

Am i right?

22

Re: Sharing mails between 2 domains in iRedMail and Exchange

Dear ZhangHuangbin,

Yes it is a relay also. The only information am I missing is:

Simple scenario:

iRedMail  = 2 domains (domain1.com + domain2.com)
Exchange = 1 domain  (domain2.com)

#1 - Can iRedMail ACCEPT emails from Exchange on the domain2.com? (knowing that domain2.com does not belong only to iRedMail server).
#2 - Does iRedMail needs any extra configuration to accept emails from (Exchange) domain2.com?
(p.e. - remove "reject_sender_login_mismatch" from smtpd_sender_restrictions in main.cf )

I really appreciate your grateful help.

23

Re: Sharing mails between 2 domains in iRedMail and Exchange

digitalbit wrote:

#1 - Can iRedMail ACCEPT emails from Exchange on the domain2.com? (knowing that domain2.com does not belong only to iRedMail server).

You can try to add IP address of Exchange server in Postfix (on iRedMail server) parameter "mynetworks =".

digitalbit wrote:

#2 - Does iRedMail needs any extra configuration to accept emails from (Exchange) domain2.com?

Should be fine. You should test it first.

24

Re: Sharing mails between 2 domains in iRedMail and Exchange

Thank you very much for the support !