Re: [exim] Per-User SpamAssassin config

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Jonathan Gonzalez
Dátum:  
Címzett: Richard Hobbs
CC: exim-users, Nigel Wade
Tárgy: Re: [exim] Per-User SpamAssassin config
Hi guys,

taking a look at your code i think that i have something wrong in
mine. Let's see:

I'm usin Debian Sarge + Exim 4.50 + SpamAssassin 3.0.3-2 (spamc
3.0.3-2) + Amavis-new 20030616p10-5 + ClamAV 0.86.1-0volatile.

The flow should be:

SMTP -> External Exim -> Amavis (for AntiVirus and AntiSpam) ->
Internal Exim -> Mailbox

I have been doing some test because i realized that exim and
spamassassin seems not to be working fine through amavis (or at least
seems they are not interacting).

I have tested run spamassassing checks from exim directly and
antivirus checks from amavis.

I have this Router and this Trasnport defined:

####### ROUTERS #######

dnslookup_internal:
[...]
pass_router = amavis
no_more

check_localuser:
[...]
pass_router = amavis

amavis:
  driver = manualroute
  condition = "${if or { \
           {eq{$received_protocol}{scanned-ok}} \ 
               {eq{$received_protocol}{spam-scanned}} \
           {eq{$interface_port}{10025}} \
               {eq{$sender_host_address}{127.0.0.1}} \
               }{0}{1}}" 
  route_list = "* localhost byname"
  transport = amavis
  self = send



####### TRANSPORTS #######

amavis:
driver = smtp
port = 10024
allow_localhost


At the moment the inspection seems to work but taking a look at your
code seems that i'm asking in my routers someting that will never
happen and my transport could be incomplete.

Some feedback from you will give me some breath :(

TIA,

jonathan




On 7/21/05, Richard Hobbs <richard.hobbs@???> wrote:
> Hello,
>
> > -----Original Message-----
> > From: exim-users-bounces@???
> > [mailto:exim-users-bounces@exim.org] On Behalf Of Nigel Wade
> > Sent: 20 July 2005 17:25
> > To: exim-users@???
> > Subject: Re: [exim] Per-User SpamAssassin config
> >
> > Richard Hobbs wrote:
> > > Hello,
> > >
> > > I have found our latest problem - we have a mail loop!
> > Here's the command
> > > used to send the mail back to exim once it's been checked (I think):
> > >
> > > /usr/sbin/exim4 -oMr spam-scanned -bS
> > >
> > > And here are the router and transport in full, which I am using:
> > >
> > > THE ROUTER:
> > > # spamassassin stuff
> > > sa_router:
> > >    no_verify
> > >    check_local_user
> > >    # When to scan a message :
> > >    # - it isn't already flagged as spam from Spamassassin
> > >    # - it isn't already scanned
> > >    # - it isn't local
> > >    # - it isn't from one internal domain user to another
> > >    condition = "${if and { \
> > >                          {!def:h_X-Spam-Flag:} \
> > >                          {!eq {$received_protocol}{spam-scanned}} \
> > >                          {!eq {$received_protocol}{local}} \
> > >                          {!eq {$sender_address_domain}{$domain}} \
> > >                          } \
> > >                          {1}{0}}"
> > >    driver    = accept
> > >    transport = sa_spamcheck
> > >    local_parts = /etc/spamassassinUsers
> > > # end of spamassassin stuff

> > >
> > > THE TRANSPORT:
> > > # spamassassin stuff
> > > sa_spamcheck:
> > >    driver = pipe
> > >    command = /usr/sbin/exim4 -oMr spam-scanned -bS
> > >    use_bsmtp = true
> > >    transport_filter = /usr/bin/spamc
> > >    home_directory = "/tmp"
> > >    current_directory = "/tmp"
> > >    user = spamcheck
> > >    group = spamcheck
> > >    log_output = true
> > >    return_fail_output = true
> > >    return_path_add = false
> > >    message_prefix =
> > >    message_suffix =
> > > # end of spamassassin stuff

> > >
> > > Also, we are using exim-daemon-light as our MTA.
> > >
> > > Any ideas??
> > >
> > > Thanks in advance,
> > > Richard.
> > >
> >
> > Is "spamcheck" a trusted user? If not it won't be able to set
> > the protocol
> > on the exim command.
>
> Trusted in what sense, exactly? The user is a system user with a home
> directory, but a user with no shell (in /etc/passwd) and no password (in
> /etc/shadow).
>
> > Also, I would not skip checking if the X-Spam-Flag header is
> > present. That
> > means all the spammer has to do is insert this header and
> > your spam checking
> > will be bypassed completely.
>
> Good point, I have revised the condition in the router, so it is now:
>
> #   condition = "${if and { \
> #                         {!eq {$received_protocol}{spam-scanned}} \
> #                         {!eq {$received_protocol}{local}} \
> #                         {!eq {$sender_address_domain}{$domain}} \
> #                         } \
> #                         {1}{0}}"

>
> Thinking about it... Is the condition above valid? Will it actually
> successfully detect mail passed back into exim using the following command:
>
> /usr/sbin/exim4 -oMr spam-scanned -bS
>
> Thanks,
> Richard.
>
> --
> Richard Hobbs (Systems Administrator)
> Toshiba Research Europe Ltd. - Speech Technology Group
> Web: http://www.toshiba-europe.com/research/
> Email: richard.hobbs@???
> Tel: +44 1223 376964        Mobile: +44 7811 803377

>
>
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>