Recipe Dissection

Gregory Higgins <[email protected]> Wed, 05 Nov 2008 22:36:22 -0500
Newsgroups gmane.mail.smartlist.user
Message-ID <[email protected]>
This comes directly from SmartList/etc/rc.request  (i.e., it is an
unmodified installation file).

Consider this recipe:

#
# Is it an archive retrieval command?
#

 :0 HB w
 * 9876543210^0 ^^(.+$)*Subject:[       ]*(([(<]no(ne| subject\
     ( (\(file transmission|given))?)[>)])?\
    $(.+$)*(^[  ]*)+)?(archives?:?([    ]|$)|\
    ((send|get)(me)?|gimme|retrieve|mail|ls|dir(ectory)?|list|show|\
     search|[fe]?grep|find|maxfiles|version)([  ]+[^    ]*)?$)
 *  1^0 B ?? ^^([       ]|$)*\
       ((archives?:?($|[        ]+)|\
         ((send|get)(me)?|gimme|retrieve|mail|ls|dir(ectory)?|\
           list|show|search|[fe]?grep|find|maxfiles|version|help|info)\
          ([    ].*)?$)([       ]|$)*)+\
           ([^  a-z].*$(.*$(.*$(.*$(.*$)?)?)?)?)?^^
 {
   :0 W
   * 9876543210^0 !restrict_archive ?? y
   * 2^0 ? formail -rt -R To: "From " -X "From " | \
            multigram -b1 -m -l$submit_threshold -L$domain \
             -x$listaddr -x$listreq accept accept2
   | arch_retrieve

   :0 E fhw
   | formail -A "X-Diagnostic: Not on the accept list"
 }

As I remember, this is supposed to be a complete recipe; so where is
the closing parenthesis for


  9876543210^0 ^^(.+$)*Subject:[       ]*____(____([(<]no(ne| subject\

the marked left paren supposed to go?

Ditto for

#
# Is it an unsubscription request?
#

  :0 EHB
  * 9876543210^0 ^^(.+$)*Subject:[       ]*____(____[(<]no(ne| subject\


and


#
# Is it a subscription request?
#

  :0 EHB
  * 9876543210^0 ^^(.+$)*Subject:[       ]*____(____[(<]no(ne| subject\

and

#
# Is it an info or help request?  Send back the help.txt and the
# optional info.txt file.
# We do the same on a complete empty mail (except for perhaps a signature).
#

  :0 EHB
  *  3^0 ^^(.+$)*Subject:[       ]*\
                 ____(____([(<]no(ne| subject( (\(file
transmission|given))?)[>)])?$\
     (.+$)*(^[   ]*)+)?[a-z,.    ]*(help|info(rmation)?)\>
  *  1^0 ^^(.+$)*Subject:[       ]*\
                  ____(____[(<]no(ne| subject( (\(file
transmission|given))?)[>)])?$