FNAL Mailing list fun with procmail!

2012-02-17 Thread Steven Haigh
Well, Seeing as its a quiet night on the list, I figured I'd share a 
procmail recipe that I use for the FNAL mailing lists.


This takes the email, matches the Sender header, then removes the 
[SCIENTIFIC-LINUX-USERS] from the subject, adds a List-Post: header so 
the "Reply to List" function works in Thunderbird, then files the email 
in its own IMAP mail folder!


## Scientific Linux Users mailing list.
:0 Wfh
* ^Sender: owner-scientific-linux-us...@listserv.fnal.gov
| sed -e '/^Subject:/ s/\[SCIENTIFIC-LINUX-USERS\] *//g' && sed 
':a;N;$!ba;s/Precedence: list/Precedence: list\nList-Post: 
/g'

:0 A
.Mail\ Lists.SL-Users/

Now, as I know some mail clients will mess this up with wrapping lines, 
the following is the first two chars of a new line:


:0
*
|
:0
.M

Procmail can do some pretty awesome email voodoo ;)

--
Steven Haigh

Email: net...@crc.id.au
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299



smime.p7s
Description: S/MIME Cryptographic Signature


Re: FNAL Mailing list fun with procmail!

2012-02-17 Thread Steven Haigh

On 17/02/2012 9:00 PM, Steven Haigh wrote:

## Scientific Linux Users mailing list.
:0 Wfh
* ^Sender: owner-scientific-linux-us...@listserv.fnal.gov
| sed -e '/^Subject:/ s/\[SCIENTIFIC-LINUX-USERS\] *//g' && sed
':a;N;$!ba;s/Precedence: list/Precedence: list\nList-Post:
/g'
:0 A
.Mail\ Lists.SL-Users/


Whoops - just noticed a bug in this... It should be:

:0 Wfh
* ^Sender: owner-scientific-linux-us...@listserv.fnal.gov
| (sed -e '/^Subject:/ s/\[SCIENTIFIC-LINUX-USERS\] *//g'| sed 
':a;N;$!ba;s/Precedence: list/Precedence: list\nList-Post: 
/g')

:0 A
.Mail\ Lists.SL-Users/

This makes the email list fully rfc2369 compliant, and tidies things up :)

--
Steven Haigh

Email: net...@crc.id.au
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299




smime.p7s
Description: S/MIME Cryptographic Signature