wohler at newt.com
Thu Dec 22 11:42:57 EST 2005
David Relson <relson at osagesoftware.com> writes:
> On Thu, 22 Dec 2005 05:54:09 -0500
> Tom Allison wrote:
>> I went back to my docs and was reading an example to impliment with postfix.
>> I'm just curious what this:
>> exec <msg.$$ || exit $EX_TEMPFAIL
>> does. 'exec' ???
> Hi Tom,
> Honestly, I don't know. It happens that the postfix docs are descended
> from the qmail docs. My guess is that there was an editing error and
> the 4 line stanza (beginning with that line) should be deleted (which
> I've done).
> Perhaps one of our postfix experts will chip in to say it really
I don't have the context, but I do have a mailman filter script that
has a similar construct. It isn't postfix-specific. Thanks to
someone's well-placed comment, I can explain.
bogofilter -c $FILTER_CONFIG -e -p > msg.$$ || exit $EX_TEMPFAIL
if `grep -q 'X-Bogosity: Ham' msg.$$`; then
exec < msg.$$
rm -f msg.$$ # safe, we hold the file descriptor
exec $MAILMAN "$@"
cat msg.$$ >> spam || exit $EX_TEMPFAIL
rm -f msg.$$ || exit $EX_TEMPFAIL
The first line, with the bogofilter command, is using the original
message from stdin. It creates a new message in msg.$$ that has the
bogofilter header field. The "exec < msg.$$" line puts that new
message on stdin so that we can delete the temporary file while still
passing it on mailman's stdin.
Bill Wohler <wohler at newt.com> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.
More information about the Bogofilter