You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Daniel Lemke <le...@jam-software.com> on 2011/02/24 10:06:14 UTC

SpamAssassin protocol examples

I stumbled across the SpamAssassin protocol definition and its examples while
implementing a .net client...
Correct me if misunderstood anything, but aren't they kind of misleading or
just wrong if you have a look at the examples?

First and second one is absolutely fine, but I've already got a question
about the third one:
One would expect SET as the header you have to specify when
learning/reporting ham or spam.
Having a look to the third example there is a ‘remove’ in the SET header
which is kind of confusing to me (expected a ‘remote’ or so to tell
SpamAssassin to report to a ‘remote’ network like Razor).

Even more confusing, the fourth example: ‘Revoke a ham message’.
Why is the message-class spam?
Why is it set local? Wouldn’t this cause SpamAssassin to learn this message
as spam for our ‘local’ bayes?
The REMOVE header is set to ‘remove’, I would expect a ‘remote’ again, so
one would interpret it as ‘Remove message from remote network’.

To learn a message as spam:
TELL SPAMC/1.3\r\n
Message-class: spam\r\n
Set: local\r\n

To forget a learned message:
TELL SPAMC/1.3\r\n
Remove: local\r\n

To report a spam message:
TELL SPAMC/1.3\r\n
Message-class: spam\r\n
Set: local, remove\r\n

To revoke a ham message:
TELL SPAMC/1.3\r\n
Message-class: spam\r\n
Set: local\r\n
Remove: remove\r\n

Is this a documentation issue or did I mixed up anything here?

Daniel

-- 
View this message in context: http://old.nabble.com/SpamAssassin-protocol-examples-tp31001608p31001608.html
Sent from the SpamAssassin - Dev mailing list archive at Nabble.com.


Re: SpamAssassin protocol examples

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Fri, 2011-03-04 at 06:37 -0800, Daniel Lemke wrote:
> The curious thing about this is that Justin did ‘correct’ it from remote to
> remove some time ago, not sure what this was for:
> http://svn-master.apache.org/viewvc?view=revision&revision=528556

Which references bug 5398 [1]. And that's where it gets confusing.

First of all, the bug report appears to mention a different Set: header
than the one that has been corrected in r528556.

Moreover, the report mentions to s/remove/remote/, while the change has
been the exact *reverse*. Though on a different header...


[1] https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5398

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: SpamAssassin protocol examples

Posted by Daniel Lemke <le...@jam-software.com>.

Kevin A. McGrail wrote:
> 
> Sorry, I read your post but didn't have a definitive answer.  I agreed 
> with your logic but haven't looked at the code to see if you are 
> correct.  That code is about a decade old and is in my category of "just 
> works".  Have you tried a debug with the C-based spamd to see what it
> sends?
> 

I've debugged the spamd script and it definitely receives other header
information for the given examples:
When reporting a spam message the SET header contains the value
‘local,remote’ and not ‘local,remove’ like mentioned in the example.
The curious thing about this is that Justin did ‘correct’ it from remote to
remove some time ago, not sure what this was for:
http://svn-master.apache.org/viewvc?view=revision&revision=528556

There are two issues with the revoke example as well:
The message-class is ham instead of spam, so the set: local also makes sense
again as the message will be learned as ham in the same step.
Besides this, the remove header contains the correct value ‘remote’ and not
‘remove’, so same issue as with the report example (copy/paste?)

I’ve opened a bug and set Justin to the cc list.

Daniel

-- 
View this message in context: http://old.nabble.com/SpamAssassin-protocol-examples-tp31001608p31068134.html
Sent from the SpamAssassin - Dev mailing list archive at Nabble.com.


Re: SpamAssassin protocol examples

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
Sorry, I read your post but didn't have a definitive answer.  I agreed 
with your logic but haven't looked at the code to see if you are 
correct.  That code is about a decade old and is in my category of "just 
works".  Have you tried a debug with the C-based spamd to see what it sends?

P.S. I've added you to the wiki.

Regards,
KAM

On 3/2/2011 5:35 AM, Daniel Lemke wrote:
> No comments on this? :(
>
> Some offtopic:
> Could someone give me rights to contribute on the wiki? The username is
> DanielLemke
>
> Daniel
>
>
> Daniel Lemke wrote:
>> I stumbled across the SpamAssassin protocol definition and its examples
>> while implementing a .net client...
>> Correct me if misunderstood anything, but aren't they kind of misleading
>> or just wrong if you have a look at the examples?


Re: SpamAssassin protocol examples

Posted by Daniel Lemke <le...@jam-software.com>.
No comments on this? :(

Some offtopic:
Could someone give me rights to contribute on the wiki? The username is
DanielLemke

Daniel


Daniel Lemke wrote:
> 
> I stumbled across the SpamAssassin protocol definition and its examples
> while implementing a .net client...
> Correct me if misunderstood anything, but aren't they kind of misleading
> or just wrong if you have a look at the examples?
> 
> First and second one is absolutely fine, but I've already got a question
> about the third one:
> One would expect SET as the header you have to specify when
> learning/reporting ham or spam.
> Having a look to the third example there is a ‘remove’ in the SET header
> which is kind of confusing to me (expected a ‘remote’ or so to tell
> SpamAssassin to report to a ‘remote’ network like Razor).
> 
> Even more confusing, the fourth example: ‘Revoke a ham message’.
> Why is the message-class spam?
> Why is it set local? Wouldn’t this cause SpamAssassin to learn this
> message as spam for our ‘local’ bayes?
> The REMOVE header is set to ‘remove’, I would expect a ‘remote’ again, so
> one would interpret it as ‘Remove message from remote network’.
> 
> To learn a message as spam:
> TELL SPAMC/1.3\r\n
> Message-class: spam\r\n
> Set: local\r\n
> 
> To forget a learned message:
> TELL SPAMC/1.3\r\n
> Remove: local\r\n
> 
> To report a spam message:
> TELL SPAMC/1.3\r\n
> Message-class: spam\r\n
> Set: local, remove\r\n
> 
> To revoke a ham message:
> TELL SPAMC/1.3\r\n
> Message-class: spam\r\n
> Set: local\r\n
> Remove: remove\r\n
> 
> Is this a documentation issue or did I mixed up anything here?
> 
> Daniel
> 
> 

-- 
View this message in context: http://old.nabble.com/SpamAssassin-protocol-examples-tp31001608p31048199.html
Sent from the SpamAssassin - Dev mailing list archive at Nabble.com.