procmail
[Top] [All Lists]

Re: Calling external program and passing information

1999-10-12 07:05:40
Vivek Mittal wrote,

| I'm having trouble callnig an external program and passing it part of the
| subject.  Below is the recipe that I am using:
| 
| :0
| * ^Subject: +hg +\/[^ ].*
| | /home/vivek/pbm/bin/app $MATCH

OK ...

| Nothing happens, the program is not run.  Below is the log file

It appears that the program *is* run, or at least procmail tries to run it.

| procmail: [18499] Tue Oct 12 16:17:07 1999
| procmail: Assigning "MATCH="
| procmail: Matched "show 101"
| procmail: Match on "^Subject: +hg +\/[^ ].*"
| procmail: Assigning "LASTFOLDER=/home/vivek/pbm/bin/hypergammon show 101"

How did "app" change to "hypergammon"?  Were you using "app" above just to
illustrate, while the real recipe names hypergammon?

| >From vivek(_at_)yoyo(_dot_)cc(_dot_)monash(_dot_)edu(_dot_)au  Tue Oct 12 
16:17:05 1999
|  Subject: hg show 101
|   Folder: /home/vivek/pbm/bin/hypergammon show 101                    540
| procmail: Notified comsat: "vivek@:/home/vivek/pbm/bin/hypergammon show 101"
| procmail: Executing "/home/vivek/pbm/bin/hypergammon,show,101"

Hmm.  I think you may need to use "$MATCH" in weak quotes instead of having
no quotes.  When $MATCH contains more than one word, do you want the entirety
passed to hypergammon as one argument or do you want each word passed as a
separate parameter?

And what followed in the logfile?  If procmail couldn't run hypergammon or
if hypergammon had a bad exit status, a verbose lockfile would have said so.
How did you conclude that the program wasn't run?

| Why are there commas between the parameters of the last line of the log?

That is how procmail logs that it called a program directly (because the
action line had no characters from $SHELLMETAS) instead of invoking a shell
to do it.