Postfix relay for Exchange

Discussion in 'Server Operation' started by ariek, Jun 20, 2007.

  1. ariek

    ariek New Member

        1.            2.                 3.                    4.
    PF/IMAP/SQ     ADmember           Postfix MX?              MX?

    Above is my mail config. It's not exactly the ideal situation(...). 1, 2 & 4 are working, and dealing with loads of mail, so there's no problem. Part 3 has to take part to fight spam, and control and visualise amounts (mailgraph). There are a few things I can not find any answers for, so hopefully someone can help me out.

    - The easiest way would be to just relay all mail with destination domain.dom in the order 1->2->3->4;
    - The reply order should be 4->3->2->1;

    1. How do I have to configure the relay part? After reading many pages I concluded that user (ie. SMTP address) authentication is nessessary for Postfix, otherwise it will just not work. Is this a fact?
    There is an easy way to configure authentication with a perl script to check all Active Directory SMTP addresses:
    2. With the method discribed above I managed to replicate this in a test environment from 1 - 4 without a problem. Internet in the test environment is in this case another Postfix/CourierIMAP/Squirrelmail server with a few fake domains.
    3. The problem starts when I reply as an Exchange user. The message stops at point 3 with the message: status=bounced (Host or domain name not found. Name service error for name=internet.test type=AAAA: Host not found.) The message is quite logic, because the host does not exist. So here we get to the point.
    4. How can I let all mail from 4, relay via 3 to 2? Or, maybe even better, how can I create a transparent relay server?.

    The extra options I configured for the Postfix server of number 3.
    mydomain = test.lan
    myorigin = $mydomain
    #relay_transport = smtp:[testiis.test.lan]
    relay_domains = test.lan
    relay_recipient_maps =  hash:/etc/postfix/ad_users
    show_user_unknown_table_name = no

    I know it's quite a story, but I couldn't find another way to tell it.

    Last edited: Jun 20, 2007
  2. falko

    falko Super Moderator ISPConfig Developer

    Take a look here:

    You could add internet.test to /etc/hosts, if there's no DNS record for it.
  3. ariek

    ariek New Member

    Falko, thanks for the reply.
    Of course I could add that particular domain, but that's unfortunatly not possible with all the other domains I will have to reply to in the future:rolleyes:
    I'm afraid that your howto will not work in my case, because of its different setup, also combined with Exchange.

    The thing I'm realy looking for is a 'transparent' way, to transport e-mail from server 4 to server 2. When I use the option
    relayhost =
    all e-mail will be relayed true that server, ie. nothing will arrive at
    Hopefully I explained the complexity clearly enough. Do you have any other tips of advise?
    Again, many thanks in advance.
    Last edited: Jun 21, 2007
  4. ariek

    ariek New Member

    The line I was looking for is:
    transport_maps = hash:/etc/postfix/transport
    In transport you need something like
    Code:        relay:[]
    where the brackets take care of MX record search.
    You also need
    relayhost = testiis.test.lan
    to take care of all remaining relaying.
    Transport super seeds relayhost.

    Together with relay_recipient_maps the Postfix/Exchange picture is complete.
    If you don't want to check on users do not mention the domain, in this case, in mydestination.
    Last edited: Jun 25, 2007

Share This Page