procmail
[Top] [All Lists]

Re: is this legal?

1996-12-17 08:49:44
    > Is there any reason why I can't do this?
    > 
    > :0
    > * ? test -f $PROCDIR/mailing-lists.rc
    > { INCLUDERC=$PROCDIR/mailing-lists.rc }
    > 
    > :0
    > * ? test -f $PROCDIR/next-newsgroups.rc
    > { INCLUDERC=$PROCDIR/next-newsgroups.rc }
    > 
    > 
    > :0
    > * ? test -f $PROCDIR/kill-by-subject.rc
    > { INCLUDERC=$PROCDIR/kill-by-subject.rc }
    > 
    > 
    > I am trying to make my .procmailrc easy to read and easier to  
    > maintain between 3 very different accounts.
    > 
    > I want to include them but only if they exist.  If they all exist,  
    > then I want to include them all

Not only can you do this, but it is a good idea!

This is how I currently arrange my own ~/.procmailrc:

    # procmailrc for aks                -*- text -*-
    #
    # Basic philosophy:
    #
    #  1.  If incoming mail is directly addressed to me
    #  1a.   if it is a command, process it
    #  1b.   acknowledge it
    #  2. If it is not directly to me, run any "junk mail" filtering
    #     commands on it.
    #  3. Run my "prefiling" recipes on it.
    #  4. Drop the mail into the $DEFAULT folder
    #  
    SHELL=/bin/sh
    PATH=$PATH:/usr/local/bin:/usr/freeware/bin
    MAILDIR=$HOME/Mail
    LOGFILE=$MAILDIR/Log
    :0                  # see if we've locked our filter
    * ? test -r $HOME/.procmailrc.lock
    { EXITCODE=75 HOST }        # try again later (EX_TMPFAIL)
    LINEBUF=6000                # make line buffers bigger
    :0                  # Pull in the standard header patterns
    * ? test -r headers.rc
    { INCLUDERC=headers.rc }
    # Setup variables for general-purpose recipe files
    MY_ADDR=aks(_at_)sgi(_dot_)com
    MY_ADDRS="(aks|stebbens)(@$HOSTADDR)?"
    FROMSIG="Alan's Mailer-Daemon <$MY_ADDR>"
    NOACKFILE=$MAILDIR/noacks
    VERBOSE=no
    LOGABSTRACT=yes
    # Do the duplicate mail check
    :0
    * ? test -r dupcheck.rc
    { INCLUDERC=dupcheck.rc }
    :0
    * ? test -f vacation.msg
    { VACATION=yes }
    # If the mail is to me, do some special things
    :0
    * $ ^TO($LOGNAME|stebbens)(@($HOSTNAME(\.engr)?|(.*\.)?sgi\.com))?
    { # Check for any commands on the Subject line
      :0
      * ? test -f commands.rc
      { INCLUDERC=commands.rc }
      # Do any acknowledgements
      :0
      * ? test -f ackmail.rc
      { INCLUDERC=ackmail.rc }
    }
    # If it is not addressed directly to me -- do junkmail filtering
    :0 E
    * ? test -f junkmail.rc
    { INCLUDERC=junkmail.rc }
    # Do some prefiling, regardless of whether or not it's addressed to me
    :0
    * ? test -f prefile.rc
    { INCLUDERC=prefile.rc }
    :0:
    $DEFAULT

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