Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a postfix mail server that should relay all outgoing mail to an Exchange 2010 server (the Exchange box is my smarthost). I have administrator access to the Exchange 2010 system, but I'm not very familiar with it. How should I set up authentication on the Exchange 2010 system?

I guess I could add a standard user with a mailbox on the Exchange box, then configure my postfix box to log in to port 587 to relay mail. That option doesn't feel right -- it seems like there should be way to do server to server authentication, not just client to server authentication. Is there? If so, how would I set it up?


  • the postfix mail server is at a remote site with a dynamic IP address, so authenticating by IP address won't work
  • I would like the email traffic between the two to be encrypted
  • I would like mutual authentication (the Postfix box knows it's talking to the Exchange box and not a man in the middle; Exchange knows that it is talking to the Postfix box)
  • setting up an IPsec tunnel seems overly complicated for what should be a trivial Exchange configuration
  • Exchange must allow the Postfix box to send messages to any destination
  • the messages submitted by the Postfix box must not be rejected as spam even if they look like spam
share|improve this question
I see your edits. You can turn on encryption... SSL or TLS. You didn't initially say that the server was offsite. Ideally, you have an IP range you can limit to. If not, use authentication. The menus in my answer are the same, without the IP and Anonymous relay portions. – ewwhite Sep 10 '12 at 20:45
@ewwhite: Apologies for forgetting to mention that the server was off-site. If I choose 'Basic Authentication', what do I use as the username and password? What 'Permission Groups' should I use? Can I somehow extend the existing client receive connector so that I can still use the standard message submission port (587)? – Richard Hansen Sep 10 '12 at 21:17

I usually don't have my Linux and internal servers authenticate to the Exchange server if they're on the same network. Same for other devices that may need to relay (copiers, monitoring systems, etc.). I still may need the smarthost funcationality, though.

The approach I take to enable a dumb server/device-to-server relay like what you're looking for is to enable the smarthost on the Postfix or Sendmail system. It seems as though you know that part. For Sendmail, it's a matter of uncommenting the "dnl" line related to the SMARTHOST entry in /etc/mail/, and defining an address. For Postfix, it's defining relayhost in /etc/postfix/ (restart both daemons after the change)

On the Exchange 2010 side, you need to create a new Receive Connector:

Exchange System Manager -> Server Configuration -> Hub Transport -> Receive Connector

Add a new one by right-clicking the frame and selecting "New Receive Connector".

Name it something descriptive, like the FQDN of the Linux server you wish to send from (e.g.

enter image description here

Specify the address/mask of the relaying server; in this example.

enter image description here

Continue through the prompts and add the receive connector.

Open the Exchange Management Shell command line window.

You'll want to grant your new receive connector Anonymous privileges.


Get-ReceiveConnector RelayConnector | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "ms-Exch-SMTP-Accept-Any-Recipient"

...where "RelayConnector" is in my example.

Immediately select the newly-created entry in the Management GUI and select "Properties".

In the "Authentication" tab, deselect all entries. In the "Permission Groups" tab, ensure "Anonymous users" is checked. That's all!

enter image description here enter image description here

share|improve this answer
what happens if we don't add the ADPermission and just do it from the console? – fmysky Sep 9 '12 at 22:46
@fmysky It won't work the way you'd want. It's a matter of treating the relaying source as trusted versus untrusted. Try it and see. – ewwhite Sep 9 '12 at 22:49
just the matter of granular permissions to be set. Thanks for the link. – fmysky Sep 9 '12 at 23:04
Thanks for the answer. Unfortunately, the Postfix box has a dynamic IP address (see updated question), so authenticating by IP address won't work for me. Is there a way to authenticate by username and password instead? – Richard Hansen Sep 10 '12 at 20:43

I believe there are 2 components to the solution:

You can control email relay in exchange by IP, by permission, by using IPSec or mTLS. For an internal unix postfix box, the easiest would be to restrict by IP. You need to create a Send Connector and limit the IP-scope, as detailed in the guide above.

You may need to look-up specific smarthost forwarding guides for postfix.

Configuring Server-Server Authentication between postfix and exchange: Exchange 2010 uses mTLS for externally secured mail relay. Here's a guide on how to set this up from Exchange end.

Postfix also supports TLS authentication, but I am not sure how to configure the postfix side of the solution.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.