How to detect "How procmail was called?"

Bart Schaefer barton.schaefer at
Fri Jan 16 17:12:09 CET 2009

On Thu, Jan 15, 2009 at 12:03 PM, Michelle Konzack
<linux4michelle at> wrote:
> Hello,
> Is there an easy way to detect inside the procmailrc,  whether  procmail
> was called from fetchmail or called by ~/.courier which is only a pipe?

I'd have to say no, there isn't.

Your best bet is probably to have the caller put something to identify
itself into an environment variable, and then test the value of that

If you have to, you can do this by building a wrapper script around procmail:

export PROCMAIL_CALLER=fetchmail
exec procmail "$@"

Then in fetchmailrc you invoke the wrapper instead of procmail.  Use a
different wrapper for courier, etc.

More information about the procmail mailing list