Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Spamassassin and pipe

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


paul at myitcv

May 18, 2008, 3:17 AM

Post #1 of 3 (560 views)
Permalink
Spamassassin and pipe

All,

I have searched high and low for some documentation or examples on the
subject of using spamassassin in a filter file via the pipe command
but have turned up nothing (all the documents I have seen refer to the
site-wide install). I am hoping someone can help with my request.

I need to be able to have spamassassin check an email via a local
spamassassin install on my shell account (specifically I want to be
able to utilise the whitelist checking) from within a .forward filter
specification. Having read the documentation I can see that one would
probably pipe the mail to the spamassassin command; however the
default behaviour of spamassassin when run in this way is to output
the results onto STDOUT (which is treated as an error by exim's filter
processor).

So I imagine I need to pipe the results of spamassassin back into exim
for redelivery. How do I achieve this?

Many thanks,


Paul

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


liste at jordet

May 18, 2008, 5:46 AM

Post #2 of 3 (534 views)
Permalink
Re: Spamassassin and pipe [In reply to]

On sø., 2008-05-18 at 11:17 +0100, Paul Jolly wrote:
> All,
>
> I have searched high and low for some documentation or examples on the
> subject of using spamassassin in a filter file via the pipe command
> but have turned up nothing (all the documents I have seen refer to the
> site-wide install). I am hoping someone can help with my request.
>
> I need to be able to have spamassassin check an email via a local
> spamassassin install on my shell account (specifically I want to be
> able to utilise the whitelist checking) from within a .forward filter
> specification. Having read the documentation I can see that one would
> probably pipe the mail to the spamassassin command; however the
> default behaviour of spamassassin when run in this way is to output
> the results onto STDOUT (which is treated as an error by exim's filter
> processor).
>
> So I imagine I need to pipe the results of spamassassin back into exim
> for redelivery. How do I achieve this?

I don't really remember why I did it this way, but this works for me.
I'm using it this way because I first check the mail for spam in an ACL.
If it is SPAM, I want to run it through SA again (yeah, I have to many
CPU-cycles to burn :P) to create the report. Anyway, this is how I do
it:

transport_filter = /bin/sh -c '${if eq{$acl_m2}{spam}{/usr/bin/spamc
-U /var/run/spamd.sock -u $acl_m1}{/bin/cat}}'

-Stian


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


paul at myitcv

May 18, 2008, 11:28 PM

Post #3 of 3 (514 views)
Permalink
Re: Spamassassin and pipe [In reply to]

>> So I imagine I need to pipe the results of spamassassin back into
>> exim
>> for redelivery. How do I achieve this?
>
> I don't really remember why I did it this way, but this works for me.
> I'm using it this way because I first check the mail for spam in an
> ACL.
> If it is SPAM, I want to run it through SA again (yeah, I have to many
> CPU-cycles to burn :P) to create the report. Anyway, this is how I do
> it:
>
> transport_filter = /bin/sh -c '${if eq{$acl_m2}{spam}{/usr/bin/spamc
> -U /var/run/spamd.sock -u $acl_m1}{/bin/cat}}'

Thanks for your reply.

If I have understood your answer correctly it applies to a site-wide
configuration of exim. I, however, am trying to pass the message to
spamassassin from within a .forward filter file and then pass the
results back into exim for redelivery.

Any thoughts?


Paul

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.