Spamassassin reports
Fraser Hugh
hugh_fraser at DOFASCO.CA
Fri May 17 20:40:26 IST 2002
I didn't change the logic flow at all. I simply passed back additional
information from the child to the parent through the pipe. The return status
is still the number of hits as it is in the code now, and the existing logic
uses that to determine if the message was classified as spam or not. The
parent was modified slightly to use do a read from the pipe after the wait
statement to get the additional info the child wrote to the pipe, and the
line where you create the header record includes the additional information
returned.
This is defintely a minimalist approach, but using the pipe provides me with
the ability to return any info I want from the child, including the full
report SpamAssassin produces.
I'll post the CVS changes.
> -----Original Message-----
> From: Julian Field [mailto:jkf at ECS.SOTON.AC.UK]
> Sent: Friday, May 17, 2002 3:33 PM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: Spamassassin reports
>
>
> What do you do if the score < required_hits?
>
> At 20:06 17/05/2002, you wrote:
> >The changes to add some additional info to the
> X-MailScanner-SpamCheck
> >header are quite simple, if changes the header rather than
> the message
> >itself suffices. I used a pipe created just before the
> fork() statement in
> >sendmail.pl to provide a connection to the child process,
> wrote back some
> >additional information to the parent (in my case, I wanted
> to know the
> >number of hits, the required number to be considered spam,
> and the list of
> >tests triggered by the mail) using the
> Mail::SpamAssassin::PerMsgStatus
> >object, in the same way the child currently gets the
> get_hits number. The
> >only twist is that the get_hits value is returned as the
> exit status of the
> >child process to the parent, and it's limited to a numeric
> value. Hence the
> >use of the pipe to pass arbitrary content back.
>
> --
> Julian Field Teaching Systems Manager
> jkf at ecs.soton.ac.uk Dept. of Electronics & Computer Science
> Tel. 023 8059 2817 University of Southampton
> Southampton SO17 1BJ
>
More information about the MailScanner
mailing list