procmail
[Top] [All Lists]

Calling procmail with the -m flag from sendmail: How to access ARGV ??

1997-03-09 22:05:47
Hi-

I am trying to use procmail (v3.10) on linux (redhat 4.1, kernel 2.0.27,
intel) with sendmail (8.8.5).

I want to do something very similar to what is described in the "EXAMPLES"
section of the procmail man page - having sendmail call procmail as a
filter for mail matching a certain rule.

Sendmail is selecting the messages, and sending them to the procmail
delivery agent:

Mprocmail,   P=/usr/bin/procmail, F=DFMmShu, S=11/31, R=21/31,
T=DNS/RFC822/X-Unix,
             A=procmail -m $h $f $u

Procmail is invoked and uses the appropriate rc file (for example,
/etc/procmailrcs/log.rc).  It executes the instructions in the rc file, but
it cannot seem to access ARGV - the command line arguments $@ or $1, $2, $3
....

for example, this rcfile:

:0 c
/var/log/copies_of_special_mail

:0
! -oi -f "$@"

appends the message to the  copies_of_special_mail, and then invokes
sendmail, but it appears that the quoted $@ is replaced with nothing, in
other words it executes:

/usr/sbin/sendmail -oi -f
[[ message piped to STDIN ]]

I have tried using $@ and $1 in other "action lines", and I can't seem to
access them under any circumstances.  Removing the quotes either has no
effect, or causes it to remain un-interpreted (i.e. it passes the literal
dollar-sign and "at" characters).

If I call a shell script from sendmail as the delivery agent, using
identical flags, etc, it CAN access $@ and $1, so I have to conclude that
procmail is receiving these arguments, it is just not making them
accessable to the script.

Does anyone have any ideas on this?  I would be terribly grateful for any
assistance.


PS: I am not very familiar with the program, so I apologize if this is a
stupid question.  I have done my best to search through the manpages, FAQs,
and mailing-list archives, and have not been able to solve my problem.




                            D. William Clausen, ltd
                                       ~
                            47 Jane Internet Studio

Paris   Ithaca    Ljubljana    Palo Alto    Buenos Aires    Tokyo     New York

Digital: Dave(_at_)47jane(_dot_)com                                 
http://www.47jane.com
Analogue: 36 Hicks St., New York, NY 11201                      (718) 797-4458


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