[ILUG] script process mboxes add headers

Pete McEvoy pete at yerma.org
Thu Aug 2 15:34:04 IST 2007


Hi.
I'm doing some more migrating of users from a box using mbox/vm-pop3d to
a new box using maildir/dovecot. Unfortunately, lots of my users leave
messages on the server, so I'm trying to avoid making them redownload
messages after I migrate them. As far as I understand it, this involves
having dovecot present the same uidl to the clients - problem is,
vm-pop3d seems to use message-id for the uidl, and dovecot doesnt
support this as Timo says message-id isnt unique enough.
Apparently the solution is for me to add a X-UIDL header to the messages
based on the message-id, I can then force dovecot to use that with
pop3_reuse_xuidl=yes.
Where I'm faltering is the script to achieve this, I believe that
formail is the tool for the job, but I'm having a hard time getting my
head round the syntax, in fact I've not got much further than figuring
out how to extract the message-id, which seems to be:
formail -s formail -XMessage-Id < mailbox 
I'm aware that -A is the switch to add headers, but I'm wondering if
theres some magic in formail that I'm missing that would automagically
take the data from the Message-Id header and add it a X header,
rather than trying to mung it myself.

I guess a shorter way of asking this would be:

Does anyone know how to process all messages in a mbox, taking the data 
from the message-id header and adding it to a new X header?

Thanks

-- 
Pete



More information about the ILUG mailing list