procmail
[Top] [All Lists]

Re: move pine folders

2003-10-11 11:43:15
On Sat, 11 Oct 2003, Jay Moore wrote:

On Sat, Oct 11, 2003, Bart Schaefer stated:

If these are standard unix mbox format folders (as opposed to UW's mbx
format, or something else) you should be able to edit the first folder
with a text editor, delete the first message (ignoring "DO NOT DELETE"
warnings in that message) and then "cat editedfolder >> targetfolder"
(note ">>" for append, not ">" which will overwrite).

I think I follow you, but I'm not clear on how I'd delete the first 
message from a script.

D'oh.  For some reason I was thinking you just meant "how do I copy all
the messages at once" rather than "how do I write a shell script to ...".

Here's what my empty folder looks like:
[...]
1. save the "empty folder file" above as 'empty.blacked';
   the target folder is called 'blacked-archive'

Pine doesn't need the "FOLDER INTERNAL" message on an empty folder.  You
can just create an empty file.  It'll recreate the internal message the
first time you access the folder read/write.  The only reason for doing
the copy that you suggest would be to assure the internal message exists
in the event that you later use formail on the file without ever having
had it open in pine first.

2. in my script:

   cat mail/blacked | formail +1 -ds >> blacked-archive
   rm blacked
   cp empty.blacked blacked

"formail +1 -s" is in fact what you need.  I don't think you want the -d
option.  The only difficulty with the above is that it doesn't protect
you from race conditions if something else might be writing a message 
into the "blacked" file while this is happening.  If you know that's not
a problem, then you're fine.


_______________________________________________
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>