On Fri, Jul 16, 2004 at 8:52:12AM +0200, Dallman Ross wrote:
MYCMD # unset for development
MYCMD = "$SENDMAIL $SENDMAILFLAGS $maintainer" # for production
:0 c
* conditions
| $MYCMD
*Might* work. Not entirely sure.
For the examples below, let's assume a prior definition of
maintainer = jimo(_at_)nowhere(_dot_)com #not my real address :)
First, here's the log from an explicit ``! $maintainer'' delivery:
Executing "/usr/sbin/sendmail,-oi,jimo(_at_)nowhere(_dot_)com"
Assigning "LASTFOLDER=/usr/sbin/sendmail -oi jimo(_at_)nowhere(_dot_)com"
The mail ends up in /var/spool/mqueue, just like it should. So I
know ! invokes sendmail sucessfully. :)
I've tried several variations on Dallman's suggestion, with these results:
------------------------------------------------------
variable definition:
raw-input = "| $SENDMAIL $SENDMAILFLAGS $maintainer"
expansion per LOG:
raw-input: | /usr/sbin/sendmail -oi jimo(_at_)nowhere(_dot_)com
verbose log result:
procmail: Skipped "/usr/sbin/sendmail -oi jimo(_at_)nowhere(_dot_)com"
------------------------------------------------------
variable definition:
raw-input = "$SENDMAIL $SENDMAILFLAGS $maintainer"
expansion per LOG:
raw-input: /usr/sbin/sendmail -oi jimo(_at_)nowhere(_dot_)com
verbose log result:
procmail: Locking "/usr/sbin/sendmail.lock"
procmail: Error while writing to "/usr/sbin/_GOC+VhB-AB.nowhere"
procmail: Lock failure on "/usr/sbin/sendmail.lock"
procmail: Skipped "-oi jimo(_at_)nowhere(_dot_)com"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail"
procmail: Opening "/usr/sbin/sendmail"
procmail: Error while writing to "/usr/sbin/sendmail"
------------------------------------------------------
etc., with slight variations on the quoting, quoting the final
"$raw-input" in the recipe, ad nauseum. There seems to be a
difference to procmail between a "!" as part of a variable versus the
explicit character in the rc file. There's also a difference with
"| cmd" at least with sendmail, but a simple "|" works to deliver to
stdout. Go figure.
I'm stumped. I can't think of any other variations to try. Surely
there's a way to avoid maintaining two entire separate rc files,
short of an installation script that hacks the variables as it installs?
blah blah | sed 's/\$raw-input/! $maintainer/' >destination
Any better ideas, anyone? TIA, as always.
Jim
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail