]> code.delx.au - offlineimap/blob - offlineimap.sgml
f0481f713dec2833245f1f996c5af5fddd475a7a
[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 SSL interface, your
218 Python must have been built with SSL support.
219 </para>
220 </listitem>
221 <listitem>
222 <para>
223 Have a mail reader that supports the Maildir mailbox
224 format. Most modern mail readers have this support
225 built-in, so you can choose from a wide variety of mail
226 servers. This format is also known as the "qmail"
227 format, so any mail reader compatible with it will work
228 with &OfflineIMAP;. If you do not have a mail reader
229 that supports Maildir, you can often install a local
230 IMAP server and point both &OfflineIMAP; and your mail
231 reader at it.
232 </para>
233 </itemizedlist>
234 </refsect2>
235
236 <refsect2>
237 <title>System-Wide Installation, Debian</title>
238 <para>
239 If you are tracking Debian unstable, you may install
240 &OfflineIMAP; by simply running the following command as root:
241 </para>
242 <para>
243 <command>apt-get install offlineimap</command>
244 </para>
245 <para>
246 If you are not tracking Debian unstable, download the Debian .deb
247 package from the <ulink url="http://software.complete.org/offlineimap/">&OfflineIMAP; website</ulink>
248 and then run <command>dpkg -i</command> to install the downloaded
249 package. Then, skip to <xref linkend="configuration" endterm="configuration-title"> below. You will type <command>offlineimap</command> to
250 invoke the program.
251 </para>
252 </refsect2>
253
254 <refsect2>
255 <title>System-Wide Installation, Other</title>
256 <para>
257 Download the tar.gz version of the package from the
258 <ulink url="http://software.complete.org/offlineimap/">website</ulink>.
259 Then run
260 these commands, making sure that you are the "root" user first:
261 </para>
262
263 <ProgramListing>tar -zxvf offlineimap_x.y.z.tar.gz
264 cd offlineimap-x.y.z
265 python2.2 setup.py install</ProgramListing>
266 <para>On some systems, you will need to use
267 <command>python</command> instead of <command>python2.2</command>.
268 Next, proceed to <xref linkend="configuration" endterm="configuration-title"> below. You will type <command>offlineimap</command> to
269 invoke the program.
270 </para>
271 </refsect2>
272
273 <refsect2>
274 <title>Single-Account Installation</title>
275 <para>
276 Download the tar.gz version of the package from the
277 <ulink url="http://software.complete.org/offlineimap/">website</ulink>.
278 Then run these commands:
279 </para>
280
281 <ProgramListing>tar -zxvf offlineimap_x.y.z.tar.gz
282 cd offlineimap-x.y.z</ProgramListing>
283
284 <para>When you want to run &OfflineIMAP;, you will issue the
285 <command>cd</command> command as above and then type
286 <command>./offlineimap.py</command>; there is no installation
287 step necessary.
288 </para>
289 </refsect2>
290 </refsect1>
291
292 <refsect1 id="configuration">
293 <title id="configuration-title">Configuration</title>
294 <para>
295 &OfflineIMAP; is regulated by a configuration file that is normally
296 stored in <filename>~/.offlineimaprc</filename>. &OfflineIMAP;
297 ships with a file named <filename>offlineimap.conf</filename>
298 that you should copy to that location and then edit. This file is
299 vital to proper operation of the system; it sets everything you need
300 to run &OfflineIMAP;. Full documentation for the configuration file
301 is included within the sample file.
302 </para>
303 <para>
304 &OfflineIMAP; also ships a file named
305 <filename>offlineimap.conf.minimal</filename> that you can also try.
306 It's useful if you want to get started with
307 the most basic feature set, and you can read about other features
308 later with <filename>offlineimap.conf</filename>.
309 </para>
310 </refsect1>
311
312 <refsect1>
313 <title>Options</title>
314 <para>
315 Most configuration is done via the configuration file. Nevertheless,
316 there are a few command-line options that you may set for
317 &OfflineIMAP;.
318 </para>
319
320 <variablelist>
321 <varlistentry><term>-1</term>
322 <listitem><para>Disable most multithreading operations and use
323 solely a single-connection
324 sync. This effectively sets the
325 <property>maxsyncaccounts</property>
326 and all <property>maxconnections</property> configuration file
327 variables to 1.
328 </para></listitem>
329 </varlistentry>
330 <varlistentry><term>-P <replaceable>profiledir</replaceable></term>
331 <listitem><para>Sets &OfflineIMAP; into profile mode. The program
332 will create <replaceable>profiledir</replaceable>
333 (it must not already exist). As it runs, Python profiling
334 information
335 about each thread is logged into profiledir. Please note: This option
336 is present for debugging and optimization only, and should NOT be used
337 unless you have a specific reason to do so. It will significantly
338 slow program performance, may reduce reliability, and can generate
339 huge amounts of data. You must use the <option>-1</option> option when
340 you use <option>-P</option>.
341 </para></listitem>
342 </varlistentry>
343 <varlistentry><term>-a <replaceable>accountlist</replaceable></term>
344 <listitem><para>Overrides the <property>accounts</property> option
345 in the <property>general</property> section of the configuration
346 file. You might use this to exclude certain accounts, or to sync
347 some accounts that you normally prefer not to. Separate the
348 accounts by commas, and use no embedded spaces.
349 </para></listitem>
350 </varlistentry>
351 <varlistentry><term>-c <replaceable>configfile</replaceable></term>
352 <listitem><para>Specifies a configuration file to use in lieu of
353 the default, <filename>~/.offlineimaprc</filename>.
354 </para></listitem>
355 </varlistentry>
356 <varlistentry><term>-d <replaceable>debugtype[,...]</replaceable></term>
357 <listitem><para>Enables debugging for OfflineIMAP. This is useful if
358 you are trying to track down a malfunction or figure out what is going
359 on under the hood. I suggest that you use this with
360 <option>-1</option> to make the results more sensible.</para>
361
362 <para><option>-d</option> requires one or more debugtypes,
363 separated by commas. These define what exactly will be
364 debugged, and include three options: <property>imap</property>,
365 <property>maildir</property>, and <property>thread</property>.
366 The <property>imap</property>
367 option will enable IMAP protocol stream and parsing debugging. Note
368 that the output may contain passwords, so take care to remove that
369 from the debugging output before sending it to anyone else. The
370 <property>maildir</property> option will enable debugging for
371 certain Maildir operations. And <property>thread</property>
372 will debug the threading model.
373 </para></listitem>
374 </varlistentry>
375 <varlistentry><term>-l
376 <replaceable>filename</replaceable></term>
377 <listitem><para>
378 Enables logging to filename. This will log everything
379 that goes to the screen to the specified file.
380 Additionally, if any debugging is specified with -d,
381 then debug messages will not go to the screen, but
382 instead to the logfile only.</para>
383 </listitem>
384 </varlistentry>
385 <varlistentry><term>-o</term>
386 <listitem><para>Run only once, ignoring all
387 <property>autorefresh</property> settings in the configuration
388 file.</para>
389 </listitem>
390 </varlistentry>
391 <varlistentry><term>-h</term> <term>--help</term>
392 <listitem><para>Show summary of options.</para></listitem>
393 </varlistentry>
394 <varlistentry><term>-u <replaceable>interface</replaceable></term>
395 <listitem><para>Specifies an alternative user interface module
396 to use. This overrides the default specified in the
397 configuration file. The pre-defined options are listed in
398 the User Interfaces section.</para>
399 </listitem>
400 </varlistentry>
401 </variablelist>
402 </refsect1>
403 <refsect1>
404 <title>User Interfaces</title>
405 <para>&OfflineIMAP; has a pluggable user interface system that lets you choose how the
406 program communicates information to you. There are two graphical
407 interfaces, two terminal interfaces, and two noninteractive interfaces
408 suitable for scripting or logging purposes. The
409 <property>ui</property> option in the configuration file specifies
410 user interface preferences. The <option>-u</option> command-line
411 option can override the configuration file setting. The available
412 values for the configuration file or command-line are described
413 in this section.</para>
414
415 <refsect2>
416 <title>Curses.Blinkenlights</title>
417 <para>
418 Curses.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 Curses.Blinkenlights contains a row of
425 "LEDs" with command buttons and a log.
426 The log shows more
427 detail about what is happening and is color-coded to match the color
428 of the lights.
429 </para>
430 <para>
431 Each light in the Blinkenlights interface represents a thread
432 of execution -- that is, a particular task that &OfflineIMAP;
433 is performing right now. The colors indicate what task
434 the particular thread is performing, and are as follows:
435 </para>
436 <variablelist>
437 <varlistentry>
438 <term>Black</term>
439 <listitem><para>indicates that this light's thread has terminated; it will light up
440 again later when new threads start up. So, black indicates no
441 activity.
442 </para></listitem>
443 </varlistentry>
444 <varlistentry>
445 <term>Red (Meaning 1)</term>
446 <listitem><para>is the color of the main program's thread, which basically does
447 nothing but monitor the others. It might remind you of HAL 9000 in
448 <citation>2001</citation>.
449 </para></listitem>
450 </varlistentry>
451 <varlistentry>
452 <term>Gray</term>
453 <listitem><para>indicates that the thread is establishing a new connection to the IMAP
454 server.
455 </para></listitem>
456 </varlistentry>
457 <varlistentry>
458 <term>Purple</term>
459 <listitem><para>is the color of an account synchronization thread that is monitoring
460 the progress of the folders in that account (not generating any I/O).
461 </para></listitem>
462 </varlistentry>
463 <varlistentry>
464 <term>Cyan</term>
465 <listitem><para>indicates that the thread is syncing a folder.
466 </para></listitem>
467 </varlistentry>
468 <varlistentry>
469 <term>Green</term>
470 <listitem><para>means that a folder's message list is being loaded.
471 </para></listitem>
472 </varlistentry>
473 <varlistentry>
474 <term>Blue</term>
475 <listitem><para>is the color of a message synchronization controller thread.
476 </para></listitem>
477 </varlistentry>
478 <varlistentry>
479 <term>Orange</term>
480 <listitem><para>indicates that an actual message is being copied.
481 (We use fuchsia for fake messages.)
482 </para></listitem>
483 </varlistentry>
484 <varlistentry>
485 <term>Red (meaning 2)</term>
486 <listitem><para>indicates that a message is being deleted.
487 </para></listitem>
488 </varlistentry>
489 <varlistentry>
490 <term>Yellow / bright orange</term>
491 <listitem><para>indicates that message flags are being added.
492 </para></listitem>
493 </varlistentry>
494 <varlistentry>
495 <term>Pink / bright red</term>
496 <listitem><para>indicates that message flags are being removed.
497 </para></listitem>
498 </varlistentry>
499 <varlistentry>
500 <term>Red / Black Flashing</term>
501 <listitem><para>corresponds to the countdown timer that runs between
502 synchronizations.
503 </para></listitem>
504 </varlistentry>
505 </variablelist>
506 <para>The name of this interfaces derives from a bit of computer
507 history. Eric Raymond's <citation>Jargon File</citation> defines
508 <firstterm>blinkenlights</firstterm>, in part, as:
509 </para>
510 <blockquote>
511 <para>Front-panel diagnostic
512 lights on a computer, esp. a dinosaur. Now that dinosaurs are rare,
513 this term usually refers to status lights on a modem, network hub, or
514 the like.
515 </para>
516 <para>
517 This term derives from the last word of the famous blackletter-Gothic
518 sign in mangled pseudo-German that once graced about half the computer
519 rooms in the English-speaking world. One version ran in its entirety as
520 follows:
521 </para>
522 <para>
523 <emphasis>ACHTUNG! ALLES LOOKENSPEEPERS!</emphasis>
524 </para>
525 <para>
526 Das computermachine ist nicht fuer gefingerpoken und mittengrabben.
527 Ist easy schnappen der springenwerk, blowenfusen und poppencorken
528 mit spitzensparken. Ist nicht fuer gewerken bei das dumpkopfen.
529 Das rubbernecken sichtseeren keepen das cotten-pickenen hans in das
530 pockets muss; relaxen und watchen das blinkenlichten.
531 </para>
532 </blockquote>
533 </refsect2>
534
535 <refsect2>
536 <title>TTY.TTYUI</title>
537 <para>
538 TTY.TTYUI interface is for people running in basic, non-color terminals. It
539 prints out basic status messages and is generally friendly to use on a console
540 or xterm.
541 </para>
542 </refsect2>
543
544 <refsect2>
545 <title>Noninteractive.Basic</title>
546 <para>
547 Noninteractive.Basic is designed for situations in which &OfflineIMAP;
548 will be run non-attended and the status of its execution will be
549 logged. You might use it, for instance, to have the system run
550 automatically and
551 e-mail you the results of the synchronization. This user interface
552 is not capable of reading a password from the keyboard; account
553 passwords must be specified using one of the configuration file options.
554 </para>
555 </refsect2>
556
557 <refsect2>
558 <title>Noninteractive.Quiet</title>
559 <para>
560 Noninteractive.Quiet is designed for non-attended running in situations
561 where normal status messages are not desired. It will output nothing
562 except errors and serious warnings. Like Noninteractive.Basic,
563 this user interface
564 is not capable of reading a password from the keyboard; account
565 passwords must be specified using one of the configuration file options.
566 </para>
567 </refsect2>
568
569 </refsect1>
570
571 <refsect1>
572 <title>Examples</title>
573 <para>Here are some example configurations for various situations.
574 Please e-mail any other examples you have that may be useful to
575 me.
576 </para>
577
578 <refsect2>
579 <title>Multiple Accounts with Mutt</title>
580 <para>
581 This example shows you how to set up &OfflineIMAP; to
582 synchronize multiple accounts with the mutt mail reader.
583 </para>
584 <para>
585 Start by creating a directory to hold your folders by running
586 <command>mkdir ~/Mail</command>. Then, in your
587 <filename>~/.offlineimaprc</filename>, specify:
588 </para>
589 <programlisting>accounts = Personal, Work</programlisting>
590 <para>
591 Make sure that you have both an
592 <property>[Account Personal]</property>
593 and an <property>[Account Work]</property> section. The
594 local repository for each account must have different
595 <property>localfolder</> path names.
596 Also, make sure
597 to enable <property>[mbnames]</property>.
598 </para>
599 <para>
600 In each local repository section, write something like this:
601 </para>
602 <programlisting>localfolders = ~/Mail/Personal</programlisting>
603 <para>
604 Finally, add these lines to your <filename>~/.muttrc</filename>:
605 </para>
606 <programlisting>source ~/path-to-mbnames-muttrc-mailboxes
607 folder-hook Personal set from="youremail@personal.com"
608 folder-hook Work set from="youremail@work.com"
609 set mbox_type=Maildir
610 set folder=$HOME/Mail
611 spoolfile=+Personal/INBOX</programlisting>
612 <para>
613 That's it!
614 </para>
615 </refsect2>
616
617 <refsect2>
618 <title>UW-IMAPD and References</title>
619 <para>Some users with a UW-IMAPD server need to use &OfflineIMAP;'s
620 "reference" feature to get at their mailboxes, specifying a reference
621 of "~/Mail" or "#mh/" depending on the configuration. The below
622 configuration from (originally from docwhat@gerf.org)
623 shows using a <property>reference</property> of Mail, a <property>nametrans</property>
624 that strips
625 the leading Mail/ off incoming folder names, and a
626 <property>folderfilter</property> that
627 limits the folders synced to just three.
628 </para>
629 <programlisting>[Account Gerf]
630 localrepository = GerfLocal
631 remoterepository = GerfRemote
632
633 [Repository GerfLocal]
634 type = Maildir
635 localfolders = ~/Mail
636
637 [Repository GerfRemote]
638 type = IMAP
639 remotehost = gerf.org
640 ssl = yes
641 remoteuser = docwhat
642 reference = Mail
643 # Trims off the preceeding Mail on all the folder names.
644 nametrans = lambda foldername: \
645 re.sub('^Mail/', '', foldername)
646 # Yeah, you have to mention the Mail dir, even though it
647 # would seem intuitive that reference would trim it.
648 folderfilter = lambda foldername: foldername in [
649 'Mail/INBOX',
650 'Mail/list/zaurus-general',
651 'Mail/list/zaurus-dev',
652 ]
653 maxconnections = 1
654 holdconnectionopen = no</programlisting>
655 </refsect2>
656
657 <refsect2>
658 <title>pythonfile Configuration File Option</title>
659 <para>You can have &OfflineIMAP;
660 load up a Python file before evaluating the
661 configuration file options that are Python expressions. This example
662 is based on one supplied by Tommi Virtanen for this feature.
663 </para>
664 <para>
665 In <filename>~/.offlineimap.rc</filename>, he adds these options:
666 </para>
667 <programlisting>[general]
668 pythonfile=~/.offlineimap.py
669 [Repository foo]
670 foldersort=mycmp</programlisting>
671 <para>
672 Then, the <filename>~/.offlineimap.py</filename> file will
673 contain:
674 </para>
675 <programlisting>prioritized = ['INBOX', 'personal', 'announce', 'list']
676
677 def mycmp(x, y):
678 for prefix in prioritized:
679 xsw = x.startswith(prefix)
680 ysw = y.startswith(prefix)
681 if xsw and ysw:
682 return cmp(x, y)
683 elif xsw:
684 return -1
685 elif ysw:
686 return +1
687 return cmp(x, y)
688
689 def test_mycmp():
690 import os, os.path
691 folders=os.listdir(os.path.expanduser('~/data/mail/tv@hq.yok.utu.fi'))
692 folders.sort(mycmp)
693 print folders</programlisting>
694 <para>
695 This code snippet illustrates how the <property>foldersort</property>
696 option can be customized with a Python function from the
697 <property>pythonfile</property> to always synchronize certain
698 folders first.
699 </para>
700 </refsect2>
701 </refsect1>
702
703 <refsect1>
704 <title>Errors</title>
705 <para>
706 If you get one of some frequently-encountered or confusing errors,
707 please check this section.
708 </para>
709
710 <refsect2>
711 <title>UID validity problem for folder</title>
712 <para>IMAP servers use a unique ID (UID) to refer to a specific message.
713 This number is guaranteed to be unique to a particular message
714 <emphasis>forever</emphasis>.
715 No other message in the same folder will ever get the same
716 UID. UIDs are an integral part of &OfflineIMAP;'s synchronization
717 scheme; they are used to match up messages on your computer to
718 messages on the server.
719 </para>
720
721 <para>
722 Sometimes, the UIDs on the server might get reset. Usually this will
723 happen if you delete and then recreate a folder. When you create a
724 folder, the server will often start the UID back from 1. But
725 &OfflineIMAP; might still have the UIDs from the previous folder by the
726 same name stored. &OfflineIMAP; will detect this condition and skip the
727 folder. This is GOOD, because it prevents data loss.
728 </para>
729
730 <para>
731 You can fix it by removing your local folder and cache data. For
732 instance, if your folders are under <filename>~/Folders</filename>
733 and the folder with the problem is INBOX, you'd type this:
734 </para>
735
736 <programlisting>rm -r ~/Folders/INBOX
737 rm -r ~/.offlineimap/Account-<replaceable>AccountName</>
738 rm -r ~/.offlineimap/Repository-<replaceable>RepositoryName</></programlisting>
739
740 <para>
741 (Of course, replace AccountName and RepositoryName
742 with the names as specified
743 in <filename>~/.offlineimaprc</filename>).
744 </para>
745
746 <para>Next time you run &OfflineIMAP;, it will re-download
747 the folder with the
748 new UIDs. Note that the procedure specified above will lose any local
749 changes made to the folder.
750 </para>
751
752 <para>
753 Some IMAP servers are broken and do not support UIDs properly. If you
754 continue to get this error for all your folders even after performing
755 the above procedure, it is likely that your IMAP server falls into
756 this category. &OfflineIMAP; is incompatible with such servers.
757 Using &OfflineIMAP; with them will not destroy any mail, but at the same time,
758 it will not actually synchronize it either. (&OfflineIMAP; will detect
759 this condition and abort prior to synchronization.)
760 </para>
761 <para>
762 This question comes up frequently on the
763 <ulink
764 url="http://lists.complete.org/offlineimap@complete.org/">&OfflineIMAP;
765 mailing list</ulink>. You can find a
766 <ulink
767 url="http://lists.complete.org/offlineimap@complete.org/2003/04/msg00012.html.gz">detailed
768 discussion</ulink> of the problem there.
769 </para>
770 </refsect2>
771 </refsect1>
772 <refsect1>
773 <title>Conforming To</title>
774 <itemizedlist>
775 <listitem><para>Internet Message Access Protocol version 4rev1 (IMAP 4rev1) as
776 specified in RFC2060 and RFC3501</para></listitem>
777 <listitem><para>CRAM-MD5 as specified in RFC2195</para></listitem>
778 <listitem><para>Maildir as specified in
779 <ulink url="http://www.qmail.org/qmail-manual-html/man5/maildir.html">the Maildir manpage</ulink> and
780 <ulink url="http://cr.yp.to/proto/maildir.html">the qmail website</ulink>.</para></listitem>
781 <listitem><para>Standard Python 2.2.1 as implemented on POSIX-compliant systems.</para></listitem>
782 </itemizedlist>
783 </refsect1>
784
785 <refsect1>
786 <title>Notes</title>
787 <refsect2>
788 <title>Deleting Local Folders</title>
789 <para>&OfflineIMAP; does a two-way synchronization. That is, if you
790 make a change to the mail on the server, it will be propagated to your
791 local copy, and vise-versa. Some people might think that it would be
792 wise to just delete all their local mail folders periodically. If you
793 do this with &OfflineIMAP;, remember to also remove your local status
794 cache (<filename>~/.offlineimap</filename> by default). Otherwise, &OfflineIMAP; will take
795 this as an intentional deletion of many messages and will interpret
796 your action as requesting them to be deleted from the server as well.
797 (If you don't understand this, don't worry; you probably won't
798 encounter this situation)
799 </para>
800 </refsect2>
801
802 <refsect2>
803 <title>Multiple Instances</title>
804 <para>&OfflineIMAP; is not designed to have several instances (for instance, a cron job and an interactive invocation) run over the same
805 mailbox simultaneously. It will perform a check on startup and
806 abort if another &OfflineIMAP; is already running. If you need
807 to schedule synchronizations, please use the
808 <property>autorefresh</property> settings rather than cron.
809 Alternatively, you can set a separate <property>metadata</property>
810 directory for each instance.
811 </para>
812 </refsect2>
813
814 <refsect2>
815 <title>Copying Messages Between Folders</title>
816 <para>
817 Normally, when you copy a message between folders or add a new message
818 to a folder locally, &OfflineIMAP;
819 will just do the right thing. However, sometimes this can be tricky
820 -- if your IMAP server does not provide the SEARCH command, or does
821 not return something useful, &OfflineIMAP;
822 cannot determine the new UID of the message. So, in these rare
823 instances, OfflineIMAP will upload the message to the IMAP server and
824 delete it from your local folder. Then, on your next sync, the
825 message will be re-downloaded with the proper UID.
826 &OfflineIMAP; makes sure that the message was properly uploaded before deleting it,
827 so there should be no risk of data loss.
828 </para>
829 </refsect2>
830
831
832 <refsect2>
833 <title>Mailing List</title>
834 <para>There is an OfflineIMAP mailing list available.
835 To subscribe, send the text "Subscribe" in the subject of a mail to
836 offlineimap-request@complete.org. To post, send the message to
837 offlineimap@complete.org. Archives are available at
838 <ulink url="http://lists.complete.org/offlineimap@complete.org/"></>.
839 </para>
840 </refsect2>
841
842 <refsect2>
843 <title>Bugs</title>
844 <para>
845 Reports of bugs should be reported online at the
846 &OfflineIMAP; homepage.
847 Debian users are encouraged to instead use the
848 Debian
849 bug-tracking system.
850 </para>
851 </refsect2>
852 </refsect1>
853
854 <refsect1 id="upgrading.4.0">
855 <title>Upgrading to 4.0</title>
856 <para>
857 If you are upgrading from a version of &OfflineIMAP; prior to
858 3.99.12, you will find that you will get errors when
859 &OfflineIMAP; starts up (relating to ConfigParser or
860 AccountHashGenerator) and the
861 configuration file. This is because the config file format
862 had to change to accommodate new features in 4.0. Fortunately,
863 it's not difficult to adjust it to suit.
864 </para>
865 <para>
866 First thing you need to do is stop any running &OfflineIMAP;
867 instance, making sure first that it's synced all your mail.
868 Then, modify your
869 <filename>~/.offlineimaprc</filename> file. You'll need to
870 split up each account section (make sure that it now starts
871 with "Account ") into two Repository sections (one for the
872 local side and another for the remote side.) See the files
873 <filename>offlineimap.conf.minimal</filename> and
874 <filename>offlineimap.conf</filename> in the distribution if
875 you need more assistance.
876 </para>
877 <para>
878 &OfflineIMAP;'s status directory area has also changed.
879 Therefore, you should delete everything in ~/.offlineimap as
880 well as your local mail folders.
881 </para>
882 <para>
883 When you start up &OfflineIMAP; 4.0, it will re-download all
884 your mail from the server and then you can continue using it
885 like normal.
886 </para>
887 </refsect1>
888
889
890 <refsect1>
891 <title>Copyright</title>
892 <para>OfflineIMAP, and this manual, are Copyright &copy; 2002 - 2006 John Goerzen.</para>
893
894 <para>
895 This program is free software; you can redistribute it and/or modify
896 it under the terms of the GNU General Public License as published by
897 the Free Software Foundation; either version 2 of the License, or
898 (at your option) any later version.
899 </para>
900
901 <para>
902 This program is distributed in the hope that it will be useful,
903 but WITHOUT ANY WARRANTY; without even the implied warranty of
904 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
905 GNU General Public License for more details.
906 </para>
907
908 <para>
909 You should have received a copy of the GNU General Public License
910 along with this program; if not, write to the Free Software
911 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</para>
912
913 <para>imaplib.py comes from the Python dev tree and is licensed under
914 the GPL-compatible PSF license as stated in the file
915 <filename>COPYRIGHT</filename> in the &OfflineIMAP;
916 distribution.
917 </para>
918 </refsect1>
919
920 <refsect1>
921 <title>Author</title>
922 <para>&OfflineIMAP;, its libraries, documentation, and all included files, except where
923 noted, was written by John Goerzen <email>jgoerzen@complete.org</email> and
924 copyright is held as stated in the COPYRIGHT section.
925 </para>
926
927 <para>
928 &OfflineIMAP; may be downloaded, and information found, from its
929 <ulink url="http://software.complete.org/offlineimap">homepage</ulink>.
930 </para>
931
932 </refsect1>
933
934 <refsect1>
935 <title>See Also</title>
936 <para><application>mutt</application>(1),
937 <application>python</application>(1)
938 </para>
939 </refsect1>
940
941 <refsect1>
942 <title>History</title>
943 <para>
944 Detailed history may be found in the file ChangeLog in the
945 &OfflineIMAP; distribution. Feature and bug histories may be
946 found in the file debian/changelog which, despite its name, is
947 not really Debian-specific. This section provides a large
948 overview.
949 </para>
950 <para>
951 Development on &OfflineIMAP; began on June 18, 2002. Version
952 1.0.0 was released three days later on June 21, 2002. Point
953 releases followed, including speed optimizations and some
954 compatibility fixes.
955 </para>
956 <para>Version 2.0.0 was released on July 3, 2002, and
957 represented the first time the synchronization became
958 multithreaded and, to the best of my knowledge, the first
959 multithreaded IMAP syncrhonizing application in existance.
960 The last 2.0.x release, 2.0.8, was made on July 9.
961 </para>
962 <para>
963 Version 3.0.0 was released on July 11, 2002, and introduced
964 modular user interfaces and the first GUI interface for
965 &OfflineIMAP;. This manual also was introduced with 3.0.0,
966 along with many command-line options. Version 3.1.0 was
967 released on July 21, adding the Noninteractive user
968 interfaces, profiling support, and several bugfixes. 3.2.0
969 was released on July 24, adding support for the Blinkenlights
970 GUI interface. &OfflineIMAP; entered maintenance mode for
971 awhile, as it had reached a feature-complete milestone in my
972 mind.
973 </para>
974 <para>
975 The 3.99.x branch began in on October 7, 2002, to begin work
976 for 4.0. The Curses.Blinkenlights interface was added in
977 3.99.6, and many architectural changes were made.
978 </para>
979 <para>
980 4.0.0 was released on July 18, 2003, including the ability to
981 synchronize directly between two IMAP servers, the first
982 re-architecting of the configuration file to refine the
983 notion of an account, and the new Curses interface.
984 </para>
985 </refsect1>
986 </refentry>
987 </reference>
988
989 <!--
990 Local Variables:
991 mode: sgml
992 sgml-set-face: T
993 End:
994 -->