Sean Straw pointed Nils Vogels on the way to integrating a database with
procmail, and this question came up:
| [...]
|
| >I was thinking it wouldnt, but executing a seperate program is fine as
| >well .. is there a way to catch STDERR as well, coming from the binary
|
| I've never tried, but you might use shell arguments for redirection of stderr.
|
| If you have an error condition, you could return a plain error string on
| STDOUT, then check for that in the string into which you sent the results:
|
| :0
| * $FILTER_OPTIONS ?? ^ERROR
|
| or somesuch.
|
| >btw, and still being able to tell the difference between STDOUT and
| >STDERR ?
|
| no.
|
Not quibbling, but maybe clarifying. Anything to stderr will be written
to procmail's logfile. (I remember era pointing that out to me many
years ago.) I use "warn" in perl scripts invoked by procmail to take
advantage of that, and redirect stdout to stderr (i.e. 1>&2) in at least
a couple of conditions with grep commands to do the same. That's
probably not exactly what Nils is looking for, but judicious assignments
to LOGFILE can at least provide facility for checking error messages,
even if a slight kludge.
LOGFILE = procmaillog
:0
* condition
action
:0
* condition
action
LOGFILE = procmaillog.special
# database recipe
:0
* condition
| db.script
LOGFILE = procmaillog
If simply writing the errors to logile isn't sufficient, and Nils
controls the script and can alter the format of error messages, he can
even write them from the script in a format like:
ERRMSG="err message"
then INCLUDERC=procmaillog.special to have access to the error
condition in variable $ERRMSG from within procmail.
--
Reply to list please, or append "6" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail