Mail routing issue

Discussion in 'Installation/Configuration' started by punto, Sep 14, 2006.

  1. punto

    punto New Member


    I have am hosting a domain and website for on my ISPconfig server. However primary mail for the domain is being done on another server. DNS records are correct and it works sometimes.

    What is happening is that an entry is being created in /etc/postfix/local-host-names for and this is causing issues when mail is relayed through the server. Mail arrives and b/c the destination domain is the same as the domain in local hostnames it is not forwarding it on to the correct mailserver but instead trying to deliver it locally. Of course it cant as the user does not exist and hence it bounces, see below

    The following addresses had permanent fatal errors ----- [email protected]
    (reason: 550 <[email protected]>: Recipient address rejected: User unknown in local recipient table)

    As soon as I remove the entry in /etc/postfix/local-host-names it routes the mail correctly and it is delivered to the correct domain. However the entry re-appears again if I change/add any DNS records or of its own accord :confused: (maybe when I restart postfix).
    I have tried deleting and hashing out the domain from /etc/postfix/local-host-names but it still comes back and mail fails once again.

    Any ideas would be appreciated

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Set the website and all co-domains of thei swebsite to external mailserver in ISPConfig.
  3. punto

    punto New Member

    Hi Till,

    Thanks for the suggestion. I already have the primary mx for the domain set to another mail server, mx query below:

    > set q=mx
    Server: ##########

    Non-authoritative answer: MX preference = 10, mail exchanger = anothermailserver MX preference = 20, mail exchanger = nameserver = ns.anotherserver nameserver =
    anothermailserver internet address = internet address =

    As you can see the primary mx is another mail server, but my ISP config server is acting as a secondary, so it should be forwarding mail to the primary when it relays it, but when there is an entry for in the local-host-names it doesnt?? Any other ideas?


  4. pablito

    pablito New Member

    The config for the domain in ISPconfig has an option for "External Server". That is what is overwriting your manual config. Set that to external server and it will then obey the MX rules you have.
  5. punto

    punto New Member

    Thankyou for the advice, will give that a try :)


  6. punto

    punto New Member


    I set the config for the domain to external server, but it still tries to deliver mail locally, when there is an entry in the local-host-names. I have to edit the file and remove the domain before mail can be sent to that domain.

    The following addresses had permanent fatal errors ----- [email protected]
    (reason: 550 <[email protected]>: Recipient address rejected: User unknown in local recipient table)

    It is not looking at the MX records correctly and forwarding the email to the correct mail server?? So frustrating :confused:
  7. falko

    falko Super Moderator ISPConfig Developer

    Go to the "Options" tab and set the domain to "External Mailserver", then go to "Co-Domains", choose the appropriate Co-Domain, go to the "Options" tab and set that Co-Domain to "External Mailserver" as well.
  8. punto

    punto New Member

    Thanks Falko you are a champ, didnt realise I needed to set it in two places.

    Much appreciated :)



Share This Page