In qmail, you could put this in a .forward file:
|/usr/local/bin/myfilter | forward [email protected]
This would pipe the whole message, incl. headers, to the myfilter
program, then forward the message printed to its standard output to [email protected].
However, Exim doesn't have a forward
program, and generally ignores the output of pipe transports.
How can one do this with Exim .forward files?
Pipe the program output through
sendmail
. Exim installs its own implementation of the program.Notes:
sh
- Exim will execute the indicated program directly, rather than through a shell like qmail. A shell is needed to parse the|
operator.sendmail
, as/usr/sbin/
likely won't be in thePATH
of the user that Exim will be running under while processing the.forward
file.-t
sendmail flag.