The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SpamAssassin timeout

Discussion in 'cPanel Developers' started by spiff06, Aug 21, 2006.

  1. spiff06

    spiff06 Well-Known Member

    Joined:
    Jan 17, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    I've adjusted some of the MailScanner parameters to block GIF spam. Works ok (except for false positives on daily Dilberts), but a few appear to go through because SpamAssassin times out: SpamCheck: not spam, SpamAssassin (not cached, timed out).

    I've read (here) that it may have to do with Bayes database corruption.

    I would appreciate if someone would kindly point me in the right direction to solve this.

    Some more info:
    • I have ConfigServer's (excellent) MailScanner package.
    • There's a bunch of bayes_toks expire files in the /var/spool/mqueue/.spamassassin/
      directory. I tried sa-learn --force-expire, didn't report any errors, but didn't get rid of the expire files.
     
    #1 spiff06, Aug 21, 2006
    Last edited: Aug 21, 2006
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Best way to find out where it is timing out is to run a lint test:

    spamassassin --lint -D

    If you're using our front-end, then it's best done in MailWatch > Tools/Links > SpamAssassin Lint (Test)

    This helpfully gives timings for each stage. The most common reason for timeouts is if you have slow DNS resolvers.
     
  3. spiff06

    spiff06 Well-Known Member

    Joined:
    Jan 17, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    Thanks, Jonathan, for your reply.

    I'm listing here the top entries that came up from that run (all others are <0.1, most <0.01):

    dbg: dcc: got response: X-DCC-CollegeOfNewCaledonia-Metrics: server.domain.com 1189; Body=41432 Fuz1=41432 Fuz2=10409429 2.14872
    dbg: diag: perl platform: 5.008001 linux 1.9023
    dbg: rules: ran body rule __NONEMPTY_BODY ======> got hit: "I" 1.23673
    dbg: plugin: Mail::SpamAssassin::Plugin::ReplaceTags=HASH(0x925e7b8) implements 'finish_parsing_end' 1.19388
    dbg: info: leaving helper-app run mode 1.17555
    dbg: rules: ran header rule __SANE_MSGID ======> got hit: "<1156263588@lint_rules> 0.46158
    dbg: config: adding redirector regex: /^http:\/\/chkpt\.zdnet\.com\/chkpt\/\w+\/(.*)$/i 0.28856
    dbg: rules: running header regexp tests; score so far=5.076 0.15876
    dbg: bayes: tie-ing to DB file R/O /var/spool/mqueue/.spamassassin/bayes_toks 0.1128​

    I wonder about the DCC. Anything else worth noticing in here?
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Nothing looks particularly bad there. Do you use a local DNS resolver on the server or an external one? Often external resolvers can be slow and cause lookups to take some time to return and using the local DNS server in /etc/resolv.conf can fix those issues.
     
  5. spiff06

    spiff06 Well-Known Member

    Joined:
    Jan 17, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    I have a local IPs at the top of /etc/resolv.conf, complemented with ServerMatrix IPs underneath to prevent the occasional upcp lockout (discussed here). Would the extra IPs actually cause the timeouts, or should the timeout setting be changed in SA config?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The addition nameservers wouldn't cause any delay. The SA timeout is actually controlled in MailScanner.conf with:

    SpamAssassin Timeout = 75
     
  7. spiff06

    spiff06 Well-Known Member

    Joined:
    Jan 17, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    Mmh, this appears to be a bad idea, on my server at least. When I add the above line to the bottom of MailScanner.conf (there was no timeout setting at all in the config file, by the way), and restart MailScanner, mail stops being delivered. The queue resumes instantly once I comment out the timeout line and restart MailScanner again. Did it a couple of times, the failure is consistent, and caused by the addition of this setting.

    Does any other setting need to be changed (in exim.conf, for example), in order for this to work?
     
Loading...

Share This Page