diff options
author | Jonas Smedegaard <dr@jones.dk> | 2005-07-30 12:20:47 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2005-07-30 12:20:47 +0000 |
commit | 631a976c95c5530e209896bede62f7ccc6361ea8 (patch) | |
tree | 47c715fc0d7ff5c23d7b5dc91ea787c69b9c94fa | |
parent | 652b170393f64d27eea1abbce46c176ae3b13766 (diff) |
Major overhaul of this tiny command: Should actually be useful now.
-rwxr-xr-x | localmb2md | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -2,19 +2,29 @@ set -e -test -f /usr/bin/mb2md +if [ ! -f /usr/bin/mb2md ]; then + echo 'ERROR: mb2md not installed!' + exit 1 +fi -test ! -f ~/.procmailrc +if [ -f ~/.procmailrc ]; then + echo 'ERROR: ~/.procmailrc exists - must be handled manually...!' + exit 1 +fi echo 'DEFAULT=$HOME/Maildir/' > ~/.procmailrc -#FIXME: check spool file lock before reading the spool file +# Convert secondary mailboxes first +# (reduces risk of clashing with new incoming mail) +mv ~/mail ~/mail.abandoned +mb2md -s mail.abandoned -if [ -f "/var/mail/$user" ]; then - mb2md -s mail -m - echo '' > "/var/mail/$user" +#FIXME: check spool file lock before reading the spool file +if [ -f "/var/mail/$USER" ]; then + mb2md -m + echo -n '' > "/var/mail/$USER" fi -mb2md -s mail - -mv ~/.mailboxlist ~/Maildir/.subscriptions +if [ -f ~/.mailboxlist ]; then + mv ~/.mailboxlist ~/Maildir/.subscriptions +fi |