MB2MD(1)

🌸 MB2MD β€” bestie edition πŸ’–

ok so welcome to MB2MD(1), a.k.a. the General Commands Manual girlie of section 1. Her whole entire job? She takes your crusty dusty Mbox mailboxes and turns them into Maildir format. glow-up of the century, no cap. πŸ¦‹


✨ NAME ✨

mb2md β€” converts Mbox mailboxes to Maildir format. that's it. that's the mission. πŸ’…


✨ SYNOPSIS ✨

mb2md [-h]

mb2md [-c]  [-m]  [-d destdir]

mb2md [-c]  [-s sourcefile]  [-d destdir]

mb2md [-c]  [-s sourcedir]  [-l wu-mailboxlist]  [-R|-f somefolder]  [-d
destdir]  [-r strip_extension]

✨ DESCRIPTION ✨

okay so real talk: mb2md converts Mbox mailboxes to Maildir format. iconic behaviour honestly. ✨


✨ OPTIONS ✨

the menu, the lineup, the main characters πŸŽ€

  • -h β€” shows you a lil summary of all the options. the "help me bestie" button. πŸ™ˆ
  • -c β€” uses the Content-Length: headers (if they're even there πŸ‘€) to find where the next message begins. Use with caution! Results may be unreliable. she literally says: I recommend you do a run without -c first, and only use it if you're certain that the mbox in question really needs the -c option. so like... vibe check it first, fr fr. πŸ’€
  • -m β€” if you use this, the source becomes the single mailbox at /var/spool/mail/blah for user blah, and the destination mailbox becomes the "destdir" mailbox itself. one mailbox in, one mailbox out. simple. periodt. πŸ’–
  • -s sourcedir β€” a directory, relative to the user's home directory, which is where the "somefolders" directories live. OR if the directory starts with a / or . it gets taken as an absolute path, e.g. /mnt/oldmail/user _OR_ it can be a single mbox file which will be converted into the destdir. so many options, she contains multitudes 🌈
  • -R β€” if defined, she does not skip directories found in a mailbox directory, but runs recursively into each of them, creating all the wanted folders in Maildir. go deep bestie. 🧚
Incompatible with -f β€” pick a lane, queen πŸ’…
  • -f somefolder β€” directories, relative to "sourcedir", where the Mbox files are. all mailboxes in the "sourcedir" directory get converted and placed in the "destdir" directory. (typically the Inbox directory, which in this instance is also functioning as a folder for other mailboxes. she's doing double duty πŸ’–)

the "somefolder" directory name gets encoded into the new mailboxes' names. see the example in the USAGE file (see below) πŸ‘‡

this does not save an UW IMAP dummy message file at the start of the Mbox file. small changes in the code could adapt it for looking for other distinctive patterns of dummy messages too. (noted! πŸ“)

Don't let the source directory you give as "somefolders" contain any "."s in its name β€” unless you want to create subfolders from the IMAP user's point of view. see the example in the USAGE file (see below). πŸ‘€

Incompatible with -R 🫢
  • -d destdir β€” the directory where the Maildir format directories get created. if you don't give it, the destination defaults to ~/Maildir. typically this is what the IMAP server sees as the Inbox and the folder for all user mailboxes. if it begins with a / the path is considered absolute, otherwise it's relative to the user's home directory. choose your own adventure ✨
  • -r strip_extension β€” if defined, this extension gets stripped from the original mailbox file name before creating the corresponding maildir. the extension must be given without the leading dot ("."). see the example in the USAGE file (see below). πŸŽ€
  • -l UW-file β€” a file containing the list of subscribed folders. if you're migrating from UW-IMAP, the list of subscribed folders lives in the file called .mailboxlist in the user's home directory.

this converts all subscribed folders for a single user:

/bin/mb2md -s mail -l .mailboxlist -R -d Maildir

and for all users in a directory as root you can do the following:

for i in *; do echo $i;su - $i -c "/bin/mb2md -s mail -l
.mailboxlist -R -d Maildir";done

slay πŸ’…πŸ”₯


✨ USAGE ✨

please please please read the USAGE documentation, bestie:

zless /usr/share/doc/mb2md/USAGE.gz

it's giving required reading πŸ“š


✨ AUTHOR ✨

this manual page was written by NoΓ¨l KΓΆthe noel@debian.org for the Debian system (but may be used by others πŸ’–).

permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. legalese but make it cute, we love a permissive license πŸ‘‘


and that's the whole page, bestie β€” straight out of the General Commands Manual, section 1, footer stamp reading MB2MD(1), no date on it because she's timeless like that. βœ¨πŸ’–

πŸ“¦ where this page comes from