internetcreations
asked on
Passing variables to procmail from Qmail
I am calling procmail from a .qmail-default file with the following command:
|/var/qmail/bin/preline /usr/local/bin/procmail -f /usr/home/username/.procma ilrc
I am testing several scripts that were from a different server that I do not have access to. The .procmailrc file references a variable passed to it ($1), but qmail isn't passing it anything.
I would like to have qmail pass along the local-part of the email address to Procmail so that I do not have to rework the script. I suspect this is something that is fairly simple, but I do not know how to do.
|/var/qmail/bin/preline /usr/local/bin/procmail -f /usr/home/username/.procma
I am testing several scripts that were from a different server that I do not have access to. The .procmailrc file references a variable passed to it ($1), but qmail isn't passing it anything.
I would like to have qmail pass along the local-part of the email address to Procmail so that I do not have to rework the script. I suspect this is something that is fairly simple, but I do not know how to do.
ASKER
I want to have the this_is_the_first_argument be the local part of the email address to which the message was sent. Are you aware of any way to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i.e. |/var/qmail/bin/preline /usr/local/bin/procmail -f /usr/home/username/.procma
$1 in the processing of .procmailrc will have this_is_the_first_argument
Usually you want to maintain a system wide procmailrc in /etc/ which requires that procmail be set with the SUID bit.
You also have to make sure to drop privileges prior to trying the local delivery/finale delivery to the mailbox.
Work your way back what tests use the $1 parameter?
Post the .procmailrc as it may make things clearer.