I have postfix mail server running at mail.123.com (ip eg, then I have site books.com (ip eg and it's DNS records like this:

  • MX record as mail.123.com
  • A record mail.books.com same IP as books.com - I have this sub domain only due SPF checking, but that's not important for my problem)

Now, if I send mail to info@mail.123.com from outside, the message is delivered.

If I send mail to info@mail.books.com from outside message is NOT delivered.

If I send mail to info@mail.books.com from localhost of mail.123.com, message IS delivered. (via telnet localhost 25)

/var/log/mail.err is empty, /var/log/mail.log does not contain anything about not received mail or so.

Gmail (third email which is sender) does not get any error mail from mail server, like message not delivered.

What could be problem?

Does Postfix need some special settings if the mail server is set as MX record for other domain?

Now i have only the "virtual (host mail) domain" mail.books.com in

virtual_alias_domains and virtual_alias_maps of /etc/postfix/main.cf as said here ubuntu documentation: PostfixBasicSetupHowto

I am unable to track why receiving of mail for my virtual domain doesn't work :(

Btw interesting is, if i didn't have MX record for books.com gmail even didn't complain while sending mail to info@mail.books.com !!! But then i realized i didn't set the MX record so i set it, but still does not work.. and it is like 2-3 hours yet, so i don't assume it is problem of MX record (due slow renew of cache of DNS).

  • If the delivery attemp (e.g. from gmail) reaches your server then postfix will log the reason why it rejected it. If nothing is in logs, then the msg didn't reach the server and you have DNS issue. – Marki555 Jun 18 '15 at 19:36
  • hmmm ok, thank you for reply.. ok i will see next day if it will be better. but anyway, it is strange that gmail does not complain eg in case if i forgot MX record.. that's bit unreliable. now it still doesnt work.. it is strange. – luky Jun 18 '15 at 20:14
  • If MX record does exist, according to RFC it should try A record (for the part after @). – Marki555 Jun 18 '15 at 20:27
  • So is my settings good? info@mail.books.com where mail.books.com is only A for and domain books.com has MX record mail.123.com. Now it bit confused me, how it works. Since it knows the domain of email info@mail.books.com (mail.books.com) but what it does with this domain? It will translate it to IP? Then what it will do with ip? If MX records are related to root domains like books.com not to IP's. I am confused myself now. May be the hour is too late :P. – luky Jun 18 '15 at 20:37
  • 1
    It doesn't matter what is after @ (if it is domain.com, sub.domain.com, a.b.domain.com). To send mail, it queries MX record for the after-@ part. If you want to use @mail.books.com, then you need MX for that and not for books.com. That A record lookup is only a fallback, don't count on it. – Marki555 Jun 18 '15 at 20:43

From what you write it seems that you have an MX record for books.com but you are trying to send emails to info@mail.books.com.

That should be info@books.com or you should have an MX for mail.books.com.


For days I was struggling with this and eventually realized that my ISP (Comcast) blocks ports 25, 465 and 587.

My solution was to use AWS SES and forward the message content over HTTP to a custom port.

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.