secondary mailhost

Discussion in 'Feature Requests' started by babbel, Nov 15, 2006.

  1. babbel

    babbel New Member

    I'm testing ISPconfig for a month now and I'm very happy with it, great product, I will install it on my production server soon!

    I think it would be a nice feature to be able to act as seconday mx-host for a domain. An adition to this is the possibility to accept mail for a certain domain and forward it to another host, but at a different port than 25 because this port is often blocked by ISPs.
  2. falko

    falko Super Moderator ISPConfig Developer

    All you have to do for this is create another MX record for the domain which has a lower priority than the first record. If the first mailserver fails, mails are delivered to the second one which keeps the mails until the first one comes up again. When the first one's up again, the secondary sends the mails to the first one.
  3. babbel

    babbel New Member

    That I understand, but it would be nice if it is possible to be able to act as a secondary MX within ISPconfig for a domain that is not hosted within ISPconfig.

    If for example a friend of mine has his own mailserver, but wants my server to act as a secondary mx host, it would be nice to manage this through ISPconfig. At the moment I provide this service to some people, but as far as I have seen this is not possible whitin ISPconfig.

    By the way, I think the second MX records has to have a higher number than the first record. Mail is delivered at the server with the lowest number first. :)
    Last edited: Nov 16, 2006
  4. falko

    falko Super Moderator ISPConfig Developer

    You have to create a second MX record on the authoritative name server for the domain. If this server is your ISPConfig server, you can use ISPConfig's DNS Manager for it, otherwise you have to use the tools that the authoritative name server provides. There's nothing ISPConfig or any other control panel can do about it if the authoritative name server is different from your ISPConfig server.

    That's right. Higher number = lower priority. :)
  5. babbel

    babbel New Member

    I think we're talking about something else, let me try to give a concrete example. These are two DNS entries regarding my friends domain, these entries has nothing to do with my ISPConfig server and might be setup at any DNS server he likes.

    1st mx record: 10
    2nd mx record: 20

    My friends own mailserver is the first record and that server contains the mailboxes. This server has nothing to do with ISPConfig (or mabye it is running ISPConfig if he is smart, but it's not necessary :) ). Now I would like to provide him mail backup in case his server is not reachable, so the second mailserver (with the lower priority) is my ISPConfig server. My server should accept mail for my friends domain and try to forward it to his own server as as soon as his server is reachable again. At the moment I configured this by hand in Exim on another server, but it might be userfull if it were possible with ISPConfig. I hope I'm more clear with this example.
  6. falko

    falko Super Moderator ISPConfig Developer

    There is nothing you have to configure, except for the correct MX records.
  7. babbel

    babbel New Member

    So this means that anyone can set it's low priority MX record to my server and my machine will nicely accept and forward the mail. That's pretty unwatend behaviour in my opinion.
  8. MvincM

    MvincM New Member


    Hi. In my opinion if you would like to act like a secondary MX you must add some entry to confs files - if not you will see "realy is not permited".

    So you must add:

    Exim (Debian package):



    Remember to run "update-exim4.conf" after edit and reload exim.

    Postfix (Debian Package):


    relay_domains = $mydestination

    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,check_relay_domains

    and restar postfix.

    Best regards,
  9. TeslaZap

    TeslaZap New Member


    that's correct, but it would be much better to find a way inside the ispconfig control panel instead of hand edit config files

    btw: I have the same problem

    this feature is so useful that there must be an hidden workaround

  10. babbel

    babbel New Member

    If I understand well wat Falko writes, one only needs to set a secondary MX to the ISPconfig server and the server will relay mail for that domain. I did a quick test and it indeed seems to work like that. I'll try it again with a domain that is completely ISPConfig independent and see what happens.

    I do get a relay denied when I want to relay to any non-local domain, but it did accept mail when the ISPconfig server was the sec. MX while the domain was not configured in ISPConfig.
  11. TeslaZap

    TeslaZap New Member

    I get "relay access denied" both if the domain is not configured in ispconfig (which is correct) and if it's configured with the option external mailserver

    furthermore if i set "local mailserver" but in the mx priority list it's the second, it just accept the email locally and doesn't forward to the first. in other words it doesn't check if it's the first or not

    I think there should be in the option list:
    1) local mailserver
    2) secondary mailserver
    3) external mailserver

    it would be easier to understand/configure

    running ispconfig 2.2.7

Share This Page