Re: [exim] Run filter from ACL

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: David Ward
Dátum:  
Címzett: Marlon Cabrera Oliveira
CC: exim-users
Tárgy: Re: [exim] Run filter from ACL
Marlon,

I think you might need to separate the block after the malware = *
line since if there is no virus then that returns false and then the
rest of the lines will not be processed in that deny block.


check_message:
  deny    message = This message contains a virus or other harmful content
($malware_name)
  malware = *


### SPLIT HERE

warn logwrite = Classificando mensagens
set acl_m0=${run {/usr/bin/exim_osbf_lua \
$spool_directory/scan/$message_id/$message_id.eml} \
{$value}{}}
#set acl_m0=${run {/bin/cat \
#$spool_directory/scan/$message_id/$message_id.eml \
#OSBF_LUA_DIR/spamfilter.lua --udir=$home/osbf-lua} {$value}{}}
#accept condition = ${if !eq{$acl_m0}{}}
#add_header = X-OSBF-Lua-Score: ${extract {result}{$acl_m0}}
control = no_mbox_unspool

accept



David
--

On 10/30/06, Marlon Cabrera Oliveira <sysadmin@???> wrote:
> Hi Magnus,
>
>
> > You can't really filter mail in ACL's. There are two specialised mechanisms
> > that allow you to pass the whole message to an external program and get
> > some information back, namely the spam and malware conditions, but spam
> > only works with SpamAssassin and malware can only check if a particular
> > malware was found. There are a number of wishes in the Bugzilla database
> > for new string expansion items that would allow the full message to be
> > passed to an external command, and the output from that command to be read
> > back, in a generalised way.
> >
> > Your best bet is perhaps to write a custom local_scan() function.
>
> Did you see David Ward post:
>
> http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20061023/msg00293.html
>
> He is filtering mail on ACL's with dspam.
> I try to reproduce this setup here using osbf-lua, but doesn't work .
> I'm using exim 4.60:
>
> check_message:
>    deny    message = This message contains a virus or other harmful content
> ($malware_name)
>    malware = *
>    logwrite = Classificando mensagens
>    set acl_m0=${run {/usr/bin/exim_osbf_lua \
>    $spool_directory/scan/$message_id/$message_id.eml} \
>    {$value}{}}
>    #set acl_m0=${run {/bin/cat \
>    #$spool_directory/scan/$message_id/$message_id.eml \
>    #OSBF_LUA_DIR/spamfilter.lua --udir=$home/osbf-lua} {$value}{}}
>    #accept condition = ${if !eq{$acl_m0}{}}
>    #add_header = X-OSBF-Lua-Score: ${extract {result}{$acl_m0}}
>    control = no_mbox_unspool
>    accept

>
> scritp to pipe message to osbf-lua:
>
> # cat /usr/bin/exim_osbf_lua
>
> #!/bin/bash
>
> cat $1 | /usr/local/osbf-lua/spamfilter.lua --classify --udir=$home/osbf-lua
>
>
>
> But osbf-lua don't proccess incoming messages.
>
> for while I'm using osbf-lua in local_delivery transport:
>
>
> local_delivery:
>         driver = appendfile
>         check_string = ""
>         create_directory
>         delivery_date_add
>         directory = ${home}/Maildir/
>         directory_mode = 700
>         envelope_to_add
>         return_path_add
>         group = mail
>         maildir_format
>         maildir_tag = ,S=$message_size
>         message_prefix = ""
>         message_suffix = ""
>         mode = 0600
>        quota = ${lookup{$local_part}lsearch*{/etc/mail/quota_usr}{$value}{4M}}
>         quota_size_regex = S=(\d+)$
>         quota_warn_threshold = 75%
>         transport_filter = OSBF_LUA_DIR/spamfilter.lua --udir $home/osbf-lua

>
>
>
> regards,
>
> Marlon
>
>
>
>
> --
> ## 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/
>