Jérôme Blion wrote:
if( /^X-Virus-Status: INFECTED/:h )
{
`echo "INFECTE" > /tmp/maildrop/virus`
exit
}
- I don't want viruses to be delivered ! I want correct mails to be
delivered.
- Is it mandatory to have a "to" instruction at the end of the
maildroprc?
- The biggest problem I see is that my Regexp is matched whereas in
this case, this should not. So, there is something wrong in my regexp...
But I don't see where is the error.
Removing just the "exit" should deliver the message that matched
your "X-Virus-Status". Next you have two choices:
1) Remove just the "exit" instruction so that the message gets
delivered. Check the timestamp of /tmp/maildrop/virus and the
delivered message. The header isn't there? Try capturing it, e.g.,
if( /^(X-Virus-Status: INFECTED.*)/:h )
{
`echo "$MATCH" > /tmp/maildrop/virus`
}
2) Run maildrop in verbose mode, see http://www.courier-mta.org/maildrop.html
you can log in as courier or run, e.g.,
su -c 'cat mymsg | maildrop -V 7 fifi' courier
where fifi is maildrop's recipe, mymsg is the message file, and courier is
the owner of fifi.
Either choice should bring evidence about what matches your regex.