RE: [exim] piping data to ${run

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Herb Martin
Datum:  
To: exim-users
Betreff: RE: [exim] piping data to ${run
> -----Original Message-----
> From: exim-users-bounces@???
> [mailto:exim-users-bounces@exim.org] On Behalf Of Joerg Sommer
> Sent: Monday, October 03, 2005 1:28 PM
> To: exim-users@???
> Subject: [exim] piping data to ${run
>
> Hi,
>
> currently I pipe every mail through bogofilter and reinject
> it again. But is it possible to pipe the mail to the command
> started with ${run? This would make it much simpler:
>
> if "${run {bogofilter}{}}$runrc" is 0 then
>    spam...
> else
>    ham...
> endif


On my Exim I am running CRM114 to do advanced
Bayesian/Markov/Hyperspace filtering in addition
to SpamAssassin (actually I have a CRM114 plug in
but I am still calling CRM114 from Exim too.)

There is actually a small Perl script that mates
this stuff together so the call (run) below is
actually to "perl epmf" (the script.)

I do the following in an ACL (not a filter per se):

warn blah blah blah
  set acl_m0 = ${run {/usr/bin/perl /etc/crm/epmf \
    /var/spool/exim/scan/${message_id}/${message_id}.eml}\
    {$value} {$value}}
  blah blah


The full ACL is below (but it may line wrap).

After checking this, I call it again if certain
conditions are met (SA say HAM, but CRM says Spam)
to auto-train CRM114 (any mistakes that are SA-Spam
are cycled back from the clients or from the Spam
catch accounts.)

--
Herb Martin

#actual ACL stanza in check Data ACl section:
warn condition = ${if <{$message_size}{MAX_SPAM_SIZE}{1}{0}}
    set acl_m0 = ${run {/usr/bin/perl /etc/crm/epmf \
                   /var/spool/exim/scan/${message_id}/${message_id}.eml}\
                   {$value} {$value}}
    set acl_m1 = ${if match {$acl_m0} {^\\s*-} {SPAM} {HAM}} 
    set acl_m2 = ${if >{$runrc} {0} {SPAM} {HAM}} 
       message = X-CRM114-Status: RCode-$runrc Message scored CRM:
$acl_m0/$acl_m1 
      logwrite = :reject: CRM: rc:$runrc CRM: $acl_m0/$acl_m1 (SA:
$spam_score)