Broken Mail Server Config

Discussion in 'Installation/Configuration' started by Gray Consulting, Jun 11, 2020.

  1. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    Greetings all -
    We're on ISPConfig 3, on Ubuntu 16.04, vhost configuration. During some recent config work on the server, we managed to lose some of the email server config (see pic)

    The server & ISPConfig seems otherwise ok, except for related mail config issues (i.e., email clients & roundcube won't connect).

    Suggestions on how we can restore this data?
    of course, happy to produce any config files requested.
    upload_2020-6-10_18-37-33.png
    Thanks so much!


    upload_2020-6-10_18-37-33.png
     
  2. recin

    recin Member

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Please don't try to reconfigure services, it would make things worse in this case. @recin In general, a reconfigure services is good advice though, but not in this case :)

    The problem in this case is that the settings from system > server config are missing, they must be restored from a backup. Do you have a recent database backup of the ispconfig database from where you can restore the content of the 'server' table from? If not, there is probably a backup in /var/backup/ folder that ISPConfig creates before an update.
     
  4. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    Thanks Till! (and Recin too ;) )

    We managed to restore the config from backups, and now are purring along nicely - receiving and sending, the latter via AWS/SES; everybody's happy.

    Except for roundcube - inbound mail shows up fine, and we can compose a new mail, but sending fails, with roundcube reporting SMTP error -1.
    roundcube log reports:
    PHP Warning: stream_socket_client(): unable to connect to ns1.gcjaguar.net:587 (php_network_getaddresses: getaddrinfo failed: No address associated with hostname)
    PHP Error: Failed to connect socket: php_network_getaddresses: getaddrinfo failed: No address associated with hostname​

    We've been through the installer routine (https://ourdomain/roundcube/installer), and see no errors, but fail the test send.

    Any ideas? Happy to provide any detail you need.

    Thanks!!
     
  5. Steini86

    Steini86 Active Member

    Are you sure, the mail server runs at ns1.gcjaguar.net? This domain has no valid A record and can not be reached.
    Code:
    host gcjaguar.net                                                                     
    gcjaguar.net has address 52.41.27.53
    gcjaguar.net mail is handled by 10 mail.umsturz.net.
    So it looks like you want to have mail.umsturz.net instead of ns1.gcjaguar.net in your roundcube config.
     
  6. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    Interesting - ns1.gcjaguar.net is definitely configured as the mail server (postfix, etc), with working (wildcard) cert, and sending/receiving fine for multiple other locally hosted domains. Umsturz is an unused domain of ours, and clearly the DNS is mis-configured. Where are you seeing that last result,
    Code:
    gcjaguar.net mail is handled by 10 mail.umsturz.net.
    ?

    Otherwise not sure why we need an A record, since ns1.gcjaguar.net is only a mail server? (there's no working website other than a default apache page)

    Thanks so much for the input & suggestions
     
  7. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    Belay my last; we found the rogue MX record pointing to umsturz. Fixed.

    Otherwise, if anybody's got any suggestions on fixing Roundcube smtp/send problem, we're all ears ;)

    Thanks to all ~
     
  8. Steini86

    Steini86 Active Member

    You have to make an A/AAAA record for your mail domain, otherwise it does not exist. If you send a mail to [email protected], the sending mail server does a DNS request to gcjaguar.net to find out the mail server (MX). It gets back "ns1.gcjaguar.net", but does not know which IP to connect to. So it does a DNS request to ns1.gcjaguar.net to get the IP of the mail server. It then gets "Does not exist" back.
    Same for sending mails. You want to send a mail via ns1.gcjaguar.net, the computer looks up the ip to connect to and gets an empty string back, so sending fails.
    That is what your error message is telling you: "No address associated with hostname". A hostname is an arbitrary name. Computers need IP addresses to communicate with each other. DNS is just the translation from human readable domain names to computer needed IP addresses.
     
    Gray Consulting likes this.
  9. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    Thanks -
    That all makes perfect sense. We have multiple A records configured for gcjaguar, including "mail.gcjaguar.net" and "*.gcjaguar.net". Given the latter, does that render the A records for the former, or any other subdomains of gcjaguar.net, moot?

    We don't host any email accounts under "gcjaguar.net", everything is based on one of the hosted domains. Given that, we don't need an MX record, do we?

    Again, thanks so much for all the input and guidance!
     
    Steini86 likes this.
  10. Steini86

    Steini86 Active Member

    The wildcard subdomain covers all non-existent subdomains. MX record is only needed for domains which receive mails. Some providers consider a mail spam that is sent from a domain without mx record, though from the RFC it is not required.
     
    Last edited: Jun 18, 2020
  11. Gray Consulting

    Gray Consulting Member HowtoForge Supporter

    It took a bit to sink in, but you were spot on - turned out my assumption that "*.gcjaguar.net" would handle everything was wrong, so once I created an A record specific to "ns1.gcjaguar.net", et, voila - roundcube could then resolve 'ns1.gcjaguar.net' to the correct IP, and is now sending outbound mail successfully.

    Thanks again so much for the help!
     
    Th0m and Steini86 like this.

Share This Page