SYNOPSIS
offlineimap [ -1 ] [ -P profiledir ] [ -a accountlist ] [ -c configfile
- ] [ -d debugtype[,...] ] [ -o ] [ -u interface ]
+ ] [ -d debugtype[,...] ] [ -l filename ] [ -o ] [ -u interface ]
offlineimap -h | --help
responsible if this turns out to be wrong.
METHOD OF OPERATION
- OfflineIMAP operates by maintaining a hierarchy of mail folders in
- Maildir format locally. Your own mail reader will read mail from this
- tree, and need never know that the mail comes from IMAP. OfflineIMAP
- will detect changes to the mail folders on your IMAP server and your
- own computer and bi-directionally synchronize them, copying, marking,
- and deleting messages as necessary.
+ OfflineIMAP traditionally operates by maintaining a hierarchy of mail
+ folders in Maildir format locally. Your own mail reader will read mail
+ from this tree, and need never know that the mail comes from IMAP.
+ OfflineIMAP will detect changes to the mail folders on your IMAP server
+ and your own computer and bi-directionally synchronize them, copying,
+ marking, and deleting messages as necessary.
+
+ With OfflineIMAP 4.0, a powerful new ability has been introduced -- the
+ program can now synchronize two IMAP servers with each other, with no
+ need to have a Maildir layer in-between. Many people use this if they
+ use a mail reader on their local machine that does not support
+ Maildirs. People may install an IMAP server on their local machine,
+ and point both OfflineIMAP and their mail reader of choice at it. This
+ is often preferable to the mail reader's own IMAP support since
+ OfflineIMAP supports many features (offline reading, for one) that most
+ IMAP-aware readers don't. However, this feature is not as time-tested
+ as traditional syncing, so my advice is to stick with normal methods of
+ operation for the time being.
QUICK START
If you have already installed OfflineIMAP system-wide, or your system
- adminstrator has done that for you, your task for setting up
+ administrator has done that for you, your task for setting up
OfflineIMAP for the first time is quite simple. You just need to set
up your configuration file, make your folder directory, and run it!
[general]
accounts = Test
- [Test]
+ [Account Test]
+ localrepository = Local
+ remoterepository = Remote
+
+ [Repository Local]
+ type = Maildir
localfolders = ~/Test
+
+ [Repository Remote]
+ type = IMAP
remotehost = examplehost
remoteuser = jgoerzen
modern mail readers have this support built-in, so you can choose
from a wide variety of mail servers. This format is also known as
the "qmail" format, so any mail reader compatible with it will work
- with OfflineIMAP.
+ with OfflineIMAP. If you do not have a mail reader that supports
+ Maildir, you can often install a local IMAP server and point both
+ OfflineIMAP and your mail reader at it.
SYSTEM-WIDE INSTALLATION, DEBIAN
If you are tracking Debian unstable, you may install OfflineIMAP by
above and then type ./offlineimap.py; there is no installation step
necessary.
-CONFIGRUATION
+CONFIGURATION
OfflineIMAP is regulated by a configuration file that is normally
stored in ~/.offlineimaprc. OfflineIMAP ships with a file named
offlineimap.conf that you should copy to that location and then edit.
the results more sensible.
-d requires one or more debugtypes, separated by commas. These
- define what exactly will be debugged, and include two options:
- imap and maildir. The imap option will enable IMAP protocol
- stream and parsing debugging. Note that the output may contain
- passwords, so take care to remove that from the debugging output
- before sending it to anyone else. The maildir option will
- enable debugging for certain Maildir operations.
+ define what exactly will be debugged, and include three options:
+ imap, maildir, and thread. The imap option will enable IMAP
+ protocol stream and parsing debugging. Note that the output may
+ contain passwords, so take care to remove that from the debug-
+ ging output before sending it to anyone else. The maildir
+ option will enable debugging for certain Maildir operations.
+ And thread will debug the threading model.
+
+ -l filename
+ Enables logging to filename. This will log everything that goes
+ to the screen to the specified file. Additionally, if any
+ debugging is specified with -d, then debug messages will not go
+ to the screen, but instead to the logfile only.
-o Run only once, ignoring all autorefresh settings in the configu-
ration file.
-u interface
Specifies an alternative user interface module to use. This
- overrides the defailt specified in the configuration file. The
+ overrides the default specified in the configuration file. The
pre-defined options are listed in the User Interfaces section.
USER INTERFACES
Blue is the color of a message synchronization controller thread.
- Orange indicates that an actual message is being copied. (We use
- fuschia for fake messages.)
+ Orange indicates that an actual message is being copied. (We use fuch-
+ sia for fake messages.)
Red (meaning 2)
indicates that a message is being deleted.
accounts = Personal, Work
- Make sure that you have both a [Personal] and a [Work] section, each
- with different localfolder path names. Also, make sure to enable
- [mbnames].
+ Make sure that you have both an [Account Personal] and an [Account
+ Work] section. The local repository for each account must have differ-
+ ent localfolder path names. Also, make sure to enable [mbnames].
- In each account section, write something like this:
+ In each local repository section, write something like this:
localfolders = ~/Mail/Personal
Some users with a UW-IMAPD server need to use OfflineIMAP's "reference"
feature to get at their mailboxes, specifying a reference of "~/Mail"
or "#mh/" depending on the configuration. The below configuration from
- docwhat@gerf.org shows using a reference of Mail, a nametrans that
- strips the leading Mail/ off incoming folder names, and a folderfilter
- that limits the folders synced to just three.
+ (originally from docwhat@gerf.org) shows using a reference of Mail, a
+ nametrans that strips the leading Mail/ off incoming folder names, and
+ a folderfilter that limits the folders synced to just three.
- [Gerf]
+ [Account Gerf]
+ localrepository = GerfLocal
+ remoterepository = GerfRemote
+
+ [Repository GerfLocal]
+ type = Maildir
localfolders = ~/Mail
+
+ [Repository GerfRemote]
+ type = IMAP
remotehost = gerf.org
ssl = yes
remoteuser = docwhat
[general]
pythonfile=~/.offlineimap.py
- [foo]
+ [Repository foo]
foldersort=mycmp
Then, the ~/.offlineimap.py file will contain:
def mycmp(x, y):
for prefix in prioritized:
- if x.startswith(prefix):
- return -1
- elif y.startswith(prefix):
- return +1
+ xsw = x.startswith(prefix)
+ ysw = y.startswith(prefix)
+ if xsw and ysw:
+ return cmp(x, y)
+ elif xsw:
+ return -1
+ elif ysw:
+ return +1
return cmp(x, y)
def test_mycmp():
problem is INBOX, you'd type this:
rm -r ~/Folders/INBOX
- rm -r ~/.offlineimap/AccountName/INBOX
+ rm -r ~/.offlineimap/Account-AccountName
+ rm -r ~/.offlineimap/Repository-RepositoryName
- (Of course, replace AccountName with the account name as specified in
- ~/.offlineimaprc).
+ (Of course, replace AccountName and RepositoryName with the names as
+ specified in ~/.offlineimaprc).
Next time you run OfflineIMAP, it will re-download the folder with the
new UIDs. Note that the procedure specified above will lose any local
it will not actually synchronize it either. (OfflineIMAP will detect
this condition and abort prior to synchronization.)
+ This question comes up frequently on the OfflineIMAP mailing list
+ <URL:http://lists.complete.org/offlineimap@complete.org/>. You can
+ find a detailed discussion <URL:http://lists.com-
+ plete.org/offlineimap@complete.org/2003/04/msg00012.html.gz> of the
+ problem there.
+
OTHER FREQUENTLY ASKED QUESTIONS
There are some other FAQs that might not fit into another section of
the document, so they are discussed here.
without this extra crutch. You'll get the best results if you
don't use this setting, in fact.
+ I've upgraded and now OfflineIMAP crashes when I start it up! Why?
+ You need to upgrade your configuration file. See [XRef to
+ UPGRADING.4.0] at the end of this manual.
+
How do I specify the names of my folders?
- You do not need to. OfflineIMAP is smart enough to automati-
+ You do not need to. OfflineIMAP is smart enough to automati-
cally figure out what folders are present on the IMAP server and
- synchronize them. You can use the folderfilter and foldertrans
+ synchronize them. You can use the folderfilter and foldertrans
configuration file options to request certain folders and rename
them as they come in if you like.
Use the folderfilter option in the configuration file.
How can I add or delete a folder?
- OfflineIMAP does not currently provide this feature, but if you
- create a new folder on the IMAP server, it will be created
+ OfflineIMAP does not currently provide this feature, but if you
+ create a new folder on the IMAP server, it will be created
locally automatically.
Are there any other warnings that I should be aware of?
Yes; see the Notes section below.
What is the mailbox name recorder (mbnames) for?
- Some mail readers, such as Mutt, are not capable of automati-
- cally determining the names of your mailboxes. OfflineIMAP can
- help these programs by writing the names of the folders ni a
+ Some mail readers, such as Mutt, are not capable of automati-
+ cally determining the names of your mailboxes. OfflineIMAP can
+ help these programs by writing the names of the folders in a
format you specify. See the example offlineimap.conf for
details.
Can I synchronize multiple accounts with OfflineIMAP?
- Sure. Just name them all in the accounts line in the general
+ Sure. Just name them all in the accounts line in the general
section of the configuration file, and add a per-account section
for each one.
Does OfflineIMAP support POP?
No. POP is not robust enough to do a completely reliable multi-
- machine synchronization like OfflineIMAP can do. OfflineIMAP
+ machine synchronization like OfflineIMAP can do. OfflineIMAP
will not support it.
Does OfflineIMAP support mailbox formats other than Maildir?
- Not at present. There is no technical reason not to; just no
- demand yet. Maildir is a superior format anyway.
+ Not at present. There is no technical reason not to; just no
+ demand yet. Maildir is a superior format anyway. However,
+ OfflineIMAP can sync between two IMAP servers, and some IMAP
+ servers support other formats. You could install an IMAP server
+ on your local machine and have OfflineIMAP sync to that.
[technical] Why are your Maildir message filenames so huge?
OfflineIMAP has two relevant principles: 1) never modifying your
- messages in any way and 2) ensuring 100% reliable synchroniza-
- tions. In order to do a reliable sync, OfflineIMAP must have a
- way to uniquely identify each e-mail. Three pieces of informa-
- tion are required to do this: your account name, the folder
- name, and the message UID. The account name can be calculated
- from the path in which your messages are. The folder name can
- usually be as well, BUT some mail clients move messages between
- folders by simply moving the file, leaving the name intact.
-
- So, OfflineIMAP must store both a UID folder ID. The folder ID
+ messages in any way and 2) ensuring 100% reliable
+ synchronizations. In order to do a reliable sync, OfflineIMAP
+ must have a way to uniquely identify each e-mail. Three pieces
+ of information are required to do this: your account name, the
+ folder name, and the message UID. The account name can be cal-
+ culated from the path in which your messages are. The folder
+ name can usually be as well, BUT some mail clients move messages
+ between folders by simply moving the file, leaving the name
+ intact.
+
+ So, OfflineIMAP must store both a UID folder ID. The folder ID
is necessary so OfflineIMAP can detect a message moved to a dif-
- ferent folder. OfflineIMAP stores the UID (U= number) and an
+ ferent folder. OfflineIMAP stores the UID (U= number) and an
md5sum of the foldername (FMD5= number) to facilitate this.
What is the speed of OfflineIMAP's sync?
- OfflineIMAP versions 2.0 and above contain a multithreaded sys-
- tem. A good way to experiment is by setting maxsyncaccounts to
+ OfflineIMAP versions 2.0 and above contain a multithreaded sys-
+ tem. A good way to experiment is by setting maxsyncaccounts to
3 and maxconnections to 3 in each account clause.
- This lets OfflineIMAP open up multiple connections simultane-
- ously. That will let it process multiple folders and messages
- at once. In most cases, this will increase performance of the
+ This lets OfflineIMAP open up multiple connections simultane-
+ ously. That will let it process multiple folders and messages
+ at once. In most cases, this will increase performance of the
sync.
- Don't set the number too high. If you do that, things might
- actually slow down as your link gets saturated. Also, too many
- connections can cause mail servers to have excessive load.
+ Don't set the number too high. If you do that, things might
+ actually slow down as your link gets saturated. Also, too many
+ connections can cause mail servers to have excessive load.
Administrators might take unkindly to this, and the server might
- bog down. There are many variables in the optimal setting;
+ bog down. There are many variables in the optimal setting;
experimentation may help.
An informal benchmark yields these results for my setup:
CONFORMING TO
o Internet Message Access Protocol version 4rev1 (IMAP 4rev1) as speci-
- fied in RFC2060
+ fied in RFC2060 and RFC3501
o CRAM-MD5 as specified in RFC2195
- o Maildir as specified in the Maildir manpage
+ o Maildir as specified in the Maildir manpage
<URL:http://www.qmail.org/qmail-manual-html/man5/maildir.html> and
the qmail website <URL:http://cr.yp.to/proto/maildir.html>.
NOTES
DELETING LOCAL FOLDERS
- OfflineIMAP does a two-way synchronization. That is, if you make a
- change to the mail on the server, it will be propogated to your local
+ OfflineIMAP does a two-way synchronization. That is, if you make a
+ change to the mail on the server, it will be propagated to your local
copy, and vise-versa. Some people might think that it would be wise to
- just delete all their local mail folders periodically. If you do this
- with OfflineIMAP, remember to also remove your local status cache
- (~/.offlineimap by default). Otherwise, OfflineIMAP will take this as
+ just delete all their local mail folders periodically. If you do this
+ with OfflineIMAP, remember to also remove your local status cache
+ (~/.offlineimap by default). Otherwise, OfflineIMAP will take this as
an intentional deletion of many messages and will interpret your action
- as requesting them to be deleted from the server as well. (If you
- don't understand this, don't worry; you probably won't encounter this
+ as requesting them to be deleted from the server as well. (If you
+ don't understand this, don't worry; you probably won't encounter this
situation)
MULTIPLE INSTANCES
- OfflineIMAP is not designed to have several instances (for instance, a
- cron job and an interactive invocation) run over the same mailbox
- simultaneously. It will perform a check on startup and abort if
- another OfflineIMAP is already running. If you need to schedule syn-
- chronizations, please use the autorefresh settings rather than cron.
- Alternatively, you can set a separate metadata directory for each
+ OfflineIMAP is not designed to have several instances (for instance, a
+ cron job and an interactive invocation) run over the same mailbox
+ simultaneously. It will perform a check on startup and abort if
+ another OfflineIMAP is already running. If you need to schedule syn-
+ chronizations, please use the autorefresh settings rather than cron.
+ Alternatively, you can set a separate metadata directory for each
instance.
COPYING MESSAGES BETWEEN FOLDERS
- Normally, when you copy a message between folders or add a new message
- to a folder locally, OfflineIMAP will just do the right thing. How-
+ Normally, when you copy a message between folders or add a new message
+ to a folder locally, OfflineIMAP will just do the right thing. How-
ever, sometimes this can be tricky -- if your IMAP server does not pro-
- vide the SEARCH command, or does not return something useful,
- OfflineIMAP cannot determine the new UID of the message. So, in these
- rare instances, OfflineIMAP will upload the message to the IMAP server
- and delete it from your local folder. Then, on your next sync, the
- message will be re-downloaded with the proper UID. OfflineIMAP makes
- sure that the message was properly uploaded before deleting it, so
+ vide the SEARCH command, or does not return something useful,
+ OfflineIMAP cannot determine the new UID of the message. So, in these
+ rare instances, OfflineIMAP will upload the message to the IMAP server
+ and delete it from your local folder. Then, on your next sync, the
+ message will be re-downloaded with the proper UID. OfflineIMAP makes
+ sure that the message was properly uploaded before deleting it, so
there should be no risk of data loss.
USE WITH EVOLUTION
- OfflineIMAP can work with Evolution. To do so, first configure your
- OfflineIMAP account to have sep = / in its configuration. Then, con-
- figure Evolution with the "Maildir-format mail directories" server
+ OfflineIMAP can work with Evolution. To do so, first configure your
+ OfflineIMAP account to have sep = / in its configuration. Then, con-
+ figure Evolution with the "Maildir-format mail directories" server
type. For the path, you will need to specify the name of the top-level
folder inside your OfflineIMAP storage location. You're now set!
USE WITH KMAIL
- At this time, I believe that OfflineIMAP is not compatible with KMail.
- KMail cannot work in any mode other than to move all messages out of
- all folders immediately, which (besides being annoying and fundamen-
- tally broken) is incompatible with OfflineIMAP.
+ At this time, I believe that OfflineIMAP with Maildirs is not compati-
+ ble with KMail. KMail cannot work in any mode other than to move all
+ messages out of all folders immediately, which (besides being annoying
+ and fundamentally broken) is incompatible with OfflineIMAP.
+
+ However, I have made KMail version 3 work well with OfflineIMAP by
+ installing an IMAP server on my local machine, having OfflineIMAP sync
+ to that, and pointing KMail at the same server.
MAILING LIST
There is an OfflineIMAP mailing list available. To subscribe, send the
- text "Subscribe" in the subject of a mail to offlineimap-request@com-
- plete.org. To post, send the message to offlineimap@complete.org.
+ text "Subscribe" in the subject of a mail to offlineimap-request@com-
+ plete.org. To post, send the message to offlineimap@complete.org.
+ Archives are available at
+ <URL:http://lists.complete.org/offlineimap@complete.org/>.
BUGS
Reports of bugs should be sent via e-mail to the OfflineIMAP bug-track-
The Web site also lists all current bugs, where you can check their
status or contribute to fixing them.
+UPGRADING TO 4.0
+ If you are upgrading from a version of OfflineIMAP prior to 3.99.12,
+ you will find that you will get errors when OfflineIMAP starts up
+ (relating to ConfigParser or AccountHashGenerator) and the configura-
+ tion file. This is because the config file format had to change to
+ accommodate new features in 4.0. Fortunately, it's not difficult to
+ adjust it to suit.
+
+ First thing you need to do is stop any running OfflineIMAP instance,
+ making sure first that it's synced all your mail. Then, modify your
+ ~/.offlineimaprc file. You'll need to split up each account section
+ (make sure that it now starts with "Account ") into two Repository sec-
+ tions (one for the local side and another for the remote side.) See
+ the files offlineimap.conf.minimal and offlineimap.conf in the distri-
+ bution if you need more assistance.
+
+ OfflineIMAP's status directory area has also changed. Therefore, you
+ should delete everything in ~/.offlineimap as well as your local mail
+ folders.
+
+ When you start up OfflineIMAP 4.0, it will re-download all your mail
+ from the server and then you can continue using it like normal.
+
COPYRIGHT
OfflineIMAP, and this manual, are Copyright (C) 2002, 2003 John
Goerzen.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
- Free Software Foundation; version 2 of the License.
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MER-
- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- imaplib.py comes from the Python dev tree and is licensed under the
- GPL-compatible PSF license as stated in the file COPYRIGHT in the
+ imaplib.py comes from the Python dev tree and is licensed under the
+ GPL-compatible PSF license as stated in the file COPYRIGHT in the
OfflineIMAP distribution.
AUTHOR
- OfflineIMAP, its libraries, documentation, and all included files,
+ OfflineIMAP, its libraries, documentation, and all included files,
except where noted, was written by John Goerzen <jgoerzen@complete.org>
and copyright is held as stated in the COPYRIGHT section.
OfflineIMAP may be downloaded, and information found, from its homepage
- via either Gopher <URL:gopher://quux.org/1/devel/offlineimap> or HTTP
+ via either Gopher <URL:gopher://quux.org/1/devel/offlineimap> or HTTP
<URL:http://quux.org/devel/offlineimap>.
OfflineIMAP may also be downloaded using Subversion. Additionally, the
- distributed tar.gz may be updated with a simple "svn update" command;
+ distributed tar.gz may be updated with a simple "svn update" command;
it is ready to go. For information on getting OfflineIMAP with Subver-
- sion, please visit the complete.org Subversion page
+ sion, please visit the complete.org Subversion page
<URL:http://svn.complete.org/>.
SEE ALSO
mutt(1), python(1)
+HISTORY
+ Detailed history may be found in the file ChangeLog in the OfflineIMAP
+ distribution. Feature and bug histories may be found in the file
+ debian/changelog which, despite its name, is not really Debian-spe-
+ cific. This section provides a large overview.
+
+ Development on OfflineIMAP began on June 18, 2002. Version 1.0.0 was
+ released three days later on June 21, 2002. Point releases followed,
+ including speed optimizations and some compatibility fixes.
+
+ Version 2.0.0 was released on July 3, 2002, and represented the first
+ time the synchronization became multithreaded and, to the best of my
+ knowledge, the first multithreaded IMAP syncrhonizing application in
+ existance. The last 2.0.x release, 2.0.8, was made on July 9.
+
+ Version 3.0.0 was released on July 11, 2002, and introduced modular
+ user interfaces and the first GUI interface for OfflineIMAP. This man-
+ ual also was introduced with 3.0.0, along with many command-line
+ options. Version 3.1.0 was released on July 21, adding the Noninterac-
+ tive user interfaces, profiling support, and several bugfixes. 3.2.0
+ was released on July 24, adding support for the Blinkenlights GUI
+ interface. OfflineIMAP entered maintenance mode for awhile, as it had
+ reached a feature-complete milestone in my mind.
+
+ The 3.99.x branch began in on October 7, 2002, to begin work for 4.0.
+ The Curses.Blinkenlights interface was added in 3.99.6, and many archi-
+ tectural changes were made.
+
+ 4.0.0 was released on July 18, 2003, including the ability to synchro-
+ nize directly between two IMAP servers, the first re-architecting of
+ the configuration file to refine the notion of an account, and the new
+ Curses interface.
+
-John Goerzen 04 March 2003 OFFLINEIMAP(1)
+John Goerzen 04 June 2004 OFFLINEIMAP(1)