LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-10-2015, 04:10 PM   #1
aalger
LQ Newbie
 
Registered: Sep 2014
Location: Prine George, British Columbia Canada
Posts: 11

Rep: Reputation: Disabled
How to Relay mail back to Exchange if an Exchange mailbox exists in Exchange


Hi All, I am trying to Migrate a Linux Sendmail Mail system to Exchange 2013 over time, By migrating users to Exchange mailboxes one an individual user by user basis. Linux does a LDAP query of active directory to see if the user exists and also uses LDAP query to AD to authenticate client logins to mail system.

Currently our DNS is configures to receive All incoming mail coming into exchange where the it checks for the to see if an exchange mailbox exists for the recipient of the incoming mail messages. If no mailbox exists then the mail is forwarded to the Linux Mail server.

All this works rock solid but the issue I am running into is getting Linux to send mail back to the Exchange Server for internal users that are using the Linux mail server and sending to users that have a mailbox on Exchange.

I need to find out how to get the Linux Mail server to check for the existence of an exchange mailbox in the active directory and if it exists to forward mail for that user to exchange.

Thank You in advance for any help you can provide - I am newer to Linux but I can move around a bit and fumble around enough to make changes to the Linux system as needed so far....
 
Old 03-10-2015, 10:25 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Let me get this straight:

1. You have two mail system running in your infra Sendmail on Linux and Exchange 2013.
2. You are in process of migrating users from Sendmail to Exchange 2013.
3. DNS and MX record point to your Exchange 2013 mail system so anyone sending email from outside will first hit Exchange and if the mailbox doesn't exist it will get forwarded to sendmail.
4. Assuming you have got around 20% users migrated to Exchange 2013 and still 80% of them are on Sendmail linux.

Situation:

You want to check from Linux end whether the user exist or not in Exchange 2013 and if yes forward the email to it when sent by an internal user. Why you need to do that?

I mean if you have moved the accounts to Exchange 2013 then by default when a Sendmail user will send email to Exchange user, the email will go on the internet, will come back to your domain and land in Exchange 2013 mailbox of that user.

Another situation is that if you have not moved accounts (or disabled accounts in Sendmail) to Exchange 2013 instead just created the user accounts in Exchange 2013, in that case you can set forwarding rule (forward as it is, to make sure that when the email arrives in Exachange 2013 it shows the original sender)on Sendmail account to forward it to exchange mailbox.
 
Old 03-11-2015, 10:53 AM   #3
aalger
LQ Newbie
 
Registered: Sep 2014
Location: Prine George, British Columbia Canada
Posts: 11

Original Poster
Rep: Reputation: Disabled
Arrow

Let me get this straight:

1. You have two mail system running in your infra Sendmail on Linux and Exchange 2013.
(Alan's Response) Yes I have mail systems running - sharing same domain name space.

2. You are in process of migrating users from Sendmail to Exchange 2013.
(Alan's Response)
I have only created Test Mailboxes because so far because I need to get around the problem where messages from Linux users are not being sent to the test user with Exchange mailbox because the user is also local user on the Linux Mail server. That is why I want Linux to make the LDAP query for the existence of an Exchange Mailbox for that user and if a mailbox exists, relay the message to the Exchange server (Internally)

3. DNS and MX record point to your Exchange 2013 mail system so anyone sending email from outside will first hit Exchange (Correct) and if the mailbox doesn't exist it will get forwarded to sendmail. (Correct)

4. Assuming you have got around 20% users migrated to Exchange 2013 and still 80% of them are on Sendmail linux.

Situation:

You want to check from Linux end whether the user exist or not in Exchange 2013 and if yes forward the email to it when sent by an internal user. Why you need to do that? (Alan's Response)The only messages not getting to exchange are messages that are sent by existing Internal Linux users not yet converted to Exchange.
I want to do that so people that have been moved to Exchange continue to get messages from Linux mail users.

I mean if you have moved the accounts to Exchange 2013 then by default when a Sendmail user will send email to Exchange user, the email will go on the internet, will come back to your domain and land in Exchange 2013 mailbox of that user.

(Alan's Response) No the mail does not go out to Internet because the user exists locally on Linux as well with the same e-mail address. NOTE: The user on Linux and Exchange have the same e-mail address on both Linux and Exchange and are being authenticated against the same active directory.

(Alan's Comment)
Maybe I just need to properly Disable the Account or mailbox on Linux when I create the Exchange Mailbox.
I have tried deleting the User on Linux but it automatically get created again when someone sends the user mail because Linux does an LDAP query and sees that an account exists in AD and recreates the account.

Another situation is that if you have not moved accounts (or disabled accounts in Sendmail) to Exchange 2013 instead just created the user accounts in Exchange 2013, in that case you can set forwarding rule (forward as it is, to make sure that when the email arrives in Exachange 2013 it shows the original sender)on Sendmail account to forward it to exchange mailbox.

(Alan's Response) I am not understanding what you are saying in the last paragraph "Another Situation"

Thanks for taking the Time T3RM1NVT0R
 
Old 03-11-2015, 11:46 AM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
1. You have two mail system running in your infra Sendmail on Linux and Exchange 2013.
(Alan's Response) Yes I have mail systems running - sharing same domain name space.
That is something interesting, I have worked on such migration but at that time we have created a separate domain name to avoid such situation. So any external email when sent get delivered to old system from where it get forwarded to new system and an auto reply goes to the sender stating the change in the email address, requesting to communicate on the new email address next time.

Quote:
2. You are in process of migrating users from Sendmail to Exchange 2013.
(Alan's Response)
I have only created Test Mailboxes because so far because I need to get around the problem where messages from Linux users are not being sent to the test user with Exchange mailbox because the user is also local user on the Linux Mail server. That is why I want Linux to make the LDAP query for the existence of an Exchange Mailbox for that user and if a mailbox exists, relay the message to the Exchange server (Internally)
I doubt that it will work because the email address is the same, the reason I am saying so because MUA will send to MDA and won't even reach to MTA for external routing because this being internal email. I don't think MDA will be intelligent enough or there will be an MDA option to forward to exchange server instead of doing internal routing.

Quote:
3. DNS and MX record point to your Exchange 2013 mail system so anyone sending email from outside will first hit Exchange (Correct) and if the mailbox doesn't exist it will get forwarded to sendmail. (Correct)
This part looks good but as I said you are using the same email address for both email system which is a bit confusing for the system when it comes to routing emails.

Quote:
4. Assuming you have got around 20% users migrated to Exchange 2013 and still 80% of them are on Sendmail linux.

Situation:

You want to check from Linux end whether the user exist or not in Exchange 2013 and if yes forward the email to it when sent by an internal user. Why you need to do that? (Alan's Response)The only messages not getting to exchange are messages that are sent by existing Internal Linux users not yet converted to Exchange.
I want to do that so people that have been moved to Exchange continue to get messages from Linux mail users.

I mean if you have moved the accounts to Exchange 2013 then by default when a Sendmail user will send email to Exchange user, the email will go on the internet, will come back to your domain and land in Exchange 2013 mailbox of that user.

(Alan's Response) No the mail does not go out to Internet because the user exists locally on Linux as well with the same e-mail address. NOTE: The user on Linux and Exchange have the same e-mail address on both Linux and Exchange and are being authenticated against the same active directory.

(Alan's Comment)
Maybe I just need to properly Disable the Account or mailbox on Linux when I create the Exchange Mailbox.
I have tried deleting the User on Linux but it automatically get created again when someone sends the user mail because Linux does an LDAP query and sees that an account exists in AD and recreates the account.

Another situation is that if you have not moved accounts (or disabled accounts in Sendmail) to Exchange 2013 instead just created the user accounts in Exchange 2013, in that case you can set forwarding rule (forward as it is, to make sure that when the email arrives in Exachange 2013 it shows the original sender)on Sendmail account to forward it to exchange mailbox.
Same as my answer for point number 2. Deleting users will not work as it getting synced via ldap, and if you delete from ldap it will go off from Outlook as well, so don't try that.

Quote:

(Alan's Response) I am not understanding what you are saying in the last paragraph "Another Situation"

Thanks for taking the Time T3RM1NVT0R
My last para was based on the assumption that you have got two email systems running with different domain names but that is not the case. You have got both system using the same domain / email address. You can ignore that para.

You're welcome :-)
 
Old 03-11-2015, 12:02 PM   #5
aalger
LQ Newbie
 
Registered: Sep 2014
Location: Prine George, British Columbia Canada
Posts: 11

Original Poster
Rep: Reputation: Disabled
Wink Another Domain name would have been far easier

Hi T3rminator - Yes, another domain would have been far easier but the domain name that we wanted was not available, and my bosses did not want any change to the e-mail addresses
 
Old 03-11-2015, 12:06 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
If that is the case the best bet from my point of view would be to get all accounts which are on Linux mail system (Sendmail) to exist on Outlook 2013. You may want to take downtime for 24 hours, I hope that should be sufficient if you don't have more than 10000 users. You might want to use some automation to get user accounts created in Outlook 2013.

As far as I am aware usually your mails can be kept on hold for 72 hours if undeliverable before they get into blackhole.

Once you get new accounts in Outlook 2013 you can work in the backend to get the mails which are there on Linux mail system to Outlook 2013. In that way you don't have to worry about new emails which are coming in.
 
Old 03-11-2015, 12:25 PM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Currently our DNS is configures to receive All incoming mail coming into exchange where the it checks for the to see if an exchange mailbox exists for the recipient of the incoming mail messages. If no mailbox exists then the mail is forwarded to the Linux Mail server.
Actually you don't need a downtime, you can do that by just modifying the script to anyway forward the email to Linux Mail Server whether it exist on Outlook or not. In that way existing users can keep sending email from Linux mail system but the new emails will get accumulated in both Outlook 2013 and Linux Mail system.

Also, you might want to have a look at: https://social.technet.microsoft.com...m=exchange2010
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Sendmail to relay all mail to my Exchange Server TimothyBoggess Linux - Newbie 8 04-18-2017 07:41 AM
Using postfix to relay to MS Exchange allowing only mail to my domain rsduhamel Linux - Server 3 05-13-2011 11:24 PM
internal mail relay to exchange setup help supradrvr Linux - Server 2 01-26-2010 07:38 PM
configure sendmail to relay mail to exchange server goldwing Red Hat 3 10-18-2008 04:07 PM
Relay mail to exchange with Sendmail slow keysorsoze Linux - Software 0 07-17-2007 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration