[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Filtering mail w/ procmail



On Wed, May 09, 2001 at 06:33:07PM +1000, mdevin@ozemail.com.au wrote:
> Will wrote:
> > here are some samples from my own bloated ~/.procmailrc :
> > 
> > 	DEBIAN=$MAILDIR/debian
> > 	POSTGRES=$MAILDIR/pg
> > 	MODPERL=$MAILDIR/mperl
> > 	DEFAULT=$MAILDIR/inbox
> > 
> > 	:0
> > 	* ^X-Loop: debian-.+@lists.debian.org
> > 	* ^X-Loop: debian-\/[^@]+
> > 	{ DN=`echo $MATCH | tr '[A-Z]' '[a-z]'` }
> > 	:0A:
> > 	$DEBIAN-$DN
> >
> Can Will or someone else explain how this $DN variable works?  What does
> $MATCH get set to here?

ah, yes. you wish to be inducted into the cult... step this
way-- (door creaks open into darkness)

the DN part is just a plain ol' variable:
	DB=`echo $MATCH | tr '[A-Z]' '[a-z]'`
heck, that's just like in most any command shell.

now, about that $MATCH gizmo.

well, there's a much longer story, but here's the part you're
interested in:

after a pattern-match string such as

	* ^X-Loop: debian-\/[^@]+

whatever string MATCHES AFTER "\/" is dumped into $MATCH.
and \/ doesn't actually affect the pattern to be matched.
here, since the following pattern is

	[^@]+

and since what precedes is

	debian-

then $MATCH will be "user" for debian-user@lists.debian.org,
and "www" for debian-www, and so forth.

and since the target for such matches is

	$DEBIAN-$DN

any debian-user mail goes into my $MAILDIR/debian-user mbox.

there's some cool stuff, procmailrc-wise in the form of hints
and recipes and intros, at various websites. search for
"procmail quick start"...

don't forget to pay your dues to the executioner on your way out
of the dungeon. when you do he'll give you a pointer to
http://www.ii.com/internet/robots/procmail/qs/ which has a high
"i wish i'd known about that last month" rating.

-- 
DEBIAN NEWBIE TIP #30 from Wayne Topa <wtopa@dmcom.net> 
:
Are you seeing GIBBERISH after viewing a binary file on your
console (or in an xterm/rxvt window)? Add this to your ~/.inputrc
file:
	"\033[[A": "reset\C-M"
Now when you need a quick tty reset, just press F1 at the command
prompt. Try "info rluserman" for more options.

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: