summaryrefslogtreecommitdiff
path: root/localmb2md
blob: 421547f07d0ff32abb0e31d628abb68804ad7e7c (plain)
  1. #!/bin/sh
  2. set -e
  3. if [ ! -f /usr/bin/mb2md ]; then
  4. echo 'ERROR: mb2md not installed!'
  5. exit 1
  6. fi
  7. if [ -f ~/.procmailrc ]; then
  8. echo 'ERROR: ~/.procmailrc exists - must be handled manually...!'
  9. exit 1
  10. fi
  11. echo 'DEFAULT=$HOME/Maildir/' > ~/.procmailrc
  12. # Convert secondary mailboxes first
  13. # (reduces risk of clashing with new incoming mail)
  14. mv ~/mail ~/mail.abandoned
  15. mb2md -s mail.abandoned
  16. #FIXME: check spool file lock before reading the spool file
  17. if [ -f "/var/mail/$USER" ]; then
  18. mb2md -m
  19. echo -n '' > "/var/mail/$USER"
  20. fi
  21. if [ -f ~/.mailboxlist ]; then
  22. mv ~/.mailboxlist ~/Maildir/.subscriptions
  23. fi