chiark / gitweb /
ubuntu-paste: convert to python3/argparse/requests
[bin.git] / mbox2maildir
1 #! /bin/sh -e
2
3 if [ -z "$1" ] || [ "x$1" = "x--help" ]; then
4     echo "Usage: $0 <mbox>" >&2
5     exit 1
6 fi
7
8 mbox="$1"
9 if [ "${mbox#/}" = "$mbox" ]; then
10     # mb2md has stupid semantics for relative paths.
11     mbox="$(pwd)/$mbox"
12 fi
13
14 #maildirmake.dovecot "$1.maildir"
15 #perfect-maildir "$1.maildir" < "$1"
16 mb2md -s "$mbox" -d "$mbox.maildir"
17 mv "$1" "$1.mbox"
18 mv "$1.maildir" "$1"
19
20 echo "$1 converted to maildir and preserved as $1.mbox"
21
22 exit 0