tisift
imap cleanup & command line tool
...Example:
# Set MsgId on Mails without one
FOLDER="Archives" ; tils -I "$FOLDER" |grep "\{"|while read LINE ; do tish -x addheader "$FOLDER" "$LINE" "X-New-Header: true" ; done
# Correct Date to second received header:
tish date Archives PATTERN received2
# Import or export mbox
tish exportmbox Archives >file.mbox
tish importmbox Archives <file.mbox
Written in ruby.
Attention: Use on your own risc! You can damage your whole mail data!