Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

sheriff_p (1577)

sheriff_p
  (email not shown publicly)
AOL IM: sheriff123414 (Add Buddy, Send Message)

Journal of sheriff_p (1577)

Wednesday May 04, 2005
04:04 AM

Filtering non-ASCII characters with procmail and mutt

[ #24526 ]
Almost a year since my last entry, awesome... :-)

So here's a little snippet of my .procmailrc to remove characters I can't understand anyway from the subject and from lines, as mut is sending them straight to my terminal, and messing up my display:

# Rewrite the subject and sender to remove foreign characters
OLDSUBJECT=`/usr/local/bin/formail -xSubject:`
NEWSUBJECT=`echo $OLDSUBJECT | /usr/bin/tr -cs '\11\12\40-\176' 'Z'`

OLDSENDER=`/usr/local/bin/formail -xFrom:`
NEWSENDER=`echo $OLDSENDER | /usr/bin/tr -cs '\11\12\40-\176' 'Z'`

:0fw
|/usr/local/bin/formail -i "Subject: $NEWSUBJECT"

:0fw
|/usr/local/bin/formail -i "From: $NEWSENDER"

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.