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