0

Alerts are now down so would like to fix this properly:

delivery temporarily suspended: Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again

I have hunch my problems started when trying to figure out how to get the below working (i.e. you do not edit resolv.conf directly)

cat /etc/resolv.conf
nameserver 192.168.1.1

resolv.conf -> /run/systemd/resolve/resolv.conf
  • What errors are toy getting ? Can you connect to any sites in your browser ? What mail setup re you using ? – Soren A Dec 22 '18 at 12:08
  • Am trying to do send-only using mail/sendmail whatever. Just want to pump alerts somewhere. – mathtick Dec 23 '18 at 9:37
  • Either use a .forward file, and/or setup Thunderbird to read the local mail folder. – heynnema Dec 23 '18 at 18:15
1

It looks like you're using the wrong smtp server. It's not gmail.com. It's probably something like smtp.gmail.com or imap.gmail.com. Check your Thunderbird, or whatever, app settings.

Update #1:

In /etc/postfix/main.cf set:

relayhost = smtp.gmail.com:587
relay_domains = gmail.com

then reload/restart postfix.

And probably some modification of this...

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
#
# TLS
#
smtp_use_tls=yes
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_cert_file = /etc/postfix/newcert.pem
#smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
#
# SASL
#
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = 
  • No Thunderbird. Just trying to get sending mail alerts from scripts working. I do not understand how this is so complicated ... a lot of noise around the issue online apparently. I have a feeling I need to get the relay working. gmail should just provide an API key for this. relay.plus.net – mathtick Dec 23 '18 at 9:22
  • And I see a lot of people putting their full gmail creds in smtp files. This is awful ... no one should be doing this given what google creds have become (a central point of permissioning). – mathtick Dec 23 '18 at 9:24
  • @mathtick see update #1 for some brief relay info. Maybe it'll help. – heynnema Dec 23 '18 at 15:22
0

Try adding these lines above the nameserver line that's already there:

nameserver 8.8.8.8
nameserver 8.8.4.4

This will use Google's name servers - just as a test to see if it resolves your email issue. If it does, then you can either configure networkmanager to use an external DNS like Google's, or you can check the setup of your network's DNS (your router for example).

  • Just tried and no luck so far. At least not coming through to gmail. Still seeing non-delivery notification – mathtick Dec 22 '18 at 12:08
  • Do you see a domain name resolution when you ping domains like gmail.com? – Eric Mintz Dec 22 '18 at 12:11
  • Yeah, ping to gmail is fine. I had an issue with that a while ago and had to much around with resolv.conf for that to work again. – mathtick Dec 22 '18 at 13:38
  • 1
    Probably being overwritten by network-manager. Edit your network connection there and it will stick. – Eric Mintz Dec 22 '18 at 13:42
  • 1
    After you resolve the Google auth issue, it might be useful to undo the resolved.conf changes to see if everything still works. – Eric Mintz Dec 22 '18 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.