home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / softsys / andrew / 1223 next >
Encoding:
Text File  |  1992-09-07  |  3.8 KB  |  98 lines

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!cs.kun.nl!harcoh
  2. From: harcoh@cs.kun.nl (Harco de Hilster)
  3. Newsgroups: comp.soft-sys.andrew
  4. Subject: Re: AMS Filtering
  5. Message-ID: <8edrK8S3fW419FU19e@cs.kun.nl>
  6. Date: 4 Sep 92 14:41:12 GMT
  7. References: <0edXSRe00Woh5D=Q1Y@andrew.cmu.edu>
  8. Sender: daemon@ucbvax.BERKELEY.EDU
  9. Organization: The Internet
  10. Lines: 86
  11.  
  12. Hi,
  13.  
  14. I use flames to handle our bulletin board. I got some sample andrew.cmu
  15. flames files, and I followed the style closely. I've got it to work
  16. reasonably, but the cmu style (or mine) of filtering messages has
  17. troubles with multiple bboards in the to: field.
  18.  
  19. I want to be able to handle every bboard separately. Say I have two bboards:
  20. loc+public
  21. off+announce
  22.  
  23. I want to post a message to both of them but not every body is allowed
  24. to post on off+announce. 
  25. The to field looks like: 
  26. "loc+public" <bbsman@cs.kun.nl>, "off+announce" <bbsman@cs.kun.nl>
  27.  
  28. The flames file looks like this:
  29.  
  30. ; Filter function for bbsman
  31.  
  32. (defun bbsman-mail-hook (msg)
  33.   (progn
  34.    ; first get all relevant headers
  35.    (let* ((hdrs (multi-GetHeaderContents msg '("to" "cc" "resent-to" "apparentl
  36. y-to")))
  37.           (offextrs (extract-liberally "offbb\\+"  hdrs))
  38.           (locextrs (extract-liberally "locbb\\+"  hdrs))
  39.           (extextrs (extract-liberally "extbb\\+"  hdrs))
  40.           (prvextrs (extract-liberally "bbsman\\+" hdrs))
  41.           (subj (getheadercontents msg "subject"))
  42.           (sender (GetAuthSender msg))
  43.           (to (getheadercontents msg "to")))
  44. ; handle the info-andrew mailing list
  45. (cond ((a-str-in-any-str "info-andrew" hdrs T)
  46.        (appendmsgtodir msg
  47. "/vol/andrew/bboards/loc/.MESSAGES/andrew/mailing-list"))
  48.       ; default handling of posting on official bulletin boards
  49.       (offextrs (post-to-list msg
  50.                               offextrs
  51.                               "mail.lost"
  52.                               (replyaddr msg "sender")
  53.                               "bbsman@cs.kun.nl"
  54.                               "There was a problem delivering your
  55. message\n Does this bboard exists?\n Contact the bbsman if you have any
  56. questions."
  57.                               NIL
  58.                               ; only the listed people are allowed to post on o
  59. fficial
  60.                               '(((".*") ("bbsman" "harcoh" "robd" "wim" "hansj"
  61.  "yellak" "joycev") "You are not allowed to post on the official
  62. bboard.\n Please contact the bbsman if you want to"))))
  63.       ; handling of posting on local bulletin boards
  64.       (locextrs
  65.        (cond
  66.         ; handle the public bulletin board
  67.         ((a-str-in-any-str "public" locextrs T)
  68.          (post-to-list msg
  69.                        locextrs
  70.                        "mail.lost"
  71.                        (replyaddr msg "sender")
  72.                        "bbsman@cs.kun.nl"
  73.                        "There was a problem delivering your message\n
  74. Please contact the bbsman."
  75.                        T
  76.                        NIL))
  77. ........ etc. ........
  78.  
  79. The Cond construct makes it impossible to have multiple bboards in the
  80. to: field. Because the off condition succeeds the message is posted to
  81. off+announce and the message to loc+public disappears. Not splitting the
  82. messages in loc+, off+ and ext+ can make things worse. If the to field
  83. contains off+ then all the messages are handled in the first
  84. post-to-list.
  85. This .AMS.flames file is very unsafe. If the to field contains
  86. loc+public (the only bboard students can create sub-bboards on with no
  87. access restriction) then all my further tests on loc+course.p1 (with
  88. access restriction) are skiped.
  89.  
  90. What I really need is that for each item in the to field, the filter
  91. function gets called. A message with two to fields is infact two
  92. messages (HUH?). Since my flames file is similar to your own flames
  93. files, you must have the same problem or am I missing something here.
  94.  
  95. Any suggestions?
  96.  
  97. Harco
  98.