You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/06/22 01:17:31 UTC

[Bug 3527] New: spamc/spamd with SSL does not work in 3.0pre1

http://bugzilla.spamassassin.org/show_bug.cgi?id=3527

           Summary: spamc/spamd with SSL does not work in 3.0pre1
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: NetBSD
            Status: NEW
          Severity: major
          Priority: P2
         Component: spamc/spamd
        AssignedTo: spamassassin-dev@incubator.apache.org
        ReportedBy: klaus.heinz@onlinehome.de


Hi,

spamd cannot be used with SSL in 3.0pre1. After spamc connects, spamd hangs after the following output (with -D):

  logmsg: connection from localhost [127.0.0.1] at port 65063
  logmsg: info: setuid to kh succeeded
  debug: user has changed
  debug: using "/home/kh/.spamassassin" for user state dir
  debug: bayes: 17743 tie-ing to DB file R/O /home/kh/.spamassassin/bayes_toks
  debug: bayes: 17743 tie-ing to DB file R/O /home/kh/.spamassassin/bayes_seen
  debug: bayes: found bayes db version 2
  debug: bayes: bayes db version 2 is not able to be used, aborting!
  debug: Score set 0 chosen.

After interrupting spamc with ^C, spamd shows the rest of the debug output (so the message gets checked) but also logs an error message:

  logmsg: server hit by SIGCHLD, pid 17743

As far as I can see, the reason for this behaviour is the following difference between
versions 2.63 and 3.0pre1 of spamd.raw:

v2.63, line 723:
  last if (defined($expected_length) && ($actual_length == $expected_length));

v3.0pre1, line 1045:
  last if $actual_length > ${$final_length};

In 3.0pre1, after all characters are read, a last call to IO::Socket::SSL::getline()
is made which blocks until spamc is interrupted. In 2.63 this last call does not
happen because of the comparison for equality. If SSL is not used everything works
because IO::Handle::getline() does not block but returns EOF immediately.
I do not know whether this points at a bug in IO::Socket::SSL; the description of the
spamc/spamd protocol says, spamd should read until EOF. This happens with
IO::Socket::SSL 0.95 and the latest 0.96.

The fix is simple, replace ">" with ">=" in line 1045 of spamd.raw:

  last if $actual_length >= ${$final_length};


ciao
     Klaus Heinz



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.