Fast Convenient Mail for Travel: OfflineIMAP
E-mail is for many people the single-most important feature of the Internet. We read e-mail at home, at work, while traveling and on many different computers. But it's difficult to see the same mail from all of those places. If you delete a message from home, it may not show up as deleted when you look at the same account from work. Worse, you might be able to view a given message on only one machine. And if you sometimes want to download mail to your laptop and read it without any Internet connection, things get even more complex.
Some people try to solve these problems by using IMAP in their mail clients. But IMAP can be slow and poorly supported; especially on a slow connection, it tends to make mail reading unpleasant. I recently faced exactly this situation—I was a very annoyed programmer. Many programs come about because a programmer somewhere was annoyed. Thus, I wrote OfflineIMAP.
OfflineIMAP is designed to let you read the same mailbox from many different computers, with or without an active Internet connection. It performs a bi-directional sync, which means that any changes you make eventually are reflected on all your machines. In its most common form, OfflineIMAP works by connecting to an IMAP server and synchronizing your folders to a series of Maildir folders on your local machine. Despite its name, OfflineIMAP is useful even if you never read mail off-line.
OfflineIMAP installation is easy. Visit the OfflineIMAP home page at quux.org/devel/offlineimap, and download the .deb or the tar.gz file. Debian users simply can run dpkg -i offlineimap.deb to install it, and then use apt-get -f install to fix any missing dependencies. If you're not running Debian, make sure you have Python 2.2 or above installed. If you do not have Python already, check with your distribution or visit www.python.org to download it.
When you're ready to install OfflineIMAP, run tar -zxvf offlineimap_4.0.2.tar.gz to unpack the source. Change into the new directory and then, as root, run python setup.py install. If you get stuck, the OfflineIMAP manual contains some more installation hints.
OfflineIMAP configuration is done in the ~/.offlineimaprc file. That file has three different sections: general, which controls overall behavior of OfflineIMAP; repository, which describes a place where mail is stored; and account, which describes how two repositories are synchronized together. A basic, simple setup requires only a small configuration file. Here is an example:
[general] accounts = MyMail [Account MyMail] localrepository = MyMailLocal remoterepository = MyMailRemote [Repository MyMailLocal] type = Maildir localfolders = ~/MyMail [Repository MyMailRemote] type = IMAP remotehost = hostname.example.com remoteuser = my-username-goes-here ssl = yes
This example defines one account, MyMail. The MyMail account is synchronized from the hostname.example.com server to the ~/MyMail directory on your local machine. All remote folders are copied. If your IMAP provider does not support SSL encryption, delete the ssl = yes line. Now, run offlineimap. You are asked for your password, and then it synchronizes your mailboxes once and exits.
If you're connected to the Internet while you read your mail, you can have OfflineIMAP continually keep your local tree synced up with the server. To do this, simply add an autorefresh line to your account section. For instance, you might modify your account section to look like this:
[Account MyMail] localrepository = MyMailLocal remoterepository = MyMailRemote autorefresh = 5
When you run OfflineIMAP now, it synchronizes your mailbox like before. But when it's done, instead of exiting, it keeps running, synchronizing your mail every five minutes.
OfflineIMAP is quite capable of synchronizing multiple accounts. For instance, you might want to be able to read mail from both your work e-mail and your home e-mail. To do this, add one account and two repository sections for each account, making sure to use unique names. Then, add the account to the accounts list in the general section. Separate the names by commas.
On the local side, you should make sure that each account synchronizes into a different directory. Otherwise, confusion and corruption may occur.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- The Qt Company's Qt Start-Up
- Devuan Beta Release
- May 2016 Issue of Linux Journal
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- The Humble Hacker?
- The Death of RoboVM
- BitTorrent Inc.'s Sync
- New Container Image Standard Promises More Portable Apps
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide