procmail
[Top] [All Lists]

formail tricks

2004-04-13 16:39:38
I have had an alias for a while in my tcsh shell called "headers":

 alias headers 'formail -X "" -s < \!:1'

That's fine, but I was getting tired of not being able to see easily
where one set of headers stops and the next starts.  I wanted a space or
something between.  I knew I could do this:

 alias headers 'formail -s sed -n "1,/^$/p;" < \!:1'

(except that, actually, I can't even get the quoting right).

And that would work dandy, assuming I solved the quoting issue.
However, I was disappointed at having to run the extra process.  Okay,
sure, it's just an interactive shell, and the extra process doesn't
really matter at all.  I would never notice the difference in speed.
But it was just one of those efficiency things eating at me.  So now
I've come up with this:

 alias headers 'formail -I =::::::::::::::::::::::= -X "" -s < \!:1'



I played around with different separators, including 

  -I x:
  -I .:
  -I .:.
  -I -:-

etc.  And while they were all okay, I think the string of ::::::::
does a nice job separating the headers to my eye.

So there you go.  Oh, and I have a version where I throw in a -c
option to unfold the headers for grepping, etc.

I just re-read "man formail", and I think I'm going to add a "-total"
in there so I don't inadvertently process 1000 messags at once or
something.

 alias headers 'formail -I =::::::::::::::::::::::= -X "" -20 -s < \!:1'

-- 
dman


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>