Ralph Freshour <rfresh(_at_)mail(_dot_)idt(_dot_)net> writes:
I understand that procmail sender and recipient data are obtained via $1
and $2. Does anyone know how a perl script accesses this envelope data
when the perl script is running as a mail delivery agent (instead of
Surprise surprise, this is not a procmail question, but rather a sendmail
question. The answer totally depends on what the mailer definition looks
like and how it's invoked in the sendmail.cf. If you've merely copied the
procmail mailer definition, changing the P= and A= directives to reflect
the path and name of your perl script, then you should be able to access
the envelope sender and recipient as $ARGV and $ARGV.
Note: when I say "copied the procmail mailer definition", I _mean_ the
_procmail_ mailer, *NOT* any old mailer that invokes procmail. In particular,
even if your local mailer definition uses procmail, don't copy it as a
base for your mailer. You'll ask, "how does mine get invoked?" and the
answer is the same as for the procmail mailer: mailertable, virtusertable,
generictable, or some other hack you've made on your sendmail.cf.
If the above doesn't make sense, buy the bat book (_sendmail_ by Brian
Costales, published by O'Reilly and Associates) and read it.