How to configure postfix to forward mail to exchange server.

Posted on 2009-02-22
Last Modified: 2013-11-10

I setup a FreeBSD mail server in front of my exchange server for mail filtering.
So please explain step by step how to configure postfix to forward only inbound mail to exchange.
Question by:jacksch4820
    LVL 25

    Expert Comment

    so it ONLY handles incoming email?  outbound goes straight from the exchange server or relays back to the postfix server?

    if it only handles incoming, its easy, just add this to the

    relayhost=<<fqdn or IP of exchange>>
    relay_domains=<<domain name>>

    if exchange relays back, then you'll add this instead

    relay_domains=<<domain name>>
    my_networks=<<what is there now>>,<<ip of exchange>>

    then in the transport file you add this

    <<domain name>>:  <<fqdn or IP of exchange>>

    then delete the old transport.db and restart postfix.  It should auto-recreate the transport hash file for you then.  To do it manually, you use postmap.

    Author Comment

    Yes only handles incoming email outbound goes straight from exchange server out to external.

    relay_domains=<<domain name>> what domain name

    I have a windows server 2003 domain  zentura.local
    My external MX record is
    My exchange has two recipient policy default on zentuar.local and one I had
    And will postfix accept inbound mail or what must I add on postfix to accept mail from external.
     Please explain.
    LVL 25

    Expert Comment

    it would be  You put in that list whatever is after the @ in the email. should be pointed to the public IP used for the postfix server.  Oh, and check that inet_interfaces is set to all in as well because by default it only listens on the loopback interface.  This will ensure email can get to the postfix server and the other config options I gave earlier will ensure it gets forwarded to exchange properly.

    Author Comment

    Hi Cyclops3590

    My virus wall will forward all incoming traffic to FreeBSD mail server.
    So when I add this config in my
    All incoming traffic is accepted by postfix and routed to exchange server

    relayhost = ip of exchange server
    relay_domains =
    inet_interfaces = all
    LVL 25

    Accepted Solution

    yes.  I'm not a 100%, but you might even be able to leave the relay_domains part off the config.  I can't remember for sure, but having it in there won't hurt.

    however, one change, its probably better to do this for relay_domains

    This way it will relay for whatever is listed in the mydestination parameter as well which it does by default.
    LVL 19

    Expert Comment

    by:bevhost and must not be listed in mydestination.

    Featured Post

    How does your email signature look on mobiles?

    Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

    Join & Write a Comment

    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
    To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
    The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now