[vox-tech] tags with mutt

Chanoch (Ken) Bloom kbloom at gmail.com
Tue Apr 21 08:46:41 PDT 2009


On Tue, Apr 21, 2009 at 07:19:14AM -0700, Gandalf  Parker wrote:
> On Mon, Apr 20, 2009 at 11:31:32PM -0700, Mike Simons wrote:
> > > 
> > > Is there a way to use tags with email and mutt?
> > 
> > First search, using mutt's limit "l" command you can filter a 
> > folder based on most anything ... header searches are fairly fast.
> 
> Thanks for this. This is something I should try. I havent been using
> tags because other than the spam tag I saw no use for it. But now I
> think I do.
> 
> > Searching on headers was the easy but adding/deleting tags from
> > messages seems to requires a little elbow grease.
> > 
> > Hunting through the manual, I didn't see an obvious way to update
> > any specific mail headers.  However there are ways to edit the whole 
> > message ... and ways to switch the editor ... so we'll combine those.
> 
> I have to say Im really surprised at this from this group. Usually
> everything is over my head. But on the subject of presort and
> handling of mail I thought that the standard answer was always
> procmail. It seems as though every ISP forum or gaming group Ive
> been in where the question came up that was always the answer.
> Something like "you can do your own but procmail is almost always
> available so why"
> 
> Procmail is even part of the instructions of many spam handlers and
> game processors for turn files. As in "turn on procmail handling
> then include these 4 lines in your procmailrc file. I think its even
> part of default installation on many linux altho I dont have a way
> of checking that.

I personally feel that Procmail is a tad verbose, requiring 4 lines
per email address to filter a message, and some kinds of conditional
logic are difficult. So I use Ruby's 'rfilter' package, and have a
filter that looks much more compact:

      if from =~ /messages at frumster.com/
        saveto ".shidduchim" if subject =~ /sent you a message/i
        saveread ".shidduchim"
      end
      if from =~ /support at sawyouatsinai.com/i
        saveto ".shidduchim" if subject =~ /You have received/i
        saveread ".shidduchim"
      end
      discard if from =~ /Offers.syas at sawyouatsinai.com/i
      discard if from =~ /adverti[sz]ements at sawyouatsinai.com/i

      saveto ".lists.admin" if from =~ /listserv at shamash.org/i
      saveto ".lists.admin" if header["X-List-Administrivia"] == "yes"

      if from =~ /acl at aclweb.org/
        message.header.subject=subject.sub('[na_members at aclweb.org] ','')
        saveto ".lists.ACL"
      end
      saveto ".lists.ACL" if from =~ /rasmusse at cs.rutgers.edu/
      saveto ".lists.ACL" if from =~ /carla.sa at mccsis.org/
      saveto ".lists.ACL" if from =~ /ahakim at mac.com/
      saveto ".lists.AppraisalAnalysis" if listid =~ /<AppraisalAnalysis.yahoogroups.com>/
      saveto ".lists.AppraisalAnalysis" if listid =~ /SentimentAI.yahoogroups.com/

      saveto ".lists.linux" if listid =~ /.*vox.*lugod/
      saveto ".lists.linux" if listid =~ /bad.bad.debian.net/
      saveto ".lists.linux" if listid =~ /luni.luni.org/
      saveto ".lists.linux" if listid =~/vcs-home.lists.madduck.net/
      saveto ".lists.linux" if listid =~ /chicagolug.org/

(I think I tried perl first, but in perl the @ does variable interpolation.
Mind you the . in my regular expressions matches any character, but I've never
really had a problem leaving it unescaped)

> It was such a common answer that I drug my feet for a long time
> before looking into it (I tend to hate the pat answers). Once I did
> it got kinda fun. Like many linux programs it goes more for power
> than ease of use. It allows you to do pretty much anything you want
> in pre-handling mail but that can be confusing. Lots of googling
> required.
> 
> I see lots of examples for procmail snippets to do tags. Mostly as a
> way to presort spam. Checking for various subject lines or IP groups
> it comes from or words in the body, tagging it by changing one of
> the headers to add a tag like SPAM to the subject or an x-header,
> then letting it continue into your mailbox for your mail program to
> handle.
> 
> Gandalf  Parker
> _______________________________________________
> vox-tech mailing list
> vox-tech at lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.lugod.org/pipermail/vox-tech/attachments/20090421/bc6af00e/attachment.pgp 


More information about the vox-tech mailing list