procmail
[Top] [All Lists]

Re: Problem assigning to and testing a variable

1998-01-07 10:48:01
Donald Hammond followed up,

| Although your better solution(s) make it a moot point, my version
| of date (GNU sh-utils 1.12) does honor the %-escapes.  Whether or
| not the ISP's version does is another matter -- and one which has
| bit me in the past.

The question is which version of date is showing up first in $PATH on the
machine where procmail is running, and I wasn't sure it was one that groks
the escapes.

| It is a testament to your abilities that you can provide the
| correct answer(s) to the wrong questions.  ;-)

Thank you ... ?

| The following is what I'm going to try.
| 
|         :0
|         * ^(X-Loop|X-Mailing-List):(_dot_)*procmail(_at_)informatik
|         * ^(To|cc):(_dot_)*procmail(_at_)informatik
|         {
-->         { # from Sun 5:00p to Fri 4:59:59p forward a copy to work
|             :0 c
|             * ^From .*\/ (Sun .* (1[789]|2.):..:|(Mon|Tue|Wed|Thu) \
|             |Fri .* (0.|1[0-6]):..:)
|             ! DHammond(_at_)fujisec(_dot_)com
|           }
|         :0:
|         $DEFAULT
|         }

And it won't work.  You have a left brace hanging out of nowhere with no re-
cipe to open it (where I marked the arrow).  Also, I gather that the second
condition is to weed out a lot of the spam blind carboned to this list, so
you might be better off with ^TO (or ^TO_ if your version of procmail sup-
ports it) there, and you have an extraction operator where you're not using
the resultant $MATCH.  Finally, just in case something gets hosed and there
is yet another ^From_ line buried in the header, I'd anchor to the start of
the head rather than only to the start of a line.  So then we'd have this:

      :0 # Use ^TO if you don't have ^TO_
      * ^X-(Loop|Mailing-List):(_dot_)*procmail(_at_)informatik
      * ^TO_procmail(_at_)informatik
      {
        # from Sun 5:00p to Fri 4:59:59p forward a copy to work
          :0 c
          * ^^From .* (Sun .* (1[789]|2.):..:|(Mon|Tue|Wed|Thu) \
             |Fri .* (0.|1[0-6]):..:)
          ! DHammond(_at_)fujisec(_dot_)com

          :0: # Are you sure you don't want a special folder for the list?
          $DEFAULT
      }

I'd do one thing differently as a matter of personal taste; I'd list the
shorter part of the week rather than the longer part in the forwarding test:

        # from Sun 5:00p to Fri 4:59:59p forward a copy to work
        :0 c
        * ! ^^From .* (Sat |(Fri .* (1[789]|2.)|Sun .* (0.|1[0-6])):..:)
        ! DHammond(_at_)fujisec(_dot_)com

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