Matt Kettler wrote:
Kenneth Kim wrote:
I've found that SpamAssassin will not return a score until I close
socket writing. Once i've closed the writing, in order to get a score
for the next message, I have to reopen the connection in php to send
another message to SA. I hope I'm wrong about this, but currently I'm
bottle necking at because I have to reopen the connection. Is there
anyway for me to get a score w/o having to close socket writing?
Possibly a command I can send at the end/after each message?

You should switch to using spamd directly if you want to do this with sockets.

You can find the protocol that spamd speaks on it's TCP socket in the PROTOCOL
docs that come with SA.
http://spamassassin.apache.org/full/3.1.x/dist/spamd/PROTOCOL

The "spamassassin" command line script is particularly inefficent for this kind
of thing, and can handle only one message per call. Spamc has the same
one-message-per-call limit.



My understanding is that he is talking about spamd, which doesn't allow socket reuse. The protocol doc says:
        After each side is done writing, it shuts down its side of the  
        connection.

I don't know if there are hard design issues, but the socket could be used, that would be good.

Another thing is that I can't find a way to get the SA headers (as they would be added by spamassassin) without having the full message sent back (SYMBOLS doesn't return the score of each test). or am I missing something?

Reply via email to