procmail
[Top] [All Lists]

Re: Environment from sendmail

1997-12-23 08:22:09
Richard Nelson asked,

| > I'm using procmail as my delivery agent and am trying
| > to pass ${client_addr} to procmail (for RBL lookup).
| > 
| > I've tried several things, but nothing seems to be working...
| > My latest attempt is:
| > 
| > Mlocal, P=/usr/bin/env, F=lsDFMAw5:/|@qSPfhn9, S=10/30, R=20/40,
| >         T=DNS/RFC822/X-Unix,
| >         A=env TCPREMOTEIP="${client_addr}" procmail -Y -p -a $h -d $u

Edward Marshall replied,

| Procmail is probably stripping the environment before doing its magic. Try
| running it with the '-p' flag, and let me know how it works.

It appears Richard already is running it with the -p flag.  The problem is
that as a security measure -d wipes out any attempt to preset the environ-
ment, so it kills botth the command-line variable assignment and the -p
option.

With no sysadmin nor sendmail experience, I don't know what is passed in $h; 
could that information be sacrificed?  Then procmail could be called this way:

  procmail -Y -a "${client_addr}" -d $u

and each recipient's rcfile could use or ignore $client_addr as he or she
wishes.

Stephen once mentioned to me an idea of allowing multiple -a options on
procmail's command line (in cases where -m is out of the question, such as
invocations that involve -d).  Then procmail -a arg1 -a arg2 -a arg3, for
example, would go into its rcfile with $1 set to arg1, $2 set to arg2, and
$3 set to arg3.  Then it would be possible to do something like this:

  procmail -Y -a $h -a "${client_addr}" -d $u

and take care of Richard's situation.

<Prev in Thread] Current Thread [Next in Thread>