On Wednesday 9 April 97, at 16 h 18, the keyboard of Philip Guenther
Actually, the envelope sender address should appear in either the
Return-Path: header or the "From " pseudo-header. It's the envelope
_recipient_ address that is not normally availible.
OK, I see. So, following Era Eriksson's advice and Philip Guenther's help
(thanks a lot!), I rewrote the recipe as:
# Warning: the regular expression below *needs* procmail 3.11 or more.
# You can change it to '* $ ^TO$ADDRESS' but it will not be as sharp.
* $ ^TO_$ADDRESS\>
# See sendmail source, src/sysexits.h, for a list of exit codes.
# Warning: sendmail will reply with a message containing the
# of the alias :-( Set EXITCODE to 0 to avoid this (but in that
# messages will continue to arrive).
# Suppress the automatic reply if you use EXITCODE=77
RETURN=`formail -x Return-Path`
# We should test there *is* a Return-Path...
| (formail -rt -I"Precedence: junk" -i"From: postmaster" \
-i"X-Diagnostic: Permission denied" \
-i"X-Reason: Mail coming for a mailing list" ; \
echo "Mail not delivered and rejected."; \
echo "------" ; \
echo "$ADDRESS never subscribes to mailing lists. This
echo " certainly an error or the result of an
echo " subscription. Please cancel it." ) | \