Fast Convenient Mail for Travel: OfflineIMAP

Linux laptop users, try the mail solution that combines the advantages of fast local mail folders and a server-based IMAP repository.
Boosting Performance

OfflineIMAP's defaults, as illustrated with the examples above, are quite conservative. It tries to work with as many IMAP servers as possible right out of the box, so the advanced features that occasionally cause trouble are disabled by default.

If you have many mail folders or get a lot of mail in each folder, the synchronization process can be slow. This is especially true if you are using a high-latency Internet connection, such as a modem or satellite. To speed things up, OfflineIMAP is capable of establishing multiple connections to your server at once. It then is able to perform tasks in parallel. For instance, OfflineIMAP might download three messages and synchronize two folders simultaneously.

OfflineIMAP offers several configuration options. First, you should add a line such as maxsyncaccounts = 5 to your general section. This enables OfflineIMAP to synchronize multiple accounts simultaneously, which is almost always a good thing. Second, in the repository section for the remote part of each account, you can control how much parallelism to use. For instance, you might add a line saying maxconnections = 3 to the MyMailRemote repository section in our example. This allows OfflineIMAP to establish up to three connections to the server.

If you are performing continuous syncs with the autorefresh option described above, there's another source for delay. Each time OfflineIMAP starts syncing an account, it connects to the server. When it's done with that particular sync, it disconnects. Establishing these connections can be slow in many cases. OfflineIMAP provides an option to keep the connections open even between syncs. The problem is that some servers disconnect clients that are idle for a long time. To combat that problem, OfflineIMAP also can send little bits of traffic every so often to make sure the timers don't expire. To take advantage of these features, add lines like these to the remote repository section:

holdconnectionopen = true
keepalive = 60

Keepalive is given in seconds, whereas autorefresh is given in minutes.

User Interfaces

OfflineIMAP ships with many different user interfaces. The two most common are Tk.Blinkenlights and Curses.Blinkenlights. The former presents a small graphical window on OfflineIMAP's progress on your X desktop. The latter runs in a terminal and provides a nice monitor of progress (see Figures 1 and 2).

Figure 1. The Tk.Blinkenlights GUI Interface for OfflineIMAP

Figure 2. The Curses.Blinkenlights Interface, Running in a Terminal Window

With the Tk.Blinkenlights interface, you can click on the Sync immediately button to force the account to synchronize right away. You can do the same thing in the Curses.Blinkenlights interface by pressing the number next to the account name. Both interfaces display a log of current activities. You also get a mesmerizing display of flashing status lights so you won't get bored while watching the synchronization happen.

The TTY.TTYUI interface can run without any Curses support—it uses no color or terminal controls. It can read password input, but it provides no other capabilities for interaction.

Noninteractive.Basic is a user interface designed never to receive any input from the user. It can, however, display status messages. If you need a password in order to log in to a remote server, add a line such as remotepass = mypassword to the remote repository section of the configuration file.

Finally, Noninteractive.Quiet goes one step further and does not output status messages. Some people like to run OfflineIMAP from a cron job, and Noninteractive.Quiet is good for that.

You can specify which user interface should be used in one of two ways. First, you can use the -u option on the OfflineIMAP command line. For instance, you might run offlineimap -u Curses.Blinkenlights. Alternatively, you can add a ui line to your general section, like this:

ui = Tk.Blinkenlights, Curses.Blinkenlights,

With this configuration, OfflineIMAP first tries the Tk.Blinkenlights interface. If your Python doesn't support Tk, or if you are not running under X, it then tries the Curses.Blinkenlights interface. If that too fails, the TTY.TTYUI interface is tried. If even that does not work, OfflineIMAP aborts with an error.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Gurkha Encounters's picture

I guess there is booming the Performance and method for travel and tourism

Thank you


Suba Sagar Malla's picture

I guess there would be such fast methods for Travel as well.

subscribed folders

Anonymous's picture

I am curious if OfflineIMAP can be set to only synchronize IMAP folders which are marked as subscribed. While reading the section marked "Selecting Folders" it seemed natural to have an option regarding IMAP subscriptions, which could, in most cases, circumvent the need for writing a special callback function in python.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState