Re: [exim] Run filter from ACL

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Marlon Cabrera Oliveira
Date:  
À: exim-users
Sujet: Re: [exim] Run filter from ACL
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