"Edward Wildgoose" <Edward(_dot_)Wildgoose(_at_)FRMHedge(_dot_)com> writes:
I am trying to get hold of the $EXTENSION variable set by postfix (which
contains the bit after the "+" when using
addressing format. I guess that I could just regexp with a match to get
the other bit, but I am keen to persevere!
No, you're right to want to use EXTENSION. You would not get the same
results in you tried to extract it from the message header, as EXTENSION
comes from the envelope, as passed via the SMTP "RCPT To:" command.
Anyway I tried calling Procmail (v3.22) from Postfix (as LDA) with
/usr/bin/procmail -a "$EXTENSION" -p
The '-a "$EXTENSION"' makes the value of the EXTENSION variable availible
as "$1" in the rcfile. The -p was not necessary and had undesireable
side-effects, as you found.
However, I find that the "-p" option stops the /etc/procmailrc file from
being read automatically. (See below for an answer on the Postfix
Has anyone here got any insight, and suggested method of working around
this, eg man appears to suggest that:
Procmail [options] EXTENSION=$EXTENSION
May be valid syntax and cause just that environment variable to be
setup. Is this the best way to go about it?
'Best' can mean a lot of different things. Putting EXTENSION="$EXTENSION"
on the command line works. So does -a "$EXTENSION" with EXTENSION=$1
in the rcfile. Your call.
procmail mailing list