procmail
[Top] [All Lists]

Re: How to extend ^TO_

2014-01-25 00:45:16

On 24 Jan 2014, at 17:21 , Geoff Soper 
<geoff(_dot_)procmail2401(_at_)alphaworks(_dot_)co(_dot_)uk> 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


____________________________________________________________
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>