]> code.delx.au - offlineimap/blob - offlineimap.conf
Rework keepalive to use time.sleep() instead of event.wait()
[offlineimap] / offlineimap.conf
1 # Sample configuration file
2 # Copyright (C) 2002-2005 John Goerzen
3 # <jgoerzen@complete.org>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 # Looking for a quick start? Take a look at offlineimap.conf.minimal.
20
21
22 ##################################################
23 # General definitions
24 ##################################################
25
26 [general]
27
28 # This specifies where offlineimap is to store its metadata.
29 # This directory will be created if it does not already exist.
30
31 metadata = ~/.offlineimap
32
33 # This variable specifies which accounts are defined. Separate them
34 # with commas. Account names should be alphanumeric only.
35 # You will need to specify one section per account below. You may
36 # not use "general" for an account name.
37 #
38
39 accounts = Test
40
41 # Offlineimap can synchronize more the one account at a time. If you
42 # want to enable this feature, set the below value to something
43 # greater than 1. To force it to synchronize only one account at a
44 # time, set it to 1.
45 #
46
47 maxsyncaccounts = 1
48
49 # You can specify one or more user interface modules for OfflineIMAP
50 # to use. OfflineIMAP will try the first in the list, and if it
51 # fails, the second, and so forth.
52 #
53 # The pre-defined options are:
54 # Curses.Blinkenlights -- A text-based (terminal) interface similar to
55 # Tk.Blinkenlights
56 # TTY.TTYUI -- a text-based (terminal) interface
57 # Noninteractive.Basic -- Noninteractive interface suitable for cronning
58 # Noninteractive.Quiet -- Noninteractive interface, generates no output
59 # except for errors.
60 # Machine.MachineUI -- Interactive interface suitable for machine
61 # parsing.
62 #
63 # You can override this with a command-line option -u.
64
65 ui = Curses.Blinkenlights, TTY.TTYUI,
66 Noninteractive.Basic, Noninteractive.Quiet
67
68 # If you try to synchronize messages to a read-only folder,
69 # OfflineIMAP will generate a warning. If you want to suppress these
70 # warnings, set ignore-readonly to yes. Read-only IMAP folders allow
71 # reading but not modification, so if you try to change messages in
72 # the local copy of such a folder, the IMAP server will prevent
73 # OfflineIMAP from propogating those changes to the IMAP server.
74
75 ignore-readonly = no
76
77 ########## Advanced settings
78
79 # You can give a Python source filename here and all config file
80 # python snippets will be evaluated in the context of that file.
81 # This allows you to e.g. define helper functions in the Python
82 # source file and call them from this config file. You can find
83 # an example of this in the manual.
84 #
85 # pythonfile = ~/.offlineimap.py
86 #
87
88 # By default, OfflineIMAP will not exit due to a network error until
89 # the operating system returns an error code. Operating systems can sometimes
90 # take forever to notice this. Here you can activate a timeout on the
91 # socket. This timeout applies to individual socket reads and writes,
92 # not to an overall sync operation. You could perfectly well have a 30s
93 # timeout here and your sync still take minutes.
94 #
95 # Values in the 30-120 second range are reasonable.
96 #
97 # The default is to have no timeout beyond the OS. Times are given in seconds.
98 #
99 # socktimeout = 60
100
101 # By default, OfflineIMAP will use fsync() to force data out to disk at
102 # opportune times to ensure consistency. This can, however, reduce
103 # performance. Users where /home is on SSD (Flash) may also wish to reduce
104 # write cycles. Therefore, you can disable OfflineIMAP's use of fsync().
105 # Doing so will come at the expense of greater risk of message duplication
106 # in the event of a system crash or power loss. Default is fsync = true.
107 # Set fsync = false ot disable fsync.
108 #
109 # fsync = true
110
111 ##################################################
112 # Mailbox name recorder
113 ##################################################
114
115 [mbnames]
116
117 # offlineimap can record your mailbox names in a format you specify.
118 # You can define the header, each mailbox item, the separator,
119 # and the footer. Here is an example for Mutt.
120 # If enabled is yes, all six setting must be specified, even if they
121 # are just the empty string "".
122 #
123 # The header, peritem, sep, and footer are all Python expressions passed
124 # through eval, so you can (and must) use Python quoting.
125
126 enabled = no
127 filename = ~/Mutt/muttrc.mailboxes
128 header = "mailboxes "
129 peritem = "+%(accountname)s/%(foldername)s"
130 sep = " "
131 footer = "\n"
132
133 # You can also specify a folderfilter. It will apply to the
134 # *translated* folder name here, and it takes TWO arguments:
135 # accountname and foldername. In all other ways, it will
136 # behave identically to the folderfilter for accounts. Please see
137 # that section for more information and examples.
138 #
139 # Note that this filter can be used only to further restrict mbnames
140 # to a subset of folders that pass the account's folderfilter.
141
142 [ui.Curses.Blinkenlights]
143 # Character used to indicate thread status.
144
145 statuschar = .
146
147 ##################################################
148 # Accounts
149 ##################################################
150
151 # This is an account definition clause. You'll have one of these
152 # for each account listed in general/accounts above.
153
154 [Account Test]
155 ########## Basic settings
156
157 # These settings specify the two folders that you will be syncing.
158 # You'll need to have a "Repository ..." section for each one.
159
160 localrepository = LocalExample
161 remoterepository = RemoteExample
162
163 ########## Advanced settings
164
165 # You can have offlineimap continue running indefinately, automatically
166 # syncing your mail periodically. If you want that, specify how
167 # frequently to do that (in minutes) here. You can also specify
168 # fractional minutes (ie, 3.25).
169
170 # autorefresh = 5
171
172 # You can tell offlineimap to do a number of quicker synchronizations
173 # between full updates. A quick synchronization only synchronizes
174 # if a Maildir folder has changed, or if an IMAP folder has received
175 # new messages or had messages deleted. It does not update if the
176 # only changes were to IMAP flags. Specify 0 to never do quick updates,
177 # -1 to always do quick updates, or a positive integer to do that many
178 # quick updates between each full synchronization (requires autorefresh).
179
180 # quick = 10
181
182 [Repository LocalExample]
183
184 # This is one of the two repositories that you'll work with given the
185 # above example. Each repository requires a "type" declaration.
186 #
187 # The types supported are Maildir and IMAP.
188 #
189
190 type = Maildir
191
192 # Specify local repository. Your IMAP folders will be synchronized
193 # to maildirs created under this path. OfflineIMAP will create the
194 # maildirs for you as needed.
195
196 localfolders = ~/Test
197
198 # You can specify the "path separator character" used for your Maildir
199 # folders. This is inserted in-between the components of the tree.
200 # It defaults to ".". If you want your Maildir folders to be nested,
201 # set it to "/".
202
203 sep = .
204
205 # Some users on *nix platforms may not want the atime (last access
206 # time) to be modified by OfflineIMAP. In these cases, they would
207 # want to set restoreatime to yes. OfflineIMAP will make an effort
208 # to not touch the atime if you do that.
209 #
210 # In most cases, the default of no should be sufficient.
211
212 restoreatime = no
213
214 [Repository RemoteExample]
215
216 # And this is the remote repository. We only support IMAP or Gmail here.
217
218 type = IMAP
219
220 # The following can fetch the account credentials via a python expression that
221 # is parsed from the pythonfile parameter. For example, a function called
222 # "getcredentials" that parses a file "filename" and returns the account
223 # details for "hostname".
224 # remotehosteval = getcredentials("filename", "hostname", "hostname")
225 # remoteusereval = getcredentials("filename", "hostname", "user")
226 # remotepasseval = getcredentials("filename", "hostname", "passwd")
227
228 # Specify the remote hostname.
229 remotehost = examplehost
230
231 # Whether or not to use SSL.
232 ssl = yes
233
234 # SSL Client certificate (optional)
235 # sslclientcert = /path/to/file.crt
236
237 # SSL Client key (optional)
238 # sslclientkey = /path/to/file.key
239
240 # Specify the port. If not specified, use a default port.
241 # remoteport = 993
242
243 # Specify the remote user name.
244 remoteuser = username
245
246 # There are five ways to give the password for the remote IMAP
247 # server:
248 #
249 # 1. No password at all specified in the config file. If a matching
250 # entry is found in ~/.netrc (see netrc (5) for information) the
251 # password from the matching entry will be used. Otherwise you
252 # will be prompted for the password when OfflineIMAP starts.
253 #
254 # 2. The remote password stored in this file with the remotepass
255 # option. Example:
256 #
257 # remotepass = mypassword
258 #
259 # 3. The remote password stored as a single line in an external
260 # file, which is referenced by the remotefile option. Example:
261 #
262 # remotepassfile = ~/Password.IMAP.Account1
263 #
264 # 4. With a preauth tunnel. With this method, you invoke an external
265 # program that is guaranteed *NOT* to ask for a password, but rather
266 # to read from stdin and write to stdout an IMAP procotol stream
267 # that begins life in the PREAUTH state. When you use a tunnel,
268 # you do NOT specify a user or password (if you do, they'll be
269 # ignored.) Instead, you specify a preauthtunnel, as this
270 # example illustrates for Courier IMAP on Debian:
271 #
272 # preauthtunnel = ssh -q imaphost '/usr/bin/imapd ./Maildir'
273 #
274 # 5. If you are using Kerberos and have the Python Kerberos package installed,
275 # you should not specify a remotepass. If the user has a valid
276 # Kerberos TGT, OfflineIMAP will figure out the rest all by itself, and
277 # fall back to password authentication if needed.
278
279 ########## Advanced settings
280
281 # Some IMAP servers need a "reference" which often refers to the
282 # "folder root". This is most commonly needed with UW IMAP, where
283 # you might need to specify the directory in which your mail is
284 # stored. Most users will not need this.
285 #
286 # reference = Mail
287
288 # OfflineIMAP can use multiple connections to the server in order
289 # to perform multiple synchronization actions simultaneously.
290 # This may place a higher burden on the server. In most cases,
291 # setting this value to 2 or 3 will speed up the sync, but in some
292 # cases, it may slow things down. The safe answer is 1. You should
293 # probably never set it to a value more than 5.
294
295 maxconnections = 1
296
297 # OfflineIMAP normally closes IMAP server connections between refreshes if
298 # the global option autorefresh is specified. If you wish it to keep the
299 # connection open, set this to true. If not specified, the default is
300 # false. Keeping the connection open means a faster sync start the
301 # next time and may use fewer server resources on connection, but uses
302 # more server memory. This setting has no effect if autorefresh is not set.
303
304 holdconnectionopen = no
305
306 # If you want to have "keepalives" sent while waiting between syncs,
307 # specify the amount of time IN SECONDS between keepalives here. Note that
308 # sometimes more than this amount of time might pass, so don't make it
309 # tight. This setting has no effect if autorefresh and holdconnectionopen
310 # are not both set.
311
312 # keepalive = 60
313
314 # Normally, OfflineIMAP will expunge deleted messages from the server.
315 # You can disable that if you wish. This means that OfflineIMAP will
316 # mark them deleted on the server, but not actually delete them.
317 # You must use some other IMAP client to delete them if you use this
318 # setting; otherwise, the messgaes will just pile up there forever.
319 # Therefore, this setting is definately NOT recommended.
320 #
321 # expunge = no
322 # You can specify a folder translator. This must be a eval-able
323 # Python expression that takes a foldername arg and returns the new
324 # value. I suggest a lambda. This example below will remove "INBOX." from
325 # the leading edge of folders (great for Courier IMAP users)
326 #
327 # WARNING: you MUST construct this such that it NEVER returns
328 # the same value for two folders, UNLESS the second values are
329 # filtered out by folderfilter below. Failure to follow this rule
330 # will result in undefined behavior
331 #
332 # nametrans = lambda foldername: re.sub('^INBOX\.', '', foldername)
333
334 # Using Courier remotely and want to duplicate its mailbox naming
335 # locally? Try this:
336 #
337 # nametrans = lambda foldername: re.sub('^INBOX\.*', '.', foldername)
338
339 # You can specify which folders to sync. You can do it several ways.
340 # I'll provide some examples. The folderfilter operates on the
341 # *UNTRANSLATED* name, if you specify nametrans. It should return
342 # true if the folder is to be included; false otherwise.
343 #
344 # Example 1: synchronizing only INBOX and Sent.
345 #
346 # folderfilter = lambda foldername: foldername in ['INBOX', 'Sent']
347 #
348 # Example 2: synchronizing everything except Trash.
349 #
350 # folderfilter = lambda foldername: foldername not in ['Trash']
351 #
352 # Example 3: Using a regular expression to exclude Trash and all folders
353 # containing the characters "Del".
354 #
355 # folderfilter = lambda foldername: not re.search('(^Trash$|Del)', foldername)
356 #
357 # If folderfilter is not specified, ALL remote folders will be
358 # synchronized.
359 #
360 # You can span multiple lines by indenting the others. (Use backslashes
361 # at the end when required by Python syntax) For instance:
362 #
363 # folderfilter = lambda foldername: foldername in
364 # ['INBOX', 'Sent Mail', 'Deleted Items',
365 # 'Received']
366 #
367 # FYI, you could also include every folder with:
368 #
369 # folderfilter = lambda foldername: 1
370 #
371 # And exclude every folder with:
372 #
373 # folderfilter = lambda foldername: 0
374
375 # You can specify folderincludes to include additional folders.
376 # It should return a Python list. This might be used to include a
377 # folder that was excluded by your folderfilter rule, to include a
378 # folder that your server does not specify with its LIST option, or
379 # to include a folder that is outside your basic reference. Some examples:
380 #
381 # To include debian.user and debian.personal:
382 #
383 # folderincludes = ['debian.user', 'debian.personal']
384 #
385 # To include your INBOX (UW IMAPd users will find this useful if they
386 # specify a reference):
387 #
388 # folderincludes = ['INBOX']
389 #
390 # To specify a long list:
391 #
392 # folderincludes = ['box1', 'box2', 'box3', 'box4',
393 # 'box5', 'box6']
394
395 # You can specify foldersort to determine how folders are sorted.
396 # This affects order of synchronization and mbnames. The expression
397 # should return -1, 0, or 1, as the default Python cmp() does. The
398 # two arguments, x and y, are strings representing the names of the folders
399 # to be sorted. The sorting is applied *AFTER* nametrans, if any.
400 #
401 # To reverse the sort:
402 #
403 # foldersort = lambda x, y: -cmp(x, y)
404
405
406 [Repository GmailExample]
407
408 # A repository using Gmail's IMAP interface. Any configuration
409 # parameter of `IMAP` type repositories can be used here. Only
410 # `remoteuser` (or `remoteusereval` ) is mandatory. Default values
411 # for other parameters are OK, and you should not need fiddle with
412 # those.
413 #
414 # The Gmail repository will use hard-coded values for `remotehost`,
415 # `remoteport`, `tunnel` and `ssl`. (See
416 # http://mail.google.com/support/bin/answer.py?answer=78799&topic=12814)
417 # Any attempt to set those parameters will be silently ignored.
418 #
419
420 type = Gmail
421
422 # Specify the Gmail user name. This is the only mandatory parameter.
423 remoteuser = username@gmail.com
424
425 # Deleting a message from a Gmail folder via the IMAP interface will
426 # just remove that folder's label from the message: the message will
427 # continue to exist in the '[Gmail]/All Mail' folder. If `realdelete`
428 # is set to `True`, then deleted messages will really be deleted
429 # during `offlineimap` sync, by moving them to the '[Gmail]/Trash'
430 # folder. BEWARE: this will deleted a messages from *all folders* it
431 # belongs to!
432 #
433 # See http://mail.google.com/support/bin/answer.py?answer=77657&topic=12815
434 realdelete = no