[SLUG] procmail success!

From: Derek Glidden (dglidden@illusionary.com)
Date: Thu Jul 19 2001 - 19:31:28 EDT


Finally, I got it working! Here's what I added to my .procmailrc:

:0
* ? formail -rt -xTo | egrep -is -f \
     /home/dglidden/.procmail/lists
{
   LISTNAME=`formail -rt -xTo | egrep -is -f \
             /home/dglidden/.procmail/nks-lists | \
             sed -e 's/\@nks\.net//' -e 's/[ ]//'`

   :0 c
   Lists/${LISTNAME}

   :0 fw
   | formail -A "X-Status: D"

   :0
   ${DEFAULT}
}

(Lines postfixed with "\" really need to be continued on the next line
but were split here for ease-of-reading.)

Then in my ~/.procmail/ directory, I have a file called 'lists' that
contains the address of all my work-related lists. Note that this rule
only matches the lists I have for work, on which our majordomo is
configured to automagically set the "reply-to" header! I have other
rules for other lists that just match a particular mail header without
using formail and explicitly names the folder to file them in.

Notice that I rearranged the order of the rules from what Ian suggested.
  It just works better this way.

The first call to "formail" here checks the header information to see if
it matches the name of one of the lists in my "lists" file. If so,
procmail finishes executing the recipe.

The "LISTNAME=" line has to run formail again against egrep to filter
out just the list "name" without the domain attached to it, as it shows
up in the headers. (So if the list address is "slug@nks.net", which the
first formail matches, the only thing I want from that is "slug" which
is how it's listed in my "lists" file and which the second formail
matches. There's probably a better way of doing this without calling
formail again, but this works so I'm living with it for now.... :)

The first :0 rule makes a copy of the message in an mbox file with the
name of the list under a directory called "Lists" in my mail directory.

The next :0 rule uses formail again to add the "X-Status: D" header,
which is a non-standard header that Netscape and mutt both recognize as
a "This message has been tagged to be deleted" header.

The final :0 rule tells procmail to stop processing any further recipes
and just file this message (with added "X-Status: D" line) back into my
INBOX spool. This line is here because otherwise, the message will
continue to pass through all remaining recipes, including my huge
multi-kilobyte Junkfilter recipe, when it doesn't really need to.

So now mail gets filtered by procmail, with copies made in the folder I
want but also left in my INBOX for me to read, but also marked "Deleted"
so I don't have to delete everything by hand, I don't have to rely on my
MUA's filtering abilities, and I can swap from one MUA to another
without having to rewrite my filters all the time. Life is good!

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/usr/bin/perl -w
$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map
{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;
$t^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)
[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h=5;$_=unxb24,join
"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d
 >>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*
8^$q<<6))<<9,$_=$t[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}
print+x"C*",@a}';s/x/pack+/g;eval

usage: qrpff 153 2 8 105 225 < /mnt/dvd/VOB_FILENAME \ | extract_mpeg2 | mpeg2dec -

http://www.eff.org/ http://www.opendvd.org/ http://www.cs.cmu.edu/~dst/DeCSS/Gallery/



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:19:59 EDT