Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SpamAssassin Outgoing Scan Causing Slow SMTP?

Discussion in 'E-mail Discussion' started by uk01, Jul 13, 2018.

  1. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    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?
     
  2. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    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.
     
  4. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @uk01

    That's interesting, are you running bind? If so what is the output of the following:

    Code:
    cat /etc/resolv.conf
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    68
    Sorry about the slow reply, I've been away.

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

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    68
    Thanks, I think we can use any so I'll try google or the new cloudfare public dns.
     
  8. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    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
     
  10. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. uk01

    uk01 Well-Known Member

    Joined:
    Dec 31, 2009
    Messages:
    138
    Likes Received:
    11
    Trophy Points:
    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.
     
  12. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @uk01


    Either way, I'm happy to hear that modifying the resolvers has made this function as intended!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Kurieuo

    Kurieuo Well-Known Member

    Joined:
    Dec 13, 2002
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    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.
     
  14. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,721
    Likes Received:
    186
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice