Have to again up e-mail? Contemplate skipping the difficult GUI backup instruments, and going with IMAP Grab as a substitute.

SPOILER ALERT: Scroll down and watch the video tutorial on the finish of this text.

Verify Python Model

IMAP Grab is a Python script out there on Github that permits customers to instantly “grab” IMAP mail to archive it later. To use this script, you’ll want to put in Python 2.3.3 or later. To see in case you have the proper model of Python in your Linux PC, open up a terminal and run a model examine.

python --version

So long as it returns Python 2.3.3 or increased, you’re good to go. In the event you don’t have the required model of Python, contemplate updating your Linux PC’s packages.

Obtain IMAP Grab

When Python is taken care of, use the Git device to clone the most recent model of the IMAP Grab device.

Notice: this a part of the tutorial requires the Git package deal. To set up it, seek for “git” and set up it.

git clone 

Utilizing the CD command, transfer the terminal into the brand new “IMAPbackup” listing.

cd IMAPbackup

The script is in your PC, however it’s not going to work with out the “Getmail” dependency.

Ubuntu

sudo apt set up getmail

Debian

sudo apt-get set up getmail

Arch Linux

sudo pacman -S getmail

Fedora

sudo dnf set up getmail

OpenSUSE

sudo zypper set up getmail

Utilizing IMAP Grab

9k=

Earlier than we will again up e-mail, we’ll want to make use of IMAP Grab to listing all out there mailboxes inside the e-mail account. To do that, fill out this command. There are a number of facets to this command. Within the instance, we’ve written out “test” URLs, customers and passwords. Change the command following these steps.

First, change the server after -s to the IMAP server your e-mail account makes use of. Not positive what the server deal with is? Guess by taking the root area, and add “imap” in entrance of it. For instance, Mail.com has an IMAP deal with of imap.mail.com. If that doesn’t work, you’ll be able to all the time Google this info.

Subsequent, change the take a look at consumer after -u to your e-mail deal with, and add your e-mail account’s password after -p.

python imapgrab.py imapgrab.py -l -s imap.take a look at.com -u testuser@take a look at.com -p emailpassword

Run this command within the terminal, and the script will print out all out there mailboxes.

Back Up Email

IMAP Grab can obtain e-mail from any Mailbox folder. To obtain, first, create a listing the place your e-mail will obtain.

mkdir ~/email-backups

Then, use IMAP Grab to obtain every part. Like earlier than, make sure you change -s-u, and -p with the proper info.

python imapgrab.py -d -v -M -f ~/email-backups -s imap.take a look at.com -u take a look at@take a look at.com -p emailpassword -m "_ALL_"

Maintaining “_ALL_” after the -m possibility within the command will inform the script to obtain completely every part in your e-mail account. Most customers ought to use “_ALL_”, particularly should you don’t perceive the script’s syntax. One other good motive to stay with this selection is should you’ve received a whole lot of folders, and also you don’t wish to spend hours specifying every part within the command.

Notice: To obtain solely a selected folder from an e-mail account with IMAP Grab, change “_ALL_” with a number of the inbox folder names that the script lists within the earlier part.

Encrypt Email Backup

Downloading your e-mail to again it up is a superb concept, particularly if you wish to all the time have a file of it offline. Sadly, these downloads are usually not non-public, and anybody can simply learn your private messages in the event that they get entry to your PC. In the event you’d wish to create an encrypted archive of your e-mail backup, observe these steps. First, use tar to create an archive of the e-mail backup folder.

tar -jcvf email-backup.tar.bz2 email-backups

Relying on the scale of your ~/email-backups folder, compression could take a little bit of time. Let the compression device run, and shortly after you’ll have a brand new archive with all of your messages in it. From right here, use the GnuPG device to begin the encryption.

gpg -c email-backup.tar.bz2

Operating gpg -c will immediate the consumer to set a password for the brand new encryption archive. Use a safe password that’s memorable.  Encryption, like creating the archive, takes time to finish and the bigger your backup is, the longer it would take to encrypt it. When the GPG encryption course of finishes, you’ll discover an email-backup.tar.bz2.gpg file. That is the locked archive. No one will be capable of entry this file with out the passcode you entered. It’s fully safe, so be happy to take email-backup.tar.bz2.gpg and add it to Dropbox, Google Drive, residence servers and and so forth.

Now that the backup archive is locked with GPG, we have now no want for the unencrypted archive. Utilizing the rm device, delete it.

rm email-backup.tar.bz2

Decrypt Email

So, you’ve used GPG to lock up and safe your e-mail backup. How do you decrypt it? Easy! Open up a terminal, and use the GPG decrypt command to unlock the archive.

gpg email-backup.tar.bz2.gpg

When the decryption command runs, you’ll must enter the password you set. When you do, email-backup.tar.bz2 will seem. At this level, you’ll be capable of use the tar command to extract the emails from the archive.

tar -xvf email-backup.tar.bz2



Source link

Share.
Leave A Reply

Exit mobile version