Created
January 4, 2015 22:41
-
-
Save dlangille/9dacd1ab7933b67702bf to your computer and use it in GitHub Desktop.
Mail recovery solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In a recent blog post, I showed how I copy mail off to another location which it is archived, mbox fashion. | |
see http://dan.langille.org/2013/10/19/using-mbox-for-mail-backup/ | |
What I didn't do at the time was come up with a recovery method. Today, I found one. | |
First, determine what messages need to be added to your restored Maildir. Copy those files to the IMAP server. | |
Then run this command: | |
cat mbox.backup | formail -ds sh -c 'cat |/usr/local/bin/maildrop -d ${USER}' | |
My IMAP server uses maildrop for the final delivery: | |
$ cat ~/.forward | |
"|/usr/local/bin/maildrop -d ${USER}" | |
The above command takes the mbox backup and reinjects it as if it was just being delivered gain. NOTE: the headers you see within the email will match those of the backup site, not the primary site. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment