0

I successfully sent mail via telnet port 25 from my local machine to my remote server running postfix/dovecot. The email successfully landed in the user's mailbox on the machine.

However, when trying to send a mail to the same user using gmail, there is no trace of the email.

main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2



# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = example.com
mydomain = example.com
mydestination = $myhostname, ip-173-31-0-112.ec2.internal, localhost.ec2.internal, localhost, $mydomain, localhost.$mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
local_recipient_maps = proxy:unix:passwd.byname $alias_maps

the mail server is at mail.theomnihealthgroup.com. The telnet session is here:

Trying 3.95.150.105...
Connected to mail.theomnihealthgroup.com.
Escape character is '^]'.
220 mail.theomnihealthgroup.com ESMTP Postfix (Debian/GNU)
ehlo mail.theomnihealthgroup.com
250-mail.theomnihealthgroup.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
mail from: mygmailaccount@gmail.com
250 2.1.0 Ok
rcpt to: pete4@theomnihealthgroup.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: check it

awesome
.
250 2.0.0 Ok: queued as B03C9802BF
quit
221 2.0.0 Bye
Connection closed by foreign host
  • OK, I have added the requested information to the end of the OP. Thanks. – StevieD Sep 24 '20 at 4:40
2

Your MX record is incorrect.

$ host -t mx theomnihealthgroup.com
theomnihealthgroup.com mail is handled by 1 mail.

But your mail server is at mail.theomnihealthgroup.com.

Edit your DNS MX record to correct this.

  • OK, thanks. I'm using godaddy's dns which I'm not used to. I have an A record for host mail with the name fiel set to "mail" and the a value set to X.XX.XXX.XXX. Then I have an MX record with name "@" and a value set to "mail". Not sure why this wrong. – StevieD Sep 24 '20 at 5:08
  • @StevieD A MX record value "mail" is not a fully qualified domain name. It's interpreted literally, as you can see above. It must be the fully qualified domain name. – Michael Hampton Sep 24 '20 at 5:09
  • OK, thanks. I'll give it a shot. When I do this in a bind zone record, I have this: "@ IN MX 5 mail". I was using that as a reference. – StevieD Sep 24 '20 at 5:11
  • 1
    @StevieD That's valid in a BIND zone, as it will just append the ORIGIN. It's not valid in GoDaddy's crappy web interface. Anyway, I can see the MX record is correct now. – Michael Hampton Sep 24 '20 at 5:15
  • 1
    @StevieD No, you need that! How else will anyone find the IP address of the mail server? – Michael Hampton Sep 24 '20 at 5:19

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.