Delay when sending emails


When I send emails, it takes more than 10-15s for the email to leave the outbox.

It happens on multiple platforms (iPhone and Mac or Windows - using Outlook/Apple Mail/Thunderbird).

No errors in the mail log.

Can you please advise?

Thank you

What does appear in the log? Is DNS fast and reliable? Check every name server in resolv.conf to be sure it resolves the destination quickly. Mail performance is very DNS dependent, as it a lot of spam-related stuff is running over DNS. Also make sure your DNS servers are fast, and any DKIM/SPF related stuff responds quickly.

In addition to the excellent suggestions made by @Joe, you could also check if you have virus and spam scanning configured to check outgoing email. If so, this could account for the delay.

Hi, Joe,

Everything looks normal in mail logs, no errors, nothing. Should I look for something specific?

DNS servers are the ones from Google. Please let me know if the resolution order should be Local Hostname first.

[root@cpanel ~]# cat /etc/resolv.conf

Generated by NetworkManager


All domains are hosted in Cloudflare and the required records point to the server’s IPs.

Pinging [x.x.x.x] with 32 bytes of data:
Reply from x.x.x.x: bytes=32 time=133ms TTL=44

Ping statistics for x.x.x.x:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 132ms, Maximum = 134ms, Average = 133ms

Hi, Calport,

Please let me know where I should look for those settings.

Thank you


Can you please let me know how is the best way to disable scanning the outgoing emails?

Thank you

Scanning outgoing mail does not happen by default. I’m not even sure how one would implement that (it’s possible, but nothing we provide makes it easy…you didn’t accidentally turn it on, I’m pretty sure).

Hi, Joe,

I didn’t implement this option as I don’t even know how to do it :slight_smile:

Can you please let me know where are these settings and how to turn this option off?

Thank you

@cipandales as joe said:

  • its disabled or off normally.


Please let me know where I can find that setting to disable/enable scanning the outgoing emails.

I could not find it by looking over the Postfix server settings (or any other settings but I am quite sure that I am not looking in the right place :slight_smile: ).

Thank you

There is no setting! It’s not a thing. I don’t know how to be more clear. Virtualmin does not have any implementation of scanning outgoing email.

It can’t be your problem, because it doesn’t exist (unless you set it up yourself outside of Virtualmin, but since you have no idea what it is or how it’s done, we can be confident you didn’t do that). So, stop fixating on this; scanning outgoing mail is not your problem. It cannot be.

1 Like

@Joe is correct. I am sorry to have caused this confusion when I was attempting to point out that your outgoing email @cipandales could be delayed due to virus and spam scanning configurations (that you may have set up, as I have in deviation to default Virtualmin) to check outgoing email.

On my system it causes exactly the sort of delay you described so in my rush to point this out, I appear to have harmed more than helped. Sorry again, please disregard my earlier comment.

1 Like

This could be because your hostname isn’t set correctly, as I had a similar issue with delays in outgoing email following a server migration.

In /etc/hosts my hostname value had been truncated…check that the full hostname is present as this is what Postfix uses.

So you should have something like: localhost mail,

That comma is funny. Shouldn’t be there. Just use whitespace between long and short names. And, it should be flipped.

e.g. myhost.domain.tld myhost

When you run hostname -f it should return a fully qualified domain name. If it doesn’t, /etc/hosts is wrong and should be fixed, as it will cause mail problems among other things.

1 Like

Thanks for the correction. I hand typed it from memory and messed it up.

Hopefully a pointer in the right direction.


Thank you all for your advice.

You were right, the hosts file does not look like you said:

[root@panel ~]# cat /etc/hosts localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

When I run hostname or hostname -f I get the correct FQDN though.

Should I make the recommended changes in this case?

Thank you

As long as hostname -f is right, it should be fine. hosts is just one way for a name to be resolved (the most reliable, though).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.