At 07:43 PM 7/5/99 +0100, John Poltorak wrote:
Is there any way to get procmail to insert mail seperators ala MMDF between
msgs in a mailbox?
No! (OK, I'm being a bit of a pedant here, but you can't readily insert
anything into a mailbox; you need to make a new one :-)
I'm not really sure what MMDF format is, but if it's just the same
as mbox with a series of ^A separators, then the following should work
(being oppressed by this heat wave, I'm not going to struggle to write up
specific untested commands because I'll probably get something wrong :)
1. Use formail -s to split the old box into mails, handled one at a time.
2. Feed each mail to a script which:
a. if target file (new mailbox) is >0 length, appends your ^A's.
Probably use echo, but if you need no newline and your echo doesn't
support that, you can pre-create a file with your ^A's in it
and use cat.
b. then, appends the mail (probably use stdin of the script) to the new
3. Make sure that you don't deliver new mail the "old way" to the new format
box... you can probably now route it with procmail to the same script
as in #2.
I assume mail won't be coming in to the old box (or the new one) while
you're doing the above; if so, lock it/them during those times (lockfile).
Hope that helps,