From owner-freebsd-questions Tue May 22 11:19:10 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ralf.artlogix.com (sense-mcglk-240.oz.net [216.39.168.240]) by hub.freebsd.org (Postfix) with ESMTP id C458A37B422 for ; Tue, 22 May 2001 11:19:05 -0700 (PDT) (envelope-from mcglk@artlogix.com) Received: by ralf.artlogix.com (Postfix, from userid 1000) id 8B1161B9D6E; Tue, 22 May 2001 11:19:04 -0700 (PDT) To: parv Cc: f-q Subject: Re: procmail is out of whack; for reasons unknown. please help. References: <20010522015549.A20102@moo.holy.cow> From: Ken McGlothlen Date: 22 May 2001 11:19:04 -0700 In-Reply-To: parv's message of "Tue, 22 May 2001 01:55:50 -0400" Message-ID: <877kz9457r.fsf@ralf.artlogix.com> Lines: 106 X-Mailer: Gnus v5.7/Emacs 20.6 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG parv writes: | until before today procmail recipie were doing just fine; then procmail start | delivering all over the place. could you help? Well, without being able to see the full headers of the messages it's routing badly, it's hard to say what's going on here. However, I have often noticed that procmail is very bad at reading my mind, so over the years, I've become much, much more specific with procmail about what I want where. For example, here's my .procmailrc (heavily elided for readability); I've left only a few recipes. Note that I've defined $FROM (a sort of expanded ^TO), $H (legal characters which would appear in the hostname) and $U (legal username characters). Also, since I use cumulative filtering on some recipes, you'll note $PASS (2^31-1), which filters immediately. :) Why do I go to all this work? Because over the years, it's been "questions@freebsd.org," "freebsd-questions@freebsd.org," sent to me *and* to "questions@freebsd.org," and so on and on and on. $FROM is defined so that any message that *mentions* questions@freebsd.org in the header (either going *to* there, or coming *from* there, or *also* sent there) winds up in a separate spool file. The liberal use of ${U} and ${H} in the right places ensure that even if the address changes to owner-freebsd-questions@zarquon.freebsd.org for some reason that it'll still wind up in the right spool directory. I don't subscribe to -mobile, but I'll just include it below as an example. Good luck with this, by the way. #------------------------------------------------------------------------------ # procmail run commands #------------------------------------------------------------------------------ PATH=$HOME/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin LOGFILE=$HOME/.procmaillog SPOOL=$HOME/spool FROM="(^TO|^From[ ]+|^X-From-Line:[ ]+)" H="([a-z0-9---]+\.)" U="[a-z0-9---_\+\.\%=]" PASS=2147483647 # Better fix the From lines. :0 fhw |formail # [...elided...] # xlist.freebsd.* :0 : *$ $PASS^0 ${FROM}${U}*announce@${H}*freebsd\.org *$ $PASS^0 ${FROM}${U}*security-advisories@${H}*freebsd\.org *$ $PASS^0 ${FROM}${U}*@${H}*daemonnews\.org $SPOOL/xlist.freebsd.announce :0 : *$ $PASS^0 ${FROM}${U}*config@${H}*freebsd\.org $SPOOL/xlist.freebsd.config :0 : *$ $PASS^0 ${FROM}${U}*database@${H}*freebsd\.org $SPOOL/xlist.freebsd.database :0 : *$ $PASS^0 ${FROM}${U}*jobs@${H}*freebsd\.org $SPOOL/xlist.freebsd.jobs :0 : *$ $PASS^0 ${FROM}${U}*ports@${H}*freebsd\.org $SPOOL/xlist.freebsd.ports :0 : *$ $PASS^0 ${FROM}${U}*security@${H}*freebsd\.org $SPOOL/xlist.freebsd.security :0 : *$ $PASS^0 ${FROM}${U}*mobile@${H}*freebsd\.org $SPOOL/xlist.freebsd.mobile :0 : *$ $PASS^0 ${FROM}${U}*questions?@${H}*freebsd\.org *$ $PASS^0 ${FROM}${U}*net@${H}*freebsd\.org *$ $PASS^0 ^Sender: ${U}*questions?@${H}*freebsd\.org $SPOOL/xlist.freebsd.questions # [...or, if you prefer the digest...] :0 : *$ $PASS^0 ${FROM}${U}*questions-digest@${H}*freebsd\.org |formail -ds >> $SPOOL/xlist.freebsd.questions # [...many other mailing lists and personal mailboxes elided...] # We're done. Everything else goes into generic spoolfiles. :0 : *$ $PASS^0 ^FROM_DAEMON *$ $PASS^0 ^{FROM}(abuse|tickets?|postmaster|autoreply|autoresponder)@${H}+ $SPOOL/mail.daemon :0 $SPOOL/mail.@@ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message