Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DSPAM development
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
geekkoo
n00b
n00b


Joined: 09 Sep 2008
Posts: 3

PostPosted: Tue Sep 09, 2008 5:52 am    Post subject: DSPAM development Reply with quote

Hi, Gentoo users and developers!

I am interested in development of DSPAM spam-filter but its home page looks like dead. From CHANGELOG I have learned that Sensory Networks (which now owns DSPAM) accepted last patches from Gentoo-community (I am Slackophil myself). How can I reach developers? I found a bug introduced in 3.8.0 release (which under some conditions prevents retraining of the filter on errors) and want to discuss it with people with more deep knowledge of DSPAM internals.

Thank you!
Back to top
View user's profile Send private message
geekkoo
n00b
n00b


Joined: 09 Sep 2008
Posts: 3

PostPosted: Tue Sep 09, 2008 7:08 am    Post subject: Reply with quote

In particular this concerns src/dspam.c and process_message function. When it puts back signature to the mail it use '\r\n' terminator if smtp or lmtp transport is used for message delivery to mailbox.

Code:
copyback = _ds_assemble_message (CTX->message, (USE_LMTP || USE_SMTP) ? "\r\n" : "\n");


If user wants to retrain this message (one considers DSPAM result as error) the filter has to find the message data in database but in Unices it can not do it because of wrong line-terminator (\n instead of \r\n) so '\r' got collated to the signature so it can not be found in database. Hence infamous '-5 error. Signature not found'.

The solution is either to roll back to 3.6.8 release (there was always '\n' terminator, I do not understand why this complications with conditionals were made) or trimming of SQL-query in storage-dependent _ds_get_signature function. I can not succeed in trimming of signature in C code.
Back to top
View user's profile Send private message
geekkoo
n00b
n00b


Joined: 09 Sep 2008
Posts: 3

PostPosted: Tue Sep 09, 2008 10:57 am    Post subject: Reply with quote

I found right solution.

The problem arizes then
Code:
Preference "signatureLocation=headers"
is selected. When the signature was embedded in the message body (
Code:
Preference "signatureLocation=message"
) it is stripped of non-printable characters during message parsing so this error does not manifest itself.

"\r\n" are required by RFC 821 - line terminator in messages should always be <CRLF> so _ds_assemble_message behaves nice.

But then file src/decode.c and function _ds_actualize_message (primary parser) have to be patched. First we should try two-symbol line terminator <CRLF> and then <CR> . The patch is simple -
Code:

96,97c96,97
<
<   line = strsep (&in, "\n");
---
>   line = strsep (&in, "\r\n");
>   if (!line) line = strsep (&in, "\n");
260,261c260,261
<
<     line = strsep (&in, "\n");
---
>     line = strsep (&in, "\r\n");
>     if (!line) line = strsep (&in, "\n");


If someone know how to reach DSPAM developers wouldn't you send them this patch?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum