Re: How to extend ^TO_

LuKreme <[email protected]> Fri, 24 Jan 2014 23:41:44 -0700
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On 24 Jan 2014, at 17:21 , Geoff Soper <[email protected]> wrote:

> Hi,
> in various places within my procmail recipes I have the following string:
> (^TO_|Delivered-To:)
> 
> How can I define this as a variable that I can use repeatedly in my recipes and how do I include it in my recipes?

Define it in procmailrc (not .procmailrc) and every user will get it.

for example, on my system in /usr/local/etc/procmailrc I have a bunch of things setup like:

HOSTNAME=`hostname`
NL="
"
WS="  " #space tab

:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:
:0
* CLEANFROM ?? ^\/[^@]+
{ FROM_USER=$MATCH }
:0
* CLEANFROM ?? @\/.*
{ FROM_DOMAIN=$MATCH }
:0
* FROM_DOMAIN ?? .*\/([^\.]+)
{ TOPD = $MATCH }

I also have this block at the end of the file:

:0
* ! ? test -f $HOME/.procmailrc
{
  ## User has no procmailrc
  :0 fw
  | /usr/local/bin/spamc -u $LOGNAME

  DROPPRIVS=YES
  DEFAULT=$HOME/Maildir/

   :0
   * ^X-Spam-Status:(.*\<)?Yes
   {
      :0
      { TRAP='mv "$LASTFOLDER" "${LASTFOLDER}:2,S"' }

      :0
      .SPAM/
   }

   :0
   $DEFAULT
}

## Continue to user's .procmailrc

-- 
'Oook?' 'I like to listen to a man who likes to talk! Whoops! Sawdust
and treacle! Put that in your herring and smoke it!' 'I don't think he
wants one,' said Ponder. --Lords and Ladies