procmail
[Top] [All Lists]

Re: Procmail experiments -- good methods, continued

1999-05-16 18:44:53
"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:

Now, where did I leave off?  Harry had this recipe,

***8< serious snippage of informative material

David your posts are giving me plenty to work with.  Not that
conversant with sed or awk so am stumbling around with them.  
Trying to follow along though.  

One thing I haven't found a reference to is the ` -ep' in your script.
What is its function?
        -e '/END--------------cut here-------------/q' -ep \

I've now moved to a simpler sed script  and dropped awk altogether.  I
was overcomplicating things quite a bit.  The latest .procmailrc looks
like this:
(havent' gotten to try any of your suggestions yet)

 :0fhbw
 * ^From apollo-list-request@
 * ^Subject: archive retrieval: latest/[0-9]+
| sed -f ~/projects/awk-sed/sedsc/sedsc-redhatlists

The sed script called here looks like:
3,/BEGIN.*cut here/d
/END.*cut here/, $d 

Solves the header stuff with less fanfare.. Not sure what the $d does
but it doesn't work with out it.

This just snatches out the extra headers from the archive machine and
leaves the "From" and "Return-Path" intact, setting on top of the
original messages headers.

The rest is just sending to mnth folders.  However I'm having a bit of
trouble seeing how using the 'a' is different than enclosing in block
{}. The man  pages seem to be saying they do the same thing.

   :0a
   * ^Date:.*Nov
   /home/reader/projects/proc/apollo/Nov/.
  
   :0a
   * ^Date:.*Dec
   /home/reader/projects/proc/apollo/Dec/.

More date finders ....

One minor aspect of all this is that while processing the archive
messages I sometimes get a phantom  "From foo(_at_)bar" showing up in the
experimental DEFAULT mail box, that has no other lines.

I thought it was my abuse of awk, somehow but it has shown up after
removing the awk part.  Haven't  seen yet where it is coming from.