[Mimedefang] calling system command

David F. Skoll dfs at roaringpenguin.com
Sat Jan 8 12:20:00 EST 2011


On Sat, 08 Jan 2011 09:14:55 -0800
pete <pete at nevill.uk.net> wrote:

> I would like to call a system command when a specific subject string
> is passed.

> if ($Subject =~ /\run ls\b/i) {
>     system("/bin/ls");
>     }

> This works the first time when I send a mail with "run ls" in the
> subject line but causes mimedefang to crash.

The problem is that your filter *must not* print anything to standard
output.  MIMEDefang uses standard output for communication between the
C milter and the Perl scanners; if you print anything to standard output,
MIMEDefang becomes completely confused.

Make sure you redirect standard output (and probably standard error, too)
for any commands you run from your filter.

Regards,

David.



More information about the MIMEDefang mailing list