[Exim] Spamassin check

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: j.linn
Ημερομηνία:  
Προς: exim-users
Καινούρια Θέματα: Re: [Exim] Spamassassin check
Αντικείμενο: [Exim] Spamassin check
With the EXIM4 exiscan strategy, spamassassin only gives the score and the
hits required. I have a request to set up an alias "spamcheck" which would
do effectively

    cat message | /usr/bin/spamassassin |mail -s SpamCheck sender


(this works when I put myself as sender)

I have tried to do this via a ".forward" file with PIPE but so far have
failed (account below)

Does anyone know how to do this via EXIM?

What I think would like, is the ability to include the current output from
a pipe as the message body in an EXIM filter MAIL command with the ability
to ignore PIPE non-zero return values.

John Linn

=================================================================A

Long account of failure.

What I have done is set up a special

spamcheck:
driver = redirect
condition = ${if eq {$local_part}{spamcheck} {1}{0} }
file = /etc/exim/spamcheck
no_expn
user = mailnull
allow_filter
file_transport = address_file
pipe_transport = address_pipe
reply_transport

(had to remove no_vrfy as spamcheck is not in the system alias file)

where the file spamcheck is

# EXIM filter
# spamchecker
pipe "/usr/bin/spamassassin | /bin/mail -s SpamCheck $sender_address"


and the address pipe is

address_pipe:
driver = pipe
user = mailnull
allow_commands = /usr/bin/spamassassin : /bin/mail



Running EXIM with -bt d+all. part of the log gives

address_pipe:
  driver = pipe
  user = mailnull
  allow_commands = /etc/exim/spam.sh
Filter: pipe message to: /usr/bin/spamassassin | /bin/mail -s SpamCheck $sender_address
---0 Get 135066632    64       string.c  346
---0 Get 135066696   200      deliver.c   97
---0 Get 135066896    64       string.c  346
---0 Get 135066960    64       string.c  346
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.
Filter: end of processing
rda_interpret: subprocess yield=0 error=NULL
---0 Get 135066376    64          rda.c  420
---0 Get 135066440   200      deliver.c   97
---0 Get 135066640    64       string.c  346
set transport address_pipe
spamcheck router generated |/usr/bin/spamassassin | /bin/mail -s SpamCheck $sender_address
  pipe, file, or autoreply
  errors_to=NULL transport=address_pipe
  uid=7951 gid=2000 home=NULL
routed by spamcheck router
  envelope to: spamcheck@???
  transport: <none>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Considering |/usr/bin/spamassassin | /bin/mail -s SpamCheck $sender_address
spamcheck@??? -> |/usr/bin/spamassassin | /bin/mail -s SpamCheck $sender_address
transport = address_pipe


Looks ok so far!

However sending a message to it gives the following log file

2002-09-30 12:34:05 17vyoO-0007Et-00 <= sys044@???
H=aucc.cc.abdn.ac.uk [139.133.216.221] I=[139.133.7.33]:25 P=esmtp S=587
id=Pine.SOL.4.33.0209301233520.2810-100000@??? 2002-09-30

12:34:06 17vyoO-0007Et-00 ** |/usr/bin/spamassassin | /bin/mail -s
SpamCheck $sender_address <spamcheck@???> R=spamcheck
T=address_pipe: Child process of address_pipe transport returned 64 (could
mean usage or syntax error) from command: /usr/bin/spamassassin 2002-09-30

12:34:06 17vyoQ-0007F3-00 <= <> R=17vyoO-0007Et-00 U=mailnull P=local
S=1542 2002-09-30 12:34:06 17vyoO-0007Et-00 Completed