]> code.delx.au - offlineimap/blob - offlineimap.sgml
Updated homepage, refs #1
[offlineimap] / offlineimap.sgml
1 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2 <!ENTITY OfflineIMAP "<application>OfflineIMAP</application>">
3 ]>
4 <!-- "file:///usr/share/sgml/docbook/dtd/xml/4.2/docbookx.dtd"> -->
5
6 <reference>
7 <title>OfflineIMAP Manual</title>
8
9 <refentry>
10 <refentryinfo>
11 <address><email>jgoerzen@complete.org</email></address>
12 <author><firstname>John</firstname><surname>Goerzen</surname></author>
13 </refentryinfo>
14
15 <refmeta>
16 <refentrytitle>offlineimap</refentrytitle>
17 <manvolnum>1</manvolnum>
18 <refmiscinfo>John Goerzen</refmiscinfo>
19 </refmeta>
20
21 <refnamediv>
22 <refname>OfflineIMAP</refname>
23 <refpurpose>Powerful IMAP/Maildir synchronization
24 and reader support</refpurpose>
25 </refnamediv>
26
27 <refsynopsisdiv>
28 <cmdsynopsis>
29 <command>offlineimap</command>
30 <arg>-1</arg>
31 <arg>-P <replaceable>profiledir</replaceable></arg>
32 <arg>-a <replaceable>accountlist</replaceable></arg>
33 <arg>-c <replaceable>configfile</replaceable></arg>
34 <arg>-d <replaceable>debugtype[,...]</replaceable></arg>
35 <arg>-l <replaceable>filename</replaceable></arg>
36 <arg>-o</arg>
37 <arg>-u <replaceable>interface</replaceable></arg>
38 </cmdsynopsis>
39 <cmdsynopsis>
40 <command>offlineimap</command>
41 <group choice="plain"><arg>-h</arg><arg>--help</arg></group>
42 </cmdsynopsis>
43 </refsynopsisdiv>
44
45 <refsect1>
46 <title>Description</title>
47
48 <para>&OfflineIMAP; is a tool to simplify your e-mail
49 reading. With &OfflineIMAP;, you can read the same mailbox
50 from multiple computers. You get a current copy of your
51 messages on each computer, and changes you make one place will be
52 visible on all other systems. For instance, you can delete a message
53 on your home computer, and it will appear deleted on your work
54 computer as well. &OfflineIMAP; is also useful if you want to
55 use a mail reader that does not have IMAP support, has poor IMAP
56 support, or does not provide disconnected operation.
57 </para>
58
59 <para>&OfflineIMAP; is <emphasis>FAST</emphasis>; it synchronizes
60 my two accounts with over 50 folders in 3 seconds. Other
61 similar tools might take over a minute, and achieve a
62 less-reliable result. Some mail readers can take over 10
63 minutes to do the same thing, and some don't even support it
64 at all. Unlike other mail tools, &OfflineIMAP; features a
65 multi-threaded synchronization algorithm that can dramatically
66 speed up performance in many situations by synchronizing
67 several different things simultaneously.
68 </para>
69
70 <para>&OfflineIMAP; is <emphasis>FLEXIBLE</emphasis>; you can
71 customize which folders are synced via regular expressions,
72 lists, or Python expressions; a versatile and comprehensive
73 configuration file is used to control behavior; two user
74 interfaces are built-in; fine-tuning of synchronization
75 performance is possible; internal or external automation is
76 supported; SSL and PREAUTH tunnels are both supported; offline
77 (or "unplugged") reading is supported; and esoteric IMAP
78 features are supported to ensure compatibility with the widest
79 variety of IMAP servers.
80 </para>
81
82 <para>&OfflineIMAP; is <emphasis>SAFE</emphasis>; it uses an
83 algorithm designed to prevent mail loss at all costs. Because
84 of the design of this algorithm, even programming errors
85 should not result in loss of mail. I am so confident in the
86 algorithm that I use my own personal and work accounts for
87 testing of &OfflineIMAP; pre-release, development, and beta
88 releases. Of course, legally speaking, &OfflineIMAP; comes
89 with no warranty, so I am not responsible if this turns out
90 to be wrong.
91 </para>
92
93 <refsect2>
94 <title>Method of Operation</title>
95
96 <para>&OfflineIMAP; traditionally
97 operates by maintaining a hierarchy of
98 mail folders in Maildir format locally. Your own mail
99 reader will read mail from this tree, and need never know
100 that the mail comes from IMAP. &OfflineIMAP; will detect
101 changes to the mail folders on your IMAP server and your own
102 computer and bi-directionally synchronize them, copying,
103 marking, and deleting messages as necessary.
104 </para>
105 <para>
106 With &OfflineIMAP; 4.0, a powerful new ability has been
107 introduced -- the program can now synchronize two IMAP
108 servers with each other, with no need to have a Maildir
109 layer in-between. Many people use this if they use a mail
110 reader on their local machine that does not support
111 Maildirs. People may install an IMAP server on their local
112 machine, and point both &OfflineIMAP; and their mail reader
113 of choice at it. This is often preferable to the mail
114 reader's own IMAP support since &OfflineIMAP; supports many
115 features (offline reading, for one) that most IMAP-aware
116 readers don't. However, this feature is not as time-tested
117 as traditional syncing, so my advice is to stick with normal
118 methods of operation for the time being.
119 </para>
120 </refsect2>
121 </refsect1>
122
123 <refsect1>
124 <title>Quick Start</title>
125 <para>If you have already installed &OfflineIMAP; system-wide,
126 or your system administrator has done that for you, your task
127 for setting up &OfflineIMAP; for the first time is quite
128 simple. You just need to set up your configuration file, make
129 your folder directory, and run it!
130 </para>
131
132 <para>You can quickly set up your configuration file. The distribution
133 includes a file <filename>offlineimap.conf.minimal</filename>
134 (Debian users
135 may find this at
136 <filename>/usr/share/doc/offlineimap/examples/offlineimap.conf.minimal</filename>) that is a basic example of setting of &OfflineIMAP;. You can
137 simply copy this file into your home directory and name it
138 <filename>.offlineimaprc</filename> (note the leading period). A
139 command such as <command>cp offlineimap.conf.minimal ~/.offlineimaprc</command> will do it. Or, if you prefer, you can just copy this text to
140 <filename>~/.offlineimaprc</filename>:
141 </para>
142
143 <PROGRAMLISTING>[general]
144 accounts = Test
145
146 [Account Test]
147 localrepository = Local
148 remoterepository = Remote
149
150 [Repository Local]
151 type = Maildir
152 localfolders = ~/Test
153
154 [Repository Remote]
155 type = IMAP
156 remotehost = examplehost
157 remoteuser = jgoerzen
158 </PROGRAMLISTING>
159
160 <para>Now, edit the <filename>~/.offlineimaprc</filename> file with
161 your favorite editor. All you have to do is specify a directory
162 for your folders to be in (on the <property>localfolders</property>
163 line), the host name of your IMAP server (on the
164 <property>remotehost</property> line), and your login name on
165 the remote (on the <property>remoteuser</property> line). That's
166 it!</para>
167
168 <para>To run &OfflineIMAP;, you just have to say
169 <command>offlineimap</command> -- it will fire up, ask you for
170 a login password if necessary, synchronize your folders, and exit.
171 See? You can just throw away the rest of this finely-crafted,
172 perfectly-honed manual! Of course, if you want to see how you can
173 make &OfflineIMAP; FIVE TIMES FASTER FOR JUST $19.95 (err, well,
174 $0), you have to read on!
175 </para>
176
177 </refsect1>
178
179 <refsect1>
180 <title>Installation</title>
181
182 <para>If you are reading this document via the "man" command, it is
183 likely
184 that you have no installation tasks to perform; your system
185 administrator has already installed it. If you need to install it
186 yourself, you have three options: a system-wide installation with
187 Debian, system-wide installation with other systems, and a single-user
188 installation. You can download the latest version of &OfflineIMAP; from
189 <ulink url="http://software.complete.org/offlineimap/">the &OfflineIMAP;
190 website</ulink>.
191 </para>
192
193 <refsect2>
194 <title>Prerequisites</title>
195
196 <para>In order to use &OfflineIMAP;, you need to have these conditions
197 satisfied:
198 </para>
199
200 <itemizedlist>
201 <listitem>
202 <para>Your mail server must support IMAP. Most Internet Service
203 Providers
204 and corporate networks do, and most operating systems
205 have an IMAP
206 implementation readily available.
207 </para>
208 </listitem>
209 <listitem>
210 <para>
211 You must have Python version 2.2.1 or above installed.
212 If you are
213 running on Debian GNU/Linux, this requirement will automatically be
214 taken care of for you. If you do not have Python already, check with
215 your system administrator or operating system vendor; or, download it from
216 <ulink url="http://www.python.org/">the Python website</ulink>.
217 If you intend to use the Tk interface, you must have Tkinter
218 (python-tk) installed. If you intend to use the SSL interface, your
219 Python must have been built with SSL support.
220 </para>
221 </listitem>
222 <listitem>
223 <para>
224 Have a mail reader that supports the Maildir mailbox
225 format. Most modern mail readers have this support
226 built-in, so you can choose from a wide variety of mail
227 servers. This format is also known as the "qmail"
228 format, so any mail reader compatible with it will work
229 with &OfflineIMAP;. If you do not have a mail reader
230 that supports Maildir, you can often install a local
231 IMAP server and point both &OfflineIMAP; and your mail
232 reader at it.
233 </para>
234 </itemizedlist>
235 </refsect2>
236
237 <refsect2>
238 <title>System-Wide Installation, Debian</title>
239 <para>
240 If you are tracking Debian unstable, you may install
241 &OfflineIMAP; by simply running the following command as root:
242 </para>
243 <para>
244 <command>apt-get install offlineimap</command>
245 </para>
246 <para>
247 If you are not tracking Debian unstable, download the Debian .deb
248 package from the <ulink url="http://software.complete.org/offlineimap/">&OfflineIMAP; website</ulink>
249 and then run <command>dpkg -i</command> to install the downloaded
250 package. Then, skip to <xref linkend="configuration" endterm="configuration-title"> below. You will type <command>offlineimap</command> to
251 invoke the program.
252 </para>
253 </refsect2>
254
255 <refsect2>
256 <title>System-Wide Installation, Other</title>
257 <para>
258 Download the tar.gz version of the package from the
259 <ulink url="http://software.complete.org/offlineimap/">website</ulink>.
260 Then run
261 these commands, making sure that you are the "root" user first:
262 </para>
263
264 <ProgramListing>tar -zxvf offlineimap_x.y.z.tar.gz
265 cd offlineimap-x.y.z
266 python2.2 setup.py install</ProgramListing>
267 <para>On some systems, you will need to use
268 <command>python</command> instead of <command>python2.2</command>.
269 Next, proceed to <xref linkend="configuration" endterm="configuration-title"> below. You will type <command>offlineimap</command> to
270 invoke the program.
271 </para>
272 </refsect2>
273
274 <refsect2>
275 <title>Single-Account Installation</title>
276 <para>
277 Download the tar.gz version of the package from the
278 <ulink url="http://software.complete.org/offlineimap/">website</ulink>.
279 Then run these commands:
280 </para>
281
282 <ProgramListing>tar -zxvf offlineimap_x.y.z.tar.gz
283 cd offlineimap-x.y.z</ProgramListing>
284
285 <para>When you want to run &OfflineIMAP;, you will issue the
286 <command>cd</command> command as above and then type
287 <command>./offlineimap.py</command>; there is no installation
288 step necessary.
289 </para>
290 </refsect2>
291 </refsect1>
292
293 <refsect1 id="configuration">
294 <title id="configuration-title">Configuration</title>
295 <para>
296 &OfflineIMAP; is regulated by a configuration file that is normally
297 stored in <filename>~/.offlineimaprc</filename>. &OfflineIMAP;
298 ships with a file named <filename>offlineimap.conf</filename>
299 that you should copy to that location and then edit. This file is
300 vital to proper operation of the system; it sets everything you need
301 to run &OfflineIMAP;. Full documentation for the configuration file
302 is included within the sample file.
303 </para>
304 <para>
305 &OfflineIMAP; also ships a file named
306 <filename>offlineimap.conf.minimal</filename> that you can also try.
307 It's useful if you want to get started with
308 the most basic feature set, and you can read about other features
309 later with <filename>offlineimap.conf</filename>.
310 </para>
311 </refsect1>
312
313 <refsect1>
314 <title>Options</title>
315 <para>
316 Most configuration is done via the configuration file. Nevertheless,
317 there are a few command-line options that you may set for
318 &OfflineIMAP;.
319 </para>
320
321 <variablelist>
322 <varlistentry><term>-1</term>
323 <listitem><para>Disable most multithreading operations and use
324 solely a single-connection
325 sync. This effectively sets the
326 <property>maxsyncaccounts</property>
327 and all <property>maxconnections</property> configuration file
328 variables to 1.
329 </para></listitem>
330 </varlistentry>
331 <varlistentry><term>-P <replaceable>profiledir</replaceable></term>
332 <listitem><para>Sets &OfflineIMAP; into profile mode. The program
333 will create <replaceable>profiledir</replaceable>
334 (it must not already exist). As it runs, Python profiling
335 information
336 about each thread is logged into profiledir. Please note: This option
337 is present for debugging and optimization only, and should NOT be used
338 unless you have a specific reason to do so. It will significantly
339 slow program performance, may reduce reliability, and can generate
340 huge amounts of data. You must use the <option>-1</option> option when
341 you use <option>-P</option>.
342 </para></listitem>
343 </varlistentry>
344 <varlistentry><term>-a <replaceable>accountlist</replaceable></term>
345 <listitem><para>Overrides the <property>accounts</property> option
346 in the <property>general</property> section of the configuration
347 file. You might use this to exclude certain accounts, or to sync
348 some accounts that you normally prefer not to. Separate the
349 accounts by commas, and use no embedded spaces.
350 </para></listitem>
351 </varlistentry>
352 <varlistentry><term>-c <replaceable>configfile</replaceable></term>
353 <listitem><para>Specifies a configuration file to use in lieu of
354 the default, <filename>~/.offlineimaprc</filename>.
355 </para></listitem>
356 </varlistentry>
357 <varlistentry><term>-d <replaceable>debugtype[,...]</replaceable></term>
358 <listitem><para>Enables debugging for OfflineIMAP. This is useful if
359 you are trying to track down a malfunction or figure out what is going
360 on under the hood. I suggest that you use this with
361 <option>-1</option> to make the results more sensible.</para>
362
363 <para><option>-d</option> requires one or more debugtypes,
364 separated by commas. These define what exactly will be
365 debugged, and include three options: <property>imap</property>,
366 <property>maildir</property>, and <property>thread</property>.
367 The <property>imap</property>
368 option will enable IMAP protocol stream and parsing debugging. Note
369 that the output may contain passwords, so take care to remove that
370 from the debugging output before sending it to anyone else. The
371 <property>maildir</property> option will enable debugging for
372 certain Maildir operations. And <property>thread</property>
373 will debug the threading model.
374 </para></listitem>
375 </varlistentry>
376 <varlistentry><term>-l
377 <replaceable>filename</replaceable></term>
378 <listitem><para>
379 Enables logging to filename. This will log everything
380 that goes to the screen to the specified file.
381 Additionally, if any debugging is specified with -d,
382 then debug messages will not go to the screen, but
383 instead to the logfile only.</para>
384 </listitem>
385 </varlistentry>
386 <varlistentry><term>-o</term>
387 <listitem><para>Run only once, ignoring all
388 <property>autorefresh</property> settings in the configuration
389 file.</para>
390 </listitem>
391 </varlistentry>
392 <varlistentry><term>-h</term> <term>--help</term>
393 <listitem><para>Show summary of options.</para></listitem>
394 </varlistentry>
395 <varlistentry><term>-u <replaceable>interface</replaceable></term>
396 <listitem><para>Specifies an alternative user interface module
397 to use. This overrides the default specified in the
398 configuration file. The pre-defined options are listed in
399 the User Interfaces section.</para>
400 </listitem>
401 </varlistentry>
402 </variablelist>
403 </refsect1>
404 <refsect1>
405 <title>User Interfaces</title>
406 <para>&OfflineIMAP; has a pluggable user interface system that lets you choose how the
407 program communicates information to you. There are two graphical
408 interfaces, two terminal interfaces, and two noninteractive interfaces
409 suitable for scripting or logging purposes. The
410 <property>ui</property> option in the configuration file specifies
411 user interface preferences. The <option>-u</option> command-line
412 option can override the configuration file setting. The available
413 values for the configuration file or command-line are described
414 in this section.</para>
415 <refsect2>
416 <title>Tk.Blinkenlights</title>
417 <para>Tk.Blinkenlights is an interface designed to be sleek, fun to watch, and
418 informative of the overall picture of what &OfflineIMAP;
419 is doing. I consider it to be the best general-purpose interface in
420 &OfflineIMAP;.
421 </para>
422 <para>
423 Tk.Blinkenlights contains, by default, a small window with a row of
424 LEDs, a small log, and a row of command buttons.
425 The total size of the window is
426 very small, so it uses little desktop space, yet it is quite
427 functional. The optional, toggleable, log shows more
428 detail about what is happening and is color-coded to match the color
429 of the lights.
430 </para>
431 <para>
432 Tk.Blinkenlights is the only user interface that has configurable
433 parameters; see the example <filename>offlineimap.conf</filename>
434 for more details.
435 </para>
436 <para>
437 Each light in the Blinkenlights interface represents a thread
438 of execution -- that is, a particular task that &OfflineIMAP;
439 is performing right now. The colors indicate what task
440 the particular thread is performing, and are as follows:
441 </para>
442 <variablelist>
443 <varlistentry>
444 <term>Black</term>
445 <listitem><para>indicates that this light's thread has terminated; it will light up
446 again later when new threads start up. So, black indicates no
447 activity.
448 </para></listitem>
449 </varlistentry>
450 <varlistentry>
451 <term>Red (Meaning 1)</term>
452 <listitem><para>is the color of the main program's thread, which basically does
453 nothing but monitor the others. It might remind you of HAL 9000 in
454 <citation>2001</citation>.
455 </para></listitem>
456 </varlistentry>
457 <varlistentry>
458 <term>Gray</term>
459 <listitem><para>indicates that the thread is establishing a new connection to the IMAP
460 server.
461 </para></listitem>
462 </varlistentry>
463 <varlistentry>
464 <term>Purple</term>
465 <listitem><para>is the color of an account synchronization thread that is monitoring
466 the progress of the folders in that account (not generating any I/O).
467 </para></listitem>
468 </varlistentry>
469 <varlistentry>
470 <term>Cyan</term>
471 <listitem><para>indicates that the thread is syncing a folder.
472 </para></listitem>
473 </varlistentry>
474 <varlistentry>
475 <term>Green</term>
476 <listitem><para>means that a folder's message list is being loaded.
477 </para></listitem>
478 </varlistentry>
479 <varlistentry>
480 <term>Blue</term>
481 <listitem><para>is the color of a message synchronization controller thread.
482 </para></listitem>
483 </varlistentry>
484 <varlistentry>
485 <term>Orange</term>
486 <listitem><para>indicates that an actual message is being copied.
487 (We use fuchsia for fake messages.)
488 </para></listitem>
489 </varlistentry>
490 <varlistentry>
491 <term>Red (meaning 2)</term>
492 <listitem><para>indicates that a message is being deleted.
493 </para></listitem>
494 </varlistentry>
495 <varlistentry>
496 <term>Yellow / bright orange</term>
497 <listitem><para>indicates that message flags are being added.
498 </para></listitem>
499 </varlistentry>
500 <varlistentry>
501 <term>Pink / bright red</term>
502 <listitem><para>indicates that message flags are being removed.
503 </para></listitem>
504 </varlistentry>
505 <varlistentry>
506 <term>Red / Black Flashing</term>
507 <listitem><para>corresponds to the countdown timer that runs between
508 synchronizations.
509 </para></listitem>
510 </varlistentry>
511 </variablelist>
512 <para>The name of this interfaces derives from a bit of computer
513 history. Eric Raymond's <citation>Jargon File</citation> defines
514 <firstterm>blinkenlights</firstterm>, in part, as:
515 </para>
516 <blockquote>
517 <para>Front-panel diagnostic
518 lights on a computer, esp. a dinosaur. Now that dinosaurs are rare,
519 this term usually refers to status lights on a modem, network hub, or
520 the like.
521 </para>
522 <para>
523 This term derives from the last word of the famous blackletter-Gothic
524 sign in mangled pseudo-German that once graced about half the computer
525 rooms in the English-speaking world. One version ran in its entirety as
526 follows:
527 </para>
528 <para>
529 <emphasis>ACHTUNG! ALLES LOOKENSPEEPERS!</emphasis>
530 </para>
531 <para>
532 Das computermachine ist nicht fuer gefingerpoken und mittengrabben.
533 Ist easy schnappen der springenwerk, blowenfusen und poppencorken
534 mit spitzensparken. Ist nicht fuer gewerken bei das dumpkopfen.
535 Das rubbernecken sichtseeren keepen das cotten-pickenen hans in das
536 pockets muss; relaxen und watchen das blinkenlichten.
537 </para>
538 </blockquote>
539 </refsect2>
540
541 <refsect2>
542 <title>Curses.Blinkenlights</title>
543 <para>
544 Curses.Blinkenlights is an interface very similar to Tk.Blinkenlights,
545 but is designed to be run in a console window (an xterm, Linux virtual
546 terminal, etc.) Since it doesn't have access to graphics, it isn't
547 quite as pretty, but it still gets the job done.
548 </para>
549 <para>Please see the Tk.Blinkenlights section above for more
550 information about the colors used in this interface.
551 </para>
552 </refsect2>
553
554 <refsect2>
555 <title>Tk.VerboseUI</title>
556 <para>
557 Tk.VerboseUI (formerly known as Tk.TkUI) is a graphical interface
558 that presents a variable-sized window. In the window, each
559 currently-executing thread has a section where its name and current
560 status are displayed. This interface is best suited to people running
561 on slower connections, as you get a lot of detail, but for fast
562 connections, the detail may go by too quickly to be useful. People
563 with fast connections may wish to use Tk.Blinkenlights instead.
564 </para>
565 </refsect2>
566
567 <refsect2>
568 <title>TTY.TTYUI</title>
569 <para>
570 TTY.TTYUI interface is for people running in basic, non-color terminals. It
571 prints out basic status messages and is generally friendly to use on a console
572 or xterm.
573 </para>
574 </refsect2>
575
576 <refsect2>
577 <title>Noninteractive.Basic</title>
578 <para>
579 Noninteractive.Basic is designed for situations in which &OfflineIMAP;
580 will be run non-attended and the status of its execution will be
581 logged. You might use it, for instance, to have the system run
582 automatically and
583 e-mail you the results of the synchronization. This user interface
584 is not capable of reading a password from the keyboard; account
585 passwords must be specified using one of the configuration file options.
586 </para>
587 </refsect2>
588
589 <refsect2>
590 <title>Noninteractive.Quiet</title>
591 <para>
592 Noninteractive.Quiet is designed for non-attended running in situations
593 where normal status messages are not desired. It will output nothing
594 except errors and serious warnings. Like Noninteractive.Basic,
595 this user interface
596 is not capable of reading a password from the keyboard; account
597 passwords must be specified using one of the configuration file options.
598 </para>
599 </refsect2>
600
601 </refsect1>
602
603 <refsect1>
604 <title>Examples</title>
605 <para>Here are some example configurations for various situations.
606 Please e-mail any other examples you have that may be useful to
607 me.
608 </para>
609
610 <refsect2>
611 <title>Multiple Accounts with Mutt</title>
612 <para>
613 This example shows you how to set up &OfflineIMAP; to
614 synchronize multiple accounts with the mutt mail reader.
615 </para>
616 <para>
617 Start by creating a directory to hold your folders by running
618 <command>mkdir ~/Mail</command>. Then, in your
619 <filename>~/.offlineimaprc</filename>, specify:
620 </para>
621 <programlisting>accounts = Personal, Work</programlisting>
622 <para>
623 Make sure that you have both an
624 <property>[Account Personal]</property>
625 and an <property>[Account Work]</property> section. The
626 local repository for each account must have different
627 <property>localfolder</> path names.
628 Also, make sure
629 to enable <property>[mbnames]</property>.
630 </para>
631 <para>
632 In each local repository section, write something like this:
633 </para>
634 <programlisting>localfolders = ~/Mail/Personal</programlisting>
635 <para>
636 Finally, add these lines to your <filename>~/.muttrc</filename>:
637 </para>
638 <programlisting>source ~/path-to-mbnames-muttrc-mailboxes
639 folder-hook Personal set from="youremail@personal.com"
640 folder-hook Work set from="youremail@work.com"
641 set mbox_type=Maildir
642 set folder=$HOME/Mail
643 spoolfile=+Personal/INBOX</programlisting>
644 <para>
645 That's it!
646 </para>
647 </refsect2>
648
649 <refsect2>
650 <title>UW-IMAPD and References</title>
651 <para>Some users with a UW-IMAPD server need to use &OfflineIMAP;'s
652 "reference" feature to get at their mailboxes, specifying a reference
653 of "~/Mail" or "#mh/" depending on the configuration. The below
654 configuration from (originally from docwhat@gerf.org)
655 shows using a <property>reference</property> of Mail, a <property>nametrans</property>
656 that strips
657 the leading Mail/ off incoming folder names, and a
658 <property>folderfilter</property> that
659 limits the folders synced to just three.
660 </para>
661 <programlisting>[Account Gerf]
662 localrepository = GerfLocal
663 remoterepository = GerfRemote
664
665 [Repository GerfLocal]
666 type = Maildir
667 localfolders = ~/Mail
668
669 [Repository GerfRemote]
670 type = IMAP
671 remotehost = gerf.org
672 ssl = yes
673 remoteuser = docwhat
674 reference = Mail
675 # Trims off the preceeding Mail on all the folder names.
676 nametrans = lambda foldername: \
677 re.sub('^Mail/', '', foldername)
678 # Yeah, you have to mention the Mail dir, even though it
679 # would seem intuitive that reference would trim it.
680 folderfilter = lambda foldername: foldername in [
681 'Mail/INBOX',
682 'Mail/list/zaurus-general',
683 'Mail/list/zaurus-dev',
684 ]
685 maxconnections = 1
686 holdconnectionopen = no</programlisting>
687 </refsect2>
688
689 <refsect2>
690 <title>pythonfile Configuration File Option</title>
691 <para>You can have &OfflineIMAP;
692 load up a Python file before evaluating the
693 configuration file options that are Python expressions. This example
694 is based on one supplied by Tommi Virtanen for this feature.
695 </para>
696 <para>
697 In <filename>~/.offlineimap.rc</filename>, he adds these options:
698 </para>
699 <programlisting>[general]
700 pythonfile=~/.offlineimap.py
701 [Repository foo]
702 foldersort=mycmp</programlisting>
703 <para>
704 Then, the <filename>~/.offlineimap.py</filename> file will
705 contain:
706 </para>
707 <programlisting>prioritized = ['INBOX', 'personal', 'announce', 'list']
708
709 def mycmp(x, y):
710 for prefix in prioritized:
711 xsw = x.startswith(prefix)
712 ysw = y.startswith(prefix)
713 if xsw and ysw:
714 return cmp(x, y)
715 elif xsw:
716 return -1
717 elif ysw:
718 return +1
719 return cmp(x, y)
720
721 def test_mycmp():
722 import os, os.path
723 folders=os.listdir(os.path.expanduser('~/data/mail/tv@hq.yok.utu.fi'))
724 folders.sort(mycmp)
725 print folders</programlisting>
726 <para>
727 This code snippet illustrates how the <property>foldersort</property>
728 option can be customized with a Python function from the
729 <property>pythonfile</property> to always synchronize certain
730 folders first.
731 </para>
732 </refsect2>
733 </refsect1>
734
735 <refsect1>
736 <title>Errors</title>
737 <para>
738 If you get one of some frequently-encountered or confusing errors,
739 please check this section.
740 </para>
741
742 <refsect2>
743 <title>UID validity problem for folder</title>
744 <para>IMAP servers use a unique ID (UID) to refer to a specific message.
745 This number is guaranteed to be unique to a particular message
746 <emphasis>forever</emphasis>.
747 No other message in the same folder will ever get the same
748 UID. UIDs are an integral part of &OfflineIMAP;'s synchronization
749 scheme; they are used to match up messages on your computer to
750 messages on the server.
751 </para>
752
753 <para>
754 Sometimes, the UIDs on the server might get reset. Usually this will
755 happen if you delete and then recreate a folder. When you create a
756 folder, the server will often start the UID back from 1. But
757 &OfflineIMAP; might still have the UIDs from the previous folder by the
758 same name stored. &OfflineIMAP; will detect this condition and skip the
759 folder. This is GOOD, because it prevents data loss.
760 </para>
761
762 <para>
763 You can fix it by removing your local folder and cache data. For
764 instance, if your folders are under <filename>~/Folders</filename>
765 and the folder with the problem is INBOX, you'd type this:
766 </para>
767
768 <programlisting>rm -r ~/Folders/INBOX
769 rm -r ~/.offlineimap/Account-<replaceable>AccountName</>
770 rm -r ~/.offlineimap/Repository-<replaceable>RepositoryName</></programlisting>
771
772 <para>
773 (Of course, replace AccountName and RepositoryName
774 with the names as specified
775 in <filename>~/.offlineimaprc</filename>).
776 </para>
777
778 <para>Next time you run &OfflineIMAP;, it will re-download
779 the folder with the
780 new UIDs. Note that the procedure specified above will lose any local
781 changes made to the folder.
782 </para>
783
784 <para>
785 Some IMAP servers are broken and do not support UIDs properly. If you
786 continue to get this error for all your folders even after performing
787 the above procedure, it is likely that your IMAP server falls into
788 this category. &OfflineIMAP; is incompatible with such servers.
789 Using &OfflineIMAP; with them will not destroy any mail, but at the same time,
790 it will not actually synchronize it either. (&OfflineIMAP; will detect
791 this condition and abort prior to synchronization.)
792 </para>
793 <para>
794 This question comes up frequently on the
795 <ulink
796 url="http://lists.complete.org/offlineimap@complete.org/">&OfflineIMAP;
797 mailing list</ulink>. You can find a
798 <ulink
799 url="http://lists.complete.org/offlineimap@complete.org/2003/04/msg00012.html.gz">detailed
800 discussion</ulink> of the problem there.
801 </para>
802 </refsect2>
803
804 <refsect2>
805 <title>Use with MS Exchange server</title>
806 <para>
807 Several users have reported problems with Microsoft Exchange
808 servers in conjunction with OfflineIMAP. This generally
809 seems to be related to the Exchange servers not properly
810 following the IMAP standards.
811 </para>
812 <para>
813 Mark Biggers has posted some <ulink
814 url="http://lists.complete.org/offlineimap@complete.org/2005/09/msg00011.html.gz">information</ulink>
815 to the &OfflineIMAP; mailing list about how he made it work.
816 </para>
817 <para>
818 Other users have indicated that older (5.5) releases of
819 Exchange are so bad that they will likely not work at all.
820 </para>
821 <para>
822 I do not have access to Exchange servers for testing, so any
823 problems with it, if they can even be solved at all, will
824 require help from &OfflineIMAP; users to find and fix.
825 </para>
826 </refsect2>
827
828 </refsect1>
829 <refsect1>
830 <title>Other Frequently Asked Questions</title>
831 <para>There are some other FAQs that might not fit into another section
832 of the document, so they are discussed here.
833 </para>
834
835 <variablelist>
836 <varlistentry><term>What platforms does &OfflineIMAP; run on?</term>
837 <listitem><para>
838 It should run on most platforms supported by Python, which are quite a
839 few. I do not support Windows myself, but some have made
840 it work there; see the FAQ entry for that platform.
841 </para></listitem>
842 </varlistentry>
843
844 <varlistentry><term>I'm using Mutt. Other IMAP sync programs require me to use "set maildir_trash=yes". Do I need to do that with &OfflineIMAP;?</term>
845 <listitem><para>
846 No. &OfflineIMAP; is smart enough to figure out message deletion without this extra
847 crutch. You'll get the best results if you don't use this setting, in
848 fact.
849 </para></listitem>
850 </varlistentry>
851
852 <varlistentry><term>I've upgraded and now &OfflineIMAP;
853 crashes when I start it up! Why?</term>
854 <listitem><para>You need to upgrade your configuration
855 file. See <xref linkend="upgrading.4.0"> at the end of this
856 manual.
857 </para>
858 </listitem>
859 </varlistentry>
860
861 <varlistentry><term>How do I specify the names of my folders?</term>
862 <listitem><para>
863 You do not need to. &OfflineIMAP; is smart
864 enough to automatically figure out what folders are present
865 on the IMAP server and synchronize them. You can use the
866 <property>folderfilter</property> and <property>nametrans</property>
867 configuration file options to request certain folders and rename them
868 as they come in if you like.
869 </para></listitem>
870 </varlistentry>
871
872 <varlistentry><term>How can I prevent certain folders from being synced?</term>
873 <listitem><para>
874 Use the <property>folderfilter</property> option in the configuration file.
875 </para></listitem>
876 </varlistentry>
877
878 <varlistentry><term>How can I add or delete a folder?</term>
879 <listitem><para>
880 &OfflineIMAP; does not currently provide this feature, but if you create a new
881 folder on the IMAP server, it will be created locally automatically.
882 </para></listitem>
883 </varlistentry>
884
885 <varlistentry><term>Are there any other warnings that I should be aware of?</term>
886 <listitem><para>
887 Yes; see the Notes section below.
888 </para></listitem>
889 </varlistentry>
890
891 <varlistentry><term>What is the mailbox name recorder (mbnames) for?</term>
892 <listitem><para>Some mail readers, such as Mutt, are not capable
893 of automatically determining the names of your mailboxes.
894 &OfflineIMAP; can help these programs by writing the names
895 of the folders in a format you specify. See the example
896 <filename>offlineimap.conf</filename> for details.
897 </para></listitem>
898 </varlistentry>
899
900 <varlistentry><term>Can I synchronize multiple accounts with &OfflineIMAP?</term>
901 <listitem><para>Sure. Just name them all in the
902 <property>accounts</property> line in the <property>general</property>
903 section of the configuration file, and add a per-account section
904 for each one.
905 </para></listitem>
906 </varlistentry>
907
908 <varlistentry><term>Does &OfflineIMAP; support POP?</term>
909 <listitem><para>No. POP is not robust enough to do a completely reliable
910 multi-machine synchronization like &OfflineIMAP; can do. &OfflineIMAP;
911 will not support it.
912 </para></listitem>
913 </varlistentry>
914
915 <varlistentry><term>Does &OfflineIMAP; support mailbox formats other than Maildir?</term>
916 <listitem><para>Not at present. There is no technical reason not to; just no
917 demand yet. Maildir is a superior format anyway.
918 However, &OfflineIMAP; can sync between two IMAP
919 servers, and some IMAP servers support other formats. You
920 could install an IMAP server on your local machine and have
921 &OfflineIMAP sync to that.
922 </para></listitem>
923 </varlistentry>
924
925 <varlistentry><term>[technical] Why are your Maildir message filenames so huge?</term>
926 <listitem><para>&OfflineIMAP; has two relevant principles: 1) never modifying your
927 messages in any way and 2) ensuring 100% reliable synchronizations.
928 In order to do a reliable sync, &OfflineIMAP;
929 must have a way to
930 uniquely identify each e-mail. Three pieces of information are
931 required to do this: your account name, the folder name, and the
932 message UID. The account name can be calculated from the path in
933 which your messages are. The folder name can usually be as well, BUT
934 some mail clients move messages between folders by simply moving the
935 file, leaving the name intact.
936 </para>
937 <para>
938 So, &OfflineIMAP; must store both a UID folder ID. The folder ID is
939 necessary so &OfflineIMAP; can detect a message moved to a different
940 folder. &OfflineIMAP; stores the UID (U= number) and an md5sum of the
941 foldername (FMD5= number) to facilitate this.
942 </para></listitem>
943 </varlistentry>
944
945 <varlistentry><term>What is the speed of &OfflineIMAP;'s sync?</term>
946 <listitem><para>OfflineIMAP
947 versions 2.0 and above contain a multithreaded system. A good way to
948 experiment is by setting <property>maxsyncaccounts</property> to 3 and <property>maxconnections</property> to 3
949 in each account clause.
950 </para>
951 <para>This lets OfflineIMAP open up multiple connections simultaneously.
952 That will let it process multiple folders and messages at once. In
953 most cases, this will increase performance of the sync.
954 </para>
955 <para>Don't set the number too high. If you do that, things might actually
956 slow down as your link gets saturated. Also, too many connections can
957 cause mail servers to have excessive load. Administrators might take
958 unkindly to this, and the server might bog down. There are many
959 variables in the optimal setting; experimentation may help.
960 </para>
961 <para>An informal benchmark yields these results for my setup:
962 </para>
963 <itemizedlist>
964 <listitem><para>10 minutes with MacOS X Mail.app "manual cache"
965 </para></listitem>
966 <listitem><para>5 minutes with GNUS agent sync</para></listitem>
967 <listitem><para>20 seconds with OfflineIMAP 1.x</para></listitem>
968 <listitem><para>9 seconds with OfflineIMAP 2.x</para></listitem>
969 <listitem><para>3 seconds with OfflineIMAP 3.x "cold start"</para></listitem>
970 <listitem><para>2 seconds with OfflineIMAP 3.x "held connection"</para></listitem>
971 </itemizedlist>
972 </listitem></varlistentry>
973 <varlistentry><term>Can I use &OfflineIMAP; on Windows?</term>
974 <listitem><para>
975 These answers have been reported by &OfflineIMAP;
976 users. I do not run &OfflineIMAP; on Windows myself, so
977 I can't directly address their accuracy.
978 </para>
979 <para>
980 The basic answer is that it's possible and doesn't
981 require hacking &OfflineIMAP; source code. However,
982 it's not necessarily trivial. The information below is
983 based in instructions submitted by Chris Walker.
984 </para>
985 <para>
986 First, you must run &OfflineIMAP; in the <ulink
987 url="http://www.cygwin.com/">Cygwin</ulink>
988 environment.
989 </para>
990 <para>
991 Next, you'll need to mount your Maildir directory in a
992 special way. There is information for doing that at
993 <ulink url="http://barnson.org/node/view/295"></ulink>.
994 That site gives this example:
995 </para>
996 <programlisting>
997 mount -f -s -b -o managed "d:/tmp/mail" "/home/of/mail"
998 </programlisting>
999 <para>
1000 That URL also has more details on making OfflineIMAP
1001 work with Windows.
1002 </para>
1003 </listitem>
1004 </varlistentry>
1005 </variablelist>
1006 </refsect1>
1007
1008 <refsect1>
1009 <title>Conforming To</title>
1010 <itemizedlist>
1011 <listitem><para>Internet Message Access Protocol version 4rev1 (IMAP 4rev1) as
1012 specified in RFC2060 and RFC3501</para></listitem>
1013 <listitem><para>CRAM-MD5 as specified in RFC2195</para></listitem>
1014 <listitem><para>Maildir as specified in
1015 <ulink url="http://www.qmail.org/qmail-manual-html/man5/maildir.html">the Maildir manpage</ulink> and
1016 <ulink url="http://cr.yp.to/proto/maildir.html">the qmail website</ulink>.</para></listitem>
1017 <listitem><para>Standard Python 2.2.1 as implemented on POSIX-compliant systems.</para></listitem>
1018 </itemizedlist>
1019 </refsect1>
1020
1021 <refsect1>
1022 <title>Notes</title>
1023 <refsect2>
1024 <title>Deleting Local Folders</title>
1025 <para>&OfflineIMAP; does a two-way synchronization. That is, if you
1026 make a change to the mail on the server, it will be propagated to your
1027 local copy, and vise-versa. Some people might think that it would be
1028 wise to just delete all their local mail folders periodically. If you
1029 do this with &OfflineIMAP;, remember to also remove your local status
1030 cache (<filename>~/.offlineimap</filename> by default). Otherwise, &OfflineIMAP; will take
1031 this as an intentional deletion of many messages and will interpret
1032 your action as requesting them to be deleted from the server as well.
1033 (If you don't understand this, don't worry; you probably won't
1034 encounter this situation)
1035 </para>
1036 </refsect2>
1037
1038 <refsect2>
1039 <title>Multiple Instances</title>
1040 <para>&OfflineIMAP; is not designed to have several instances (for instance, a cron job and an interactive invocation) run over the same
1041 mailbox simultaneously. It will perform a check on startup and
1042 abort if another &OfflineIMAP; is already running. If you need
1043 to schedule synchronizations, please use the
1044 <property>autorefresh</property> settings rather than cron.
1045 Alternatively, you can set a separate <property>metadata</property>
1046 directory for each instance.
1047 </para>
1048 </refsect2>
1049
1050 <refsect2>
1051 <title>Copying Messages Between Folders</title>
1052 <para>
1053 Normally, when you copy a message between folders or add a new message
1054 to a folder locally, &OfflineIMAP;
1055 will just do the right thing. However, sometimes this can be tricky
1056 -- if your IMAP server does not provide the SEARCH command, or does
1057 not return something useful, &OfflineIMAP;
1058 cannot determine the new UID of the message. So, in these rare
1059 instances, OfflineIMAP will upload the message to the IMAP server and
1060 delete it from your local folder. Then, on your next sync, the
1061 message will be re-downloaded with the proper UID.
1062 &OfflineIMAP; makes sure that the message was properly uploaded before deleting it,
1063 so there should be no risk of data loss.
1064 </para>
1065 </refsect2>
1066
1067 <refsect2>
1068 <title>Use with Evolution</title>
1069 <para>&OfflineIMAP; can work with Evolution. To do so, first configure
1070 your &OfflineIMAP; account to have
1071 <option>sep = /</option> in its configuration. Then, configure
1072 Evolution with the
1073 "Maildir-format mail directories" server type. For the path, you will need to
1074 specify the name of the top-level folder
1075 <emphasis>inside</emphasis> your &OfflineIMAP; storage location.
1076 You're now set!
1077 </para>
1078 </refsect2>
1079
1080 <refsect2>
1081 <title>Use with KMail</title>
1082 <para>At this time, I believe that &OfflineIMAP; with Maildirs
1083 is not compatible
1084 with KMail. KMail cannot work in any mode other than to move
1085 all messages out of all folders immediately, which (besides being annoying
1086 and fundamentally broken) is incompatible with
1087 &OfflineIMAP;.
1088 </para>
1089 <para>
1090 However, I have made KMail version 3 work well with
1091 &OfflineIMAP; by installing an IMAP server on my local
1092 machine, having &OfflineIMAP; sync to that, and pointing
1093 KMail at the same server.
1094 </para>
1095 </refsect2>
1096
1097 <refsect2>
1098 <title>Mailing List</title>
1099 <para>There is an OfflineIMAP mailing list available.
1100 To subscribe, send the text "Subscribe" in the subject of a mail to
1101 offlineimap-request@complete.org. To post, send the message to
1102 offlineimap@complete.org. Archives are available at
1103 <ulink url="http://lists.complete.org/offlineimap@complete.org/"></>.
1104 </para>
1105 </refsect2>
1106
1107 <refsect2>
1108 <title>Bugs</title>
1109 <para>Reports of bugs should be sent via e-mail to the
1110 &OfflineIMAP; mailing list at offlineimap at complete
1111 dot org. Debian users are encouraged to instead use the
1112 Debian
1113 bug-tracking system.
1114 </para>
1115 </refsect2>
1116 </refsect1>
1117
1118 <refsect1 id="upgrading.4.0">
1119 <title>Upgrading to 4.0</title>
1120 <para>
1121 If you are upgrading from a version of &OfflineIMAP; prior to
1122 3.99.12, you will find that you will get errors when
1123 &OfflineIMAP; starts up (relating to ConfigParser or
1124 AccountHashGenerator) and the
1125 configuration file. This is because the config file format
1126 had to change to accommodate new features in 4.0. Fortunately,
1127 it's not difficult to adjust it to suit.
1128 </para>
1129 <para>
1130 First thing you need to do is stop any running &OfflineIMAP;
1131 instance, making sure first that it's synced all your mail.
1132 Then, modify your
1133 <filename>~/.offlineimaprc</filename> file. You'll need to
1134 split up each account section (make sure that it now starts
1135 with "Account ") into two Repository sections (one for the
1136 local side and another for the remote side.) See the files
1137 <filename>offlineimap.conf.minimal</filename> and
1138 <filename>offlineimap.conf</filename> in the distribution if
1139 you need more assistance.
1140 </para>
1141 <para>
1142 &OfflineIMAP;'s status directory area has also changed.
1143 Therefore, you should delete everything in ~/.offlineimap as
1144 well as your local mail folders.
1145 </para>
1146 <para>
1147 When you start up &OfflineIMAP; 4.0, it will re-download all
1148 your mail from the server and then you can continue using it
1149 like normal.
1150 </para>
1151 </refsect1>
1152
1153
1154 <refsect1>
1155 <title>Copyright</title>
1156 <para>OfflineIMAP, and this manual, are Copyright &copy; 2002, 2003 John Goerzen.</para>
1157
1158 <para>
1159 This program is free software; you can redistribute it and/or modify
1160 it under the terms of the GNU General Public License as published by
1161 the Free Software Foundation; either version 2 of the License, or
1162 (at your option) any later version.
1163 </para>
1164
1165 <para>
1166 This program is distributed in the hope that it will be useful,
1167 but WITHOUT ANY WARRANTY; without even the implied warranty of
1168 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1169 GNU General Public License for more details.
1170 </para>
1171
1172 <para>
1173 You should have received a copy of the GNU General Public License
1174 along with this program; if not, write to the Free Software
1175 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</para>
1176
1177 <para>imaplib.py comes from the Python dev tree and is licensed under
1178 the GPL-compatible PSF license as stated in the file
1179 <filename>COPYRIGHT</filename> in the &OfflineIMAP;
1180 distribution.
1181 </para>
1182 </refsect1>
1183
1184 <refsect1>
1185 <title>Author</title>
1186 <para>&OfflineIMAP;, its libraries, documentation, and all included files, except where
1187 noted, was written by John Goerzen <email>jgoerzen@complete.org</email> and
1188 copyright is held as stated in the COPYRIGHT section.
1189 </para>
1190
1191 <para>
1192 &OfflineIMAP; may be downloaded, and information found, from its
1193 <ulink url="http://software.complete.org/offlineimap">homepage</ulink>.
1194 </para>
1195
1196 <para>
1197 &OfflineIMAP; may also be downloaded using Subversion. Additionally,
1198 the distributed tar.gz may be updated with a simple "svn update"
1199 command; it is ready to go. For information on getting OfflineIMAP
1200 with Subversion, please visit the
1201 <ulink url="http://svn.complete.org/">complete.org Subversion page</ulink>.
1202 </para>
1203
1204 </refsect1>
1205
1206 <refsect1>
1207 <title>See Also</title>
1208 <para><application>mutt</application>(1),
1209 <application>python</application>(1)
1210 </para>
1211 </refsect1>
1212
1213 <refsect1>
1214 <title>History</title>
1215 <para>
1216 Detailed history may be found in the file ChangeLog in the
1217 &OfflineIMAP; distribution. Feature and bug histories may be
1218 found in the file debian/changelog which, despite its name, is
1219 not really Debian-specific. This section provides a large
1220 overview.
1221 </para>
1222 <para>
1223 Development on &OfflineIMAP; began on June 18, 2002. Version
1224 1.0.0 was released three days later on June 21, 2002. Point
1225 releases followed, including speed optimizations and some
1226 compatibility fixes.
1227 </para>
1228 <para>Version 2.0.0 was released on July 3, 2002, and
1229 represented the first time the synchronization became
1230 multithreaded and, to the best of my knowledge, the first
1231 multithreaded IMAP syncrhonizing application in existance.
1232 The last 2.0.x release, 2.0.8, was made on July 9.
1233 </para>
1234 <para>
1235 Version 3.0.0 was released on July 11, 2002, and introduced
1236 modular user interfaces and the first GUI interface for
1237 &OfflineIMAP;. This manual also was introduced with 3.0.0,
1238 along with many command-line options. Version 3.1.0 was
1239 released on July 21, adding the Noninteractive user
1240 interfaces, profiling support, and several bugfixes. 3.2.0
1241 was released on July 24, adding support for the Blinkenlights
1242 GUI interface. &OfflineIMAP; entered maintenance mode for
1243 awhile, as it had reached a feature-complete milestone in my
1244 mind.
1245 </para>
1246 <para>
1247 The 3.99.x branch began in on October 7, 2002, to begin work
1248 for 4.0. The Curses.Blinkenlights interface was added in
1249 3.99.6, and many architectural changes were made.
1250 </para>
1251 <para>
1252 4.0.0 was released on July 18, 2003, including the ability to
1253 synchronize directly between two IMAP servers, the first
1254 re-architecting of the configuration file to refine the
1255 notion of an account, and the new Curses interface.
1256 </para>
1257 </refsect1>
1258 </refentry>
1259 </reference>
1260
1261 <!--
1262 Local Variables:
1263 mode: sgml
1264 sgml-set-face: T
1265 End:
1266 -->