procmail
[Top] [All Lists]

Re: Recipe problem

1999-11-15 10:39:12
On 11/15/1999 12:08 -0500, David Collantes wrote:
     
     Would anyone tell me why the following recipe will not work and what to
     do to make it work? I have tried the Jari pm-tips (in fact, part of the
     code above came from it) with no luck.
     
     Thanks in advance.
     
     
     :0
     * !^FROM_DAEMON
     * !^From TRC*
     * !^majordomo(_at_)bus(_dot_)ucf(_dot_)edu
     * !^majordomo-owner(_at_)bus(_dot_)ucf(_dot_)edu
     * !^owner-cba(_at_)bus(_dot_)ucf(_dot_)edu
     * !^owner-cbafac(_at_)bus(_dot_)ucf(_dot_)edu
     * !^owner-cbastf(_at_)bus(_dot_)ucf(_dot_)edu
     * !^owner-cbaadj(_at_)bus(_dot_)ucf(_dot_)edu
     * ^Content-Type.+multipart.alternative
     * ^Content-Type.+multipart.mixed
     * ^Content-Type.+text.html
     {
       :0
       | (/usr/bin/formail -rt ; /bin/cat 
/admin/d/david/admin/other/nohtml.txt) | /usr/lib/sendmail -oi -t
     }

Reading from the top, this recipe says roughly "if mail is not FROM_DAEMON
AND not from TRC... AND not from majordomo AND ... AND has Content-Type 
multipart.alternative
AND has Content-Type multipart.mixed AND has Content-Type text.html"

I suspect that those last three are the problem, or do you actually
get messages that have all three Content-Type headers? I suspect
you need to logical OR those (done easily through regexp in this
case):

      :0
      * !^FROM_DAEMON
      * !^From TRC*
      * !^From majordomo(_at_)bus(_dot_)ucf(_dot_)edu
      * !^From majordomo-owner(_at_)bus(_dot_)ucf(_dot_)edu
      * !^From owner-cba(_at_)bus(_dot_)ucf(_dot_)edu
      * !^From owner-cbafac(_at_)bus(_dot_)ucf(_dot_)edu
      * !^From owner-cbastf(_at_)bus(_dot_)ucf(_dot_)edu
      * !^From owner-cbaadj(_at_)bus(_dot_)ucf(_dot_)edu
      * ^Content-Type:.+(multipart\.(alternative|mixed)|text\.html)
      {
        ...
      }

Also note you were missing a bunch of "From"s. It's kinda hard to
read, but here's the final condensed regexp'ed version I'd use:

      :0
      * !^FROM_DAEMON
      * !^From:.*(TRC|majordomo(-owner)?|owner-cba(|fac|stf|adj))@bus.ucf.edu
      * ^Content-Type:.*(multipart\.(alternative|mixed)|text\.html)
      {
        ...
      }

Hope that helps a bit. One other quick note - this recipe
matches the From: header, not the envelope sender; if that's
not what you want, change the ':' in the second pattern
line to a ' ' to match the rest of the pattern in the
envelope sender...


                        tw



-- 
+------------------------------+--------------------------+
| Tim Walberg                  | Phone: 847-782-2472      |
| TERAbridge Technologies Corp | FAX:   847-623-1717      |
| 1375 Tri-State Parkway       | twalberg(_at_)terabridge(_dot_)com  |
| Gurnee, IL 60031             | 800-SKY-TEL2 PIN 9353299 |
+------------------------------+--------------------------+

Attachment: pgpLciBH0h93Z.pgp
Description: PGP signature

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