procmail
[Top] [All Lists]

Re: procmail rule Q:

1998-05-25 16:28:13
"Jeffrey A. Bell" <jfbell(_at_)gte(_dot_)net> writes:
I have the following rule in my procmailrc file:

# KDE mailing list 

:0:
* ^X-mailing-list: <kde-user
{
      # If the body of the msg contain the word REDHAT
      # This top rule works.
      :0 B:
      * redhat
      | $RCVSTORE +$SPAMFOLDER
      # Soon to be /dev/null

      # or if the subject line is about REDHAT
      # throw the msg away.
      :0 E:
      * ^Subject.*redhat
      | $RCVSTORE +$SPAMFOLDER
      # Soon to be /dev/null
 }    
| $RCVSTORE +$KDE_FOLDER

This last line is syntactically incorrect.  The close brace ends the
action of the outer recipe.  You need to put the pipe action on a
recipe inside the braces:

        :0:
        * ^X-mailing-list: <kde-user
        {
                # If the body of the msg contain the word REDHAT, or if
                # the subject contains the work redhat, then throw the
                # message away.
                :0
                * B ?? ()\<redhat\>
                * ^Subject:.*\<redhat\>
                |$RCVSTORE +$SPAMFOLDER
                # Soon to be /dev/null

                :0
                |$RCVSTORE +$KDE_FOLDER
        }       


As a footnote, I'll quote the rcvstore manpage's BUGS section:

    BUGS
         If you use the "Unseen- Sequence"  profile  entry,  rcvstore
         could  try to update the context while another MH process is
         also trying to do so.  This can cause the context to  become
         corrupted.   To  avoid  this, do not use rcvstore if you use
         the "Unseen-Sequence" profile entry.


Indeed, since MH never locks any of the files used to hold sequences,
updating sequences asychronously without explict locking, *including by
your interactive processes*, should not be done without your being
willing to lose all sequence data.  Making sure that you're using
public sequences instead of private sequences for the involved folders
should limit any given occurance to a single folder (all private
sequence for all folders are stored in a single file, and therefore any
corruption will most likely lose them all).  Alternatively, you can
not use the unseen sequence on these folders and have procmail handle the
delivery instead of passing it off to rcvstore:

        :0:
        * ^X-mailing-list: <kde-user
        {
                # If the body of the msg contain the word REDHAT, or if
                # the subject contains the work redhat, then throw the
                # message away.
                :0
                * B ?? ()\<redhat\>
                * ^Subject:.*\<redhat\>
                /dev/null

                :0
                $HOME/Mail/$KDE_FOLDER/.
        }       


Philip Guenther

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