Skip to content

Instantly share code, notes, and snippets.

@noah
Created August 18, 2014 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noah/aa831ae7692c389b0274 to your computer and use it in GitHub Desktop.
Save noah/aa831ae7692c389b0274 to your computer and use it in GitHub Desktop.
delete remote imap folders (offlineimap)
% cat $(which rmmail)
#!/bin/bash
if [ $# -ne 1 ]; then
echo "usage: $(basename $0) foldername"
exit
fi
if [ -n "$1" ]; then
maildir=~/mail/noah*@*.com/"$1"
if [ -d "$maildir" ]; then
rm -rfv ~/.offlineimap/Repository-*/FolderValidity/"$1"
rm -rfv "$maildir"
echo "WARN: You must delete $1 from remote, then run offlineimap sync."
else
echo "$maildir does not exist; aborting"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment