Skip site navigation (1)Skip section navigation (2)
Date:      22 May 2001 11:19:04 -0700
From:      Ken McGlothlen <mcglk@artlogix.com>
To:        parv <parv_@yahoo.com>
Cc:        f-q <freebsd-questions@freebsd.org>
Subject:   Re: procmail is out of whack; for reasons unknown. please help.
Message-ID:  <877kz9457r.fsf@ralf.artlogix.com>
In-Reply-To: parv's message of "Tue, 22 May 2001 01:55:50 -0400"
References:  <20010522015549.A20102@moo.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
parv <parv_@yahoo.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?877kz9457r.fsf>