Simple tool to split your mailbox or maildir.
You can customize the directory, prefix, name and suffix of the output
mailboxes using the headers of the messages stored in your mailbox. Prefix,
name and suffix are expanded by str.format
function.
Prefix, name and suffix are expanded by str.format
function. The keyword
arguments of the function are the header of the mail (see Python class
email.message.Message
), with some extensions:
Date
header is adatetime.datetime
object
splitmailbox --suffix '_{Date:%Y}' mail/mbox
Will create the mailboxes mail/mbox_2000
, mail/mbox_2001
, ...
- Directory are not created at runtime (e.g.
--prefix '{Date:%Y}/{Date:%m}'
)