[Exim] Running a pipe per user

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Stian Grytoyr
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Running a pipe per user
We currently have the following router in place, to deal
with spam. MailScanner has already run SpamAssassin and
added the neccessary headers, before we get to this:

  spam:
    driver = accept
    check_local_user
    require_files = ${local_part}:+!${home}/.optout-spam
    condition = ${if eq {${substr_0_5:$header_X-NR-MailScanner-SpamScore:}}{sssss}{Yes}{No}}
    transport = spam_delivery


However, I'm not too pleased with SA's accuracy, and I would
like to use SpamProbe instead. But I can't figure out how to
run it centrally in such a way that the score can be added as
a header.

If you pipe an email to it, the following command would
return a spam score on stdout, which would be specific to
the $local_part in question:

spamprobe -c -d /tmp/spamscores/$local_part receive

So I need to find a way to get this spam score added as a
header, before the spam router above is checked, or maybe
as an "action" in the same router, before the condition is
checked. Ideally, we should run the command only if the
opt-out file is not present, like in the above router.

Is that possible? I've looked at system filters, per-address
filtering, pipes, but as far as I can tell they all have
some snag which prevents me from using them. I.e. pipes
can't modify the message or return what is printed on stdout,
system filters can't be run on a per-local_part basis or
check for the existence of the opt-out file.

Hope this made sense. Thanks for any help.

--
Regards,
Stian Grytoyr