procmail
[Top] [All Lists]

Re: Environment variables in conditions.

2004-08-25 07:22:08
On Wed, 25 Aug 2004, David W. Tamkin wrote:

Chris Johnson wrote:

     I've looked everywhere I can find for this one.  No definitive
answer yet.  I know there are certain macros like TO_, TO,
FROM_MAILER, etc. that can go in conditions.

Interruption: none of those are valid macros; the valid macros that look 
like them all have an initial caret.  Back to your question ...

     Is it possible at all to put an environment variable in a
condition's regular expression?

Yes.  It's in the procmailrc(5) man page.  Put an extra dollar sign at 
the beginning of the condition, like so:

  # make sure my email address is in the To: header
  * $ ^To:.*$LOGNAME@

That will make procmail do variable substitution (for later dollar 
signs) and command substitution (for backquotes) on the condition before 
using it.


     It helps to know what you're looking for.  Found it.  Thank you.

-------------------------------------------------------------------------------
Chris Johnson               |Internet: 
johnson(_at_)nmr(_dot_)mgh(_dot_)harvard(_dot_)edu
Systems Administrator       |Web:      http://www.nmr.mgh.harvard.edu/~johnson
NMR Center                  |Voice:    617.726.0949
Mass. General Hospital      |FAX:      617.726.7422
149 (2301) 13th Street      |"Quantum mechanics demands that magic exists"
Charlestown, MA., 02129 USA |        Me
-------------------------------------------------------------------------------


____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>