procmail
[Top] [All Lists]

Re: TO_, FROM_ macros

2001-05-30 07:15:59
I have seen a fair number of solutions on this list use TO_ and FROM_
macros, but I cannot locate where these macros reside on my system.  I
would like to look at them and examine the logic that was used.  Is it
also possible to define your own macros?

There's no such thing as the ^FROM_ expression - you're probably
thinking of ^FROM_DAEMON and ^FROM_MAILER

They're in the procmail source code.  On your system, they reside in the
procmail executable program.  You can see their definition and look at
the logic by reading the procmailrc man page - the full regular
expression substitutions are given in the MISCELLANEOUS section.

You can't define your own macros in the same way (other than changing
the procmail sources) but you can do something similar using variables.
To get a 'FROM' type thing you could do something like:

  # the spaces in the next line are 1 SPACE and 1 TAB
  FROM_="^(From[     ]|(Old-|X-)?(Resent-)?(From|Reply-To|Sender):)(.*\<)?"

  :0 :
  * $ $FROM_(_at_)ancient-scotland\(_dot_)co\(_dot_)uk\>
  not-worth-reading

Maybe that helps.
Martin

-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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