SpamAssassin Outgoing Scan Causing Slow SMTP?

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Hi we enabled the exim option to scan outgoing mail with spam assassin.
However, I've just become aware this has introduced a delay of about 6-8 seconds when sending email.

This delay does not affect Outlook/Mac mail users as it goes to outbox but in some mail clients or webmail apps it sits saying "sending" for 6-8 seconds.

Is there any way of speeding this up?

Outgoing messages are not scanned as default, is this because it's not really required?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
The only instance in which I would anticipate a delay like this would be if the mail server was extremely busy. In that instance scanning of outbound mail would cause some additional delay. There really aren't any modifications you can make to the outbound scanner to speed this up, short of disabling the scanning, unfortunately.

Thanks!
 

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Thanks for your reply, server load is low as we keep a small amount of accounts per vm.
However, I can confirm turning the option off allows the email to send instantly.

I also discovered, if I remove any urls from the email, such as in the signature, it sends instantly, so it's Spam Assassin slow at scanning urls for spam.
 

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Sorry about the slow reply, I've been away.

That command gives us the 3 DNS servers supplied by our datacentre.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
HI @uk01

Do they allow you to use public resolvers such as googles? I am curious if there is an issue with one of the DNS resolvers they've provided. If they do allow you to use different resolvers can you replace the entries in the resolv.conf with different ones such as Google's? For reference they're:

Code:
8.8.8.8
8.8.4.4
 

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Thanks, I think we can use any so I'll try google or the new cloudfare public dns.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
HI @uk01

Yea the new CloudFlare DNS resolvers are supposed to be faster too though I haven't done a lot of testing personally, definitely worth trying out. Please let me know if the issue persists after changing over.

Thanks!
 

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Early tests but this does seem to have made it faster.
I did have an issue with network services overwriting the dns though - for anyone else reading this you need to remove DNS1, DNS2, etc from /etc/sysconfig/networkscripts/ifcfg-* to stop network manager taking control. Then change the ip's in resolv

Thanks @cPanelLauren for your help
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston

uk01

Well-Known Member
Dec 31, 2009
197
19
68
Thanks, I'll check this on our newest server. I remember disabling it a while back on all the other servers. It must be active for some reason on the latest set up.
 

Kurieuo

Well-Known Member
Dec 13, 2002
106
0
166
Australia
I too just noticed mail sending slow. I'm not sure when it started, but I hadn't noticed how slow it was until recently via form submits that deal with email (this is a new server been running almost 6 months now). It's not just taking 8 seconds though, but like 20-30 seconds via webmail. I'm using Google's resolvers.

/var ran out of disk space on the applicable server, and I'm not sure if that's related, but I think that aligns with about the same time I noticed delays happening i.e., with WHMCS email sending admin tasks.

In any case, I went through Exims settings bit by bit, and not until disabling the SpamAssassin scanning on sent emails did emails send instantly! My next step was to search here on that setting slowing email down, and I came across this thread.

Obviously, be great to have SA scanning outgoing mail though. I'm not sure if running out of space on /var is a red herring, but thought I'd mention it anyway.

Any other ideas on what I might try? Server isn't under any real load, the mail queue is empty, so it really should be quicker.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
Hi @Kurieuo


When SpamAssassin for outgoing mail is enabled do you see anything indicative of an issue in
Code:
/var/log/maillog
or
Code:
/usr/local/cpanel/logs/error_log
Thanks!