1

When I send mails using sendmail or mutt, /var/log/mail.log shows that emails get delivered to smtp.gmail.com. I can actually see the email appearing in my Gmail outbox. However, I receive an error message from my gmail inbox, as follows: DNS Error: 4117387 DNS type 'mx' lookup of wallet-n550jv.localdomain responded with code NXDOMAIN Domain name not found: wallet-n550jv.localdomain I am only using gmail as a relay to send email with my gmail account, do I still need to set up DNS record for that? Here is my postconf -n output:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination =
myhostname = wallet-N550JV.localdomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $myhostname
notify_classes = policy
readme_directory = no
recipient_delimiter = +
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual
0

In /etc/postfix/main.cf set:

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

then reload/restart postfix.

  • I made the change, but didn't seem to make a difference, I still get an email saying the same thing. (I included brackets around smtp.gmail.com. If I do relayhost = smtp.gmail.com:587 without bracket, I get a bounced status in the log file.) – 邓皓天 Dec 22 '18 at 21:23
  • Did you set relay_domains? Did you reload/restart Postfix? – heynnema Dec 23 '18 at 0:53
  • Yes, I'm pretty sure I did: relay_domains = gmail.com relayhost = [smtp.gmail.com]:587 – 邓皓天 Dec 23 '18 at 18:03
  • Did you issue a reload for postfix to reread its config files? Or reboot? – heynnema Dec 23 '18 at 18:11
  • Yes, I did a reload and restarted the service. – 邓皓天 Dec 23 '18 at 23:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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