Server is sending email properly but not receiving email.

Trying to get email working for the email:

Sending emails from there works fine, but receiving emails does not seem to be working at all.

Upon trying to send email returns:

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

According to virtualmin postfix is running, so I am not sure how to debug from here?


My suggestion would be to review the email logs in either /var/log/maillog, or /var/log/mail.log, depending on your distro.

Look for any errors, and also verify that the email connection attempts are hitting your server.


I am on ubuntu 14.04.

Checking the mail log, the only thing I see is imap login: disconnected, no auth attempts in 0secs, TLS: SSL_read() failed error:14094412 SSL routines alert bad certificate, alert number 42.

I do not see anything on the log at the time I attempted to send email.

Not sure why the SSL error, as the cert seems to be working fine for the site itself.

No idea why this is happening, in the past I had a problem with this install process for sending emails but not receiving. Seems like every time I use virtualmin, there is a list of different issues to getting things working properly.


Okay, it doesn’t sound like those SSL errors are related to email delivery though.

If you send yourself an email from a remote server, you should see an incoming connection attempt from that server.

Do you see any attempts from that remote server to connect to your system, and deliver the message?

If not, do you know if your provider may be blocking email traffic? Not all providers allow incoming and/or outgoing email.


I do not see any connection from the server. That would appear in the log file mentioned above correct? Only thing in there is what I mentioned. I just ran a test again right now to be sure. Nothing in the mail.log.

My host provider only blocks emails for the first 2 weeks to make sure you are a legit user. Since they recently moved my server I wondered if this could have possibly been re-enabled. I contacted them and they told me it shouldnt have, but issued the command again to make sure I was not blocked. Still having the same problem.

So now I am wondering if it might be problems with the domain not being set up properly? Looking at the domains zone file, host @ is pointing at the domain, but for the mx entries it lists:

Priority Host Points to

Might this be the issue? Or would these only be used for outgoing mail?

Thanks for your assistance


Ah, it looks like your MX record is pointed to Gmail, rather than your own server.

That would cause any email sent to that domain to go to Gmail.

If that’s not what you want, you would need to change the MX record back to your server, rather than Gmail.


Okay, never had this issue so I want to make sure I enter the right info, so to work properly w/ should I just point them to the domain directly Or in the format of Or the IP of the domain itself?

And do I put the address in all 3 mx entries?

Thanks again


Well, the Gmail MX records aren’t added by Virtualmin, those would have been manually switched after it was installed… if you happen to have another domain with the default MX records still setup, you could use those as an example, as they should be correct.

There isn’t just one correct way to do this, but by default, Virtualmin sets up a “mail.domain.tld” DNS ‘A’ record that points to your server’s IP address.

And then, the DNS MX Record would then point to “mail.domain.tld”.

That combination would cause emails destined for that domain to be sent to your server.


Hmm… A bit confused now. I changed the settings as suggested. Then I tried emailing to again. Now I do not receive an error to the email I sent from, so it seems like it is going through…

But I do not see anything in the mail log after sending the email? The time zone settings are off, but I just sent another email at 3:07 my time, did not receive a delivery notification failure. The last update in mail.log was at 12:52 (as I mentioned time zone is off, but the minutes are at a minimum of 15 minutes off).

Just for testing I now attempted to check email, to see if anything gets posted to the log from my mail client. I am not receiving anything on the log from login attempts either?

So for another test I emailed myself from This went through immediately. This showed up in the log properly.

It seems that the emails are now getting lost somewhere - no failure to delivery notification, but no updates on the server side. And now it seems that the email client is not logging any attempts to check email? What does that imply?

Also I found something that may cause issues in the log for SMTP. This was posted in the log:

Mar 20 13:12:00 zamozuan postfix/trivial-rewrite[12949]: warning: do not list domain in BOTH mydestination and virtual_alias_domains

It says trivial , does that mean I should not worry? Or could this be causing the problems?


For some additional information:

In email client I updated the information again, and it asked me for password when I tried to check email again. I input the password and it checked mail correctly I believe. My email client must have been stuck on an old password or something. That is appearing in mail.log correctly now.

Now for testing I decided to try to email to my IP directly, and it shows up in the log as well with a warning for illegal address syntax. I get a response back to the email I sent from stating delivery status notification.

So it definitely seems the problems are related to the domain name somehow, as the IP is directly open for connections, and checking email seems to be going through.

spyridon just to be sure check if you have this two lines in your DNS: IN A IN MX 5

and be sure you dont have any leftovers from gmail or some other mail service/provider.

Thanks so much for your response.

Okay my client uses a domain provider (who I personally do not like this provider at all) and their format for the zone file is different. It lists the domain zone file with:

An “A (Host)” section of the zone file, and this section contains a table with 3 sections: “Host”, “Points To” and “TTL”.

The only entry on here right now is Host: @, and pointing at the IP for the server.

There is also an “CName (alias)” section with many entries pointing at their own servers.And the MX servers below.

For the mx servers, they are all listed in the column for “Host” as: “@”. And pointing at

The main thing that is causing confusion is the “Host” column… as well as the fact that most of the zone file is in the Alias section and not the A(host) section. For example , alias’s Host column contains entries for: email, ftp, imap, mail, mobile mail, smtp, webmail, and www.

So I am assuming for the first entry (the, I create this in the A(Host) section, with “” in the “Host” column, and the IP in the “Points To” column, correct? Or does this belong in the mail section of Alias?

For the MX server, for Host column I should enter “”, points at, correct?

Finally, do I need to edit the mail or webmail alias section at all? they are pointing to google and the domain providers servers.

Thanks again.

Not sure why your client want to use domain provider for DNS. It would make sense in case the server go down and he want to keep email alive but then email should be hosted elsewhere. For my understanding he wants to use email on his own server so in case the server go down hosting DNS with domain provider is useless and will not help at all.
I would move DNS to your client server, setup everything over Virtualmin and make your life easier (some domain providers have really bad DNS control panel).