mbsync.1 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. .ig
  2. \" mbsync - mailbox synchronizer
  3. \" Copyright (C) 2000-2002 Michael R. Elkins <me@mutt.org>
  4. \" Copyright (C) 2002-2004,2011-2015 Oswald Buddenhagen <ossi@users.sf.net>
  5. \" Copyright (C) 2004 Theodore Y. Ts'o <tytso@mit.edu>
  6. \"
  7. \" This program is free software; you can redistribute it and/or modify
  8. \" it under the terms of the GNU General Public License as published by
  9. \" the Free Software Foundation; either version 2 of the License, or
  10. \" (at your option) any later version.
  11. \"
  12. \" This program is distributed in the hope that it will be useful,
  13. \" but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. \" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. \" GNU General Public License for more details.
  16. \"
  17. \" You should have received a copy of the GNU General Public License
  18. \" along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. \"
  20. \" As a special exception, mbsync may be linked with the OpenSSL library,
  21. \" despite that library's more restrictive license.
  22. ..
  23. .TH mbsync 1 "2015 Mar 22"
  24. ..
  25. .SH NAME
  26. mbsync - synchronize IMAP4 and Maildir mailboxes
  27. ..
  28. .SH SYNOPSIS
  29. \fBmbsync\fR [\fIoptions\fR ...] {{\fIchannel\fR[\fB:\fIbox\fR[{\fB,\fR|\fB\\n\fR}...]]|\fIgroup\fR} ...|\fB-a\fR}
  30. ..
  31. .SH DESCRIPTION
  32. \fBmbsync\fR is a command line application which synchronizes mailboxes;
  33. currently Maildir and IMAP4 mailboxes are supported.
  34. New messages, message deletions and flag changes can be propagated both ways;
  35. the operation set can be selected in a fine-grained manner.
  36. .br
  37. Synchronization is based on unique message identifiers (UIDs), so no
  38. identification conflicts can occur (unlike with some other mail synchronizers).
  39. OTOH, \fBmbsync\fR is susceptible to UID validity changes (that \fIshould\fR
  40. never happen, but see "Compatibility" in the README).
  41. Synchronization state is kept in one local text file per mailbox pair;
  42. these files are protected against concurrent \fBmbsync\fR processes.
  43. Mailboxes can be safely modified while \fBmbsync\fR operates
  44. (see \fBINHERENT PROBLEMS\fR below for a minor exception).
  45. Multiple replicas of each mailbox can be maintained.
  46. ..
  47. .SH OPTIONS
  48. .TP
  49. \fB-c\fR, \fB--config\fR \fIfile\fR
  50. Read configuration from \fIfile\fR.
  51. By default, the configuration is read from ~/.mbsyncrc.
  52. .TP
  53. \fB-a\fR, \fB--all\fR
  54. Select all configured channels. Any channel/group specifications on the command
  55. line are ignored.
  56. .TP
  57. \fB-l\fR, \fB--list\fR
  58. Don't synchronize anything, but list all mailboxes in the selected channels
  59. and exit.
  60. .TP
  61. \fB-C\fR[\fBm\fR][\fBs\fR], \fB--create\fR[\fB-master\fR|\fB-slave\fR]
  62. Override any \fBCreate\fR options from the config file. See below.
  63. .TP
  64. \fB-R\fR[\fBm\fR][\fBs\fR], \fB--remove\fR[\fB-master\fR|\fB-slave\fR]
  65. Override any \fBRemove\fR options from the config file. See below.
  66. .TP
  67. \fB-X\fR[\fBm\fR][\fBs\fR], \fB--expunge\fR[\fB-master\fR|\fB-slave\fR]
  68. Override any \fBExpunge\fR options from the config file. See below.
  69. .TP
  70. {\fB-n\fR|\fB-N\fR|\fB-d\fR|\fB-f\fR|\fB-0\fR|\fB-F\fR},\
  71. {\fB--new\fR|\fB--renew\fR|\fB--delete\fR|\fB--flags\fR|\fB--noop\fR|\fB--full\fR}
  72. .TP
  73. \r{\fB-L\fR|\fB-H\fR}[\fBn\fR][\fBN\fR][\fBd\fR][\fBf\fR],\
  74. {\fB--pull\fR|\fB--push\fR}[\fB-new\fR|\fB-renew\fR|\fB-delete\fR|\fB-flags\fR]
  75. Override any \fBSync\fR options from the config file. See below.
  76. .TP
  77. \fB-h\fR, \fB--help\fR
  78. Display a summary of command line options.
  79. .TP
  80. \fB-v\fR, \fB--version\fR
  81. Display version information.
  82. .TP
  83. \fB-V\fR, \fB--verbose\fR
  84. Enable \fIverbose\fR mode, which displays what is currently happening.
  85. .TP
  86. \fB-D\fR[\fBC\fR][\fBm\fR][\fBM\fR][\fBn\fR|\fBN\fR][\fBs\fR]\fR]\fR,\
  87. \fB--debug\fR[\fB-crash\fR|\fB-maildir\fR|\fB-main\fR|\fB-net\fR|\fB-net-all\fR|\fB-sync\fR]
  88. Enable debugging categories:
  89. .in +4
  90. \fBC\fR, \fBcrash\fR - use built-in crash handler
  91. .br
  92. \fBm\fR, \fBmaildir\fR - print maildir debug info
  93. .br
  94. \fBM\fR, \fBmain\fR - print main debug info
  95. .br
  96. \fBn\fR, \fBnet\fR - print network traffic (protocol only)
  97. .br
  98. \fBN\fR, \fBnet-all\fR - print network traffic (including payloads)
  99. .br
  100. \fBs\fR, \fBsync\fR - print synchronization debug info
  101. .in -4
  102. All categories except \fBcrash\fR implictly enable \fIverbose\fR mode.
  103. Without category specification, all categories except net-all are enabled.
  104. .TP
  105. \fB-q\fR, \fB--quiet\fR
  106. Suppress progress counters (this is implicit if stdout is no TTY,
  107. or any debugging categories are enabled) and notices.
  108. If specified twice, suppress warning messages as well.
  109. ..
  110. .SH CONFIGURATION
  111. The configuration file is mandatory; \fBmbsync\fR will not run without it.
  112. Lines starting with a hash mark (\fB#\fR) are comments and are ignored entirely.
  113. Configuration items are keywords followed by one or more arguments;
  114. arguments containing spaces must be enclosed in double quotes (\fB"\fR),
  115. and literal double quotes and backslashes (\fB\\\fR) must be backslash-escaped.
  116. All keywords (including those used as arguments) are case-insensitive.
  117. Bash-like home directory expansion using the tilde (\fB~\fR) is supported
  118. in all options which represent local paths.
  119. There are a few global options, the rest applies to particular sections.
  120. Sections are started by a section keyword and are terminated by an empty line
  121. or end of file.
  122. Every section defines an object with an identifier unique within that
  123. object class.
  124. .P
  125. There are two basic object classes: Stores and Channels. A Store defines
  126. a collection of mailboxes; basically a folder, either local or remote.
  127. A Channel connects two Stores, describing the way the two are synchronized.
  128. .br
  129. There are two auxiliary object classes: Accounts and Groups. An Account
  130. describes the connection part of remote Stores, so a server connection can be
  131. shared between multiple Stores. A Group aggregates multiple Channels to
  132. save typing on the command line.
  133. .P
  134. File system locations (in particular, \fBPath\fR and \fBInbox\fR) use the
  135. Store's internal path separators, which may be slashes, periods, etc., or
  136. even combinations thereof.
  137. .br
  138. Mailbox names, OTOH, always use canonical path separators, which are
  139. Unix-like forward slashes.
  140. ..
  141. .SS All Stores
  142. These options can be used in all supported Store types.
  143. .br
  144. In this context, the term "remote" describes the second Store within a Channel,
  145. and not necessarily a remote server.
  146. .br
  147. The special mailbox \fBINBOX\fR exists in every Store; its physical location
  148. in the file system is Store type specific.
  149. ..
  150. .TP
  151. \fBPath\fR \fIpath\fR
  152. The location of the Store in the (server's) file system.
  153. If this is no absolute path, the reference point is Store type specific.
  154. This string is prepended to the mailbox names addressed in this Store,
  155. but is not considered part of them; this is important for \fBPatterns\fR
  156. in the Channels section.
  157. Note that you \fBmust\fR append a slash if you want to specify an entire
  158. directory.
  159. (Default: none)
  160. ..
  161. .TP
  162. \fBMaxSize\fR \fIsize\fR[\fBk\fR|\fBm\fR][\fBb\fR]
  163. Messages larger than that will not be propagated into this Store.
  164. This is useful for weeding out messages with large attachments.
  165. \fBK\fR and \fBM\fR can be appended to the size to specify KiBytes resp.
  166. MeBytes instead of bytes. \fBB\fR is accepted but superfluous.
  167. If \fIsize\fR is 0, the maximum message size is \fBunlimited\fR.
  168. (Default: \fI0\fR)
  169. ..
  170. .TP
  171. \fBMapInbox\fR \fImailbox\fR
  172. Create a virtual mailbox (relative to \fBPath\fR) which aliases
  173. the \fBINBOX\fR. Makes sense in conjunction with \fBPatterns\fR in the
  174. Channels section, though with a Maildir slave, you probably want to
  175. place \fBInbox\fR under \fBPath\fR instead.
  176. This virtual mailbox does not support subfolders.
  177. ..
  178. .TP
  179. \fBFlatten\fR \fIdelim\fR
  180. Flatten the hierarchy within this Store by substituting the canonical
  181. hierarchy delimiter \fB/\fR with \fIdelim\fR.
  182. This can be useful when the MUA used to access the Store provides
  183. suboptimal handling of hierarchical mailboxes, as is the case with
  184. \fBMutt\fR.
  185. A common choice for the delimiter is \fB.\fR.
  186. .br
  187. Note that flattened sub-folders of the \fBINBOX\fR always end up
  188. under \fBPath\fR, including the "INBOX\fIdelim\fR" prefix.
  189. ..
  190. .TP
  191. \fBTrash\fR \fImailbox\fR
  192. Specifies a mailbox (relative to \fBPath\fR) to copy deleted messages to
  193. prior to expunging.
  194. See \fBRECOMMENDATIONS\fR and \fBINHERENT PROBLEMS\fR below.
  195. (Default: none)
  196. ..
  197. .TP
  198. \fBTrashNewOnly\fR \fByes\fR|\fBno\fR
  199. When trashing, copy only not yet propagated messages. This makes sense if the
  200. remote Store has a \fBTrash\fR as well (with \fBTrashNewOnly\fR \fBno\fR).
  201. (Default: \fBno\fR)
  202. ..
  203. .TP
  204. \fBTrashRemoteNew\fR \fByes\fR|\fBno\fR
  205. When expunging the remote Store, copy not yet propagated messages to this
  206. Store's \fBTrash\fR. When using this, the remote Store does not need an own
  207. \fBTrash\fR at all, yet all messages are archived.
  208. (Default: \fBno\fR)
  209. ..
  210. .SS Maildir Stores
  211. The reference point for relative \fBPath\fRs is the current working directory.
  212. .P
  213. As \fBmbsync\fR needs UIDs, but no standardized UID storage scheme exists for
  214. Maildir, \fBmbsync\fR supports two schemes, each with its pros and cons.
  215. .br
  216. The \fBnative\fR scheme is stolen from the latest Maildir patches to \fBc-client\fR
  217. and is therefore compatible with \fBpine\fR. The UID validity is stored in a
  218. file named .uidvalidity; the UIDs are encoded in the file names of the messages.
  219. .br
  220. The \fBalternative\fR scheme is based on the UID mapping used by \fBisync\fR
  221. versions 0.8 and 0.9.x. The invariant parts of the file names of the messages
  222. are used as keys into a Berkeley database named .isyncuidmap.db, which holds
  223. the UID validity as well.
  224. .br
  225. The \fBnative\fR scheme is faster, more space efficient, endianness independent
  226. and "human readable", but will be disrupted if a message is copied from another
  227. mailbox without getting a new file name; this would result in duplicated UIDs
  228. sooner or later, which in turn results in a UID validity change, making
  229. synchronization fail.
  230. The \fBalternative\fR scheme would fail if a MUA changed a message's file name
  231. in a part \fBmbsync\fR considers invariant; this would be interpreted as a
  232. message deletion and a new message, resulting in unnecessary traffic.
  233. .br
  234. \fBMutt\fR is known to work fine with both schemes.
  235. .br
  236. Use \fBmdconvert\fR to convert mailboxes from one scheme to the other.
  237. ..
  238. .TP
  239. \fBMaildirStore\fR \fIname\fR
  240. Define the Maildir Store \fIname\fR, opening a section for its parameters.
  241. ..
  242. .TP
  243. \fBAltMap\fR \fByes\fR|\fBno\fR
  244. Use the \fBalternative\fR UID storage scheme for mailboxes in this Store.
  245. This does not affect mailboxes that do already have a UID storage scheme;
  246. use \fBmdconvert\fR to change it.
  247. (Default: \fBno\fR)
  248. ..
  249. .TP
  250. \fBInbox\fR \fIpath\fR
  251. The location of the \fBINBOX\fR. This is \fInot\fR relative to \fBPath\fR,
  252. but it is allowed to place the \fBINBOX\fR inside the \fBPath\fR.
  253. (Default: \fI~/Maildir\fR)
  254. ..
  255. .TP
  256. \fBInfoDelimiter\fR \fIdelim\fR
  257. The character used to delimit the info field from a message's basename.
  258. The Maildir standard defines this to be the colon, but this is incompatible
  259. with DOS/Windows file systems.
  260. (Default: the value of \fBFieldDelimiter\fR)
  261. ..
  262. .TP
  263. \fBSubFolders\fR \fBVerbatim\fR|\fBMaildir++\fR|\fBLegacy\fR
  264. The on-disk folder naming style used for hierarchical mailboxes.
  265. This has option has no effect when \fBFlatten\fR is used.
  266. .br
  267. Suppose mailboxes with the canonical paths \fBtop/sub/subsub\fR and
  268. \fBINBOX/sub/subsub\fR, the styles will yield the following on-disk paths:
  269. .br
  270. \fBVerbatim\fR - \fIPath\fB/top/sub/subsub\fR and \fIInbox\fB/sub/subsub\fR
  271. (this is the style you probably want to use)
  272. .br
  273. \fBMaildir++\fR - \fIInbox\fB/.top.sub.subsub\fR and \fIInbox\fB/..sub.subsub\fR
  274. (this style is compatible with Courier and Dovecot - but note that
  275. the mailbox metadata format is \fInot\fR compatible).
  276. Note that attempts to set \fBPath\fR are rejected in this mode.
  277. .br
  278. \fBLegacy\fR - \fIPath\fB/top/.sub/.subsub\fR and \fIInbox\fB/.sub/.subsub\fR
  279. (this is \fBmbsync\fR's historical style)
  280. .br
  281. (Default: unset; will error out when sub-folders are encountered)
  282. ..
  283. .SS IMAP4 Accounts
  284. .TP
  285. \fBIMAPAccount\fR \fIname\fR
  286. Define the IMAP4 Account \fIname\fR, opening a section for its parameters.
  287. ..
  288. .TP
  289. \fBHost\fR \fIhost\fR
  290. Specify the DNS name or IP address of the IMAP server.
  291. .br
  292. If \fBTunnel\fR is used, this setting is needed only if \fBSSLType\fR is
  293. not \fBNone\fR and \fBCertificateFile\fR is not used,
  294. in which case the host name is used for certificate subject verification.
  295. ..
  296. .TP
  297. \fBPort\fR \fIport\fR
  298. Specify the TCP port number of the IMAP server. (Default: 143 for IMAP,
  299. 993 for IMAPS)
  300. .br
  301. If \fBTunnel\fR is used, this setting is ignored.
  302. ..
  303. .TP
  304. \fBTimeout\fR \fItimeout\fR
  305. Specify the connect and data timeout for the IMAP server in seconds.
  306. Zero means unlimited.
  307. (Default: \fI20\fR)
  308. ..
  309. .TP
  310. \fBUser\fR \fIusername\fR
  311. Specify the login name on the IMAP server.
  312. ..
  313. .TP
  314. \fBPass\fR \fIpassword\fR
  315. Specify the password for \fIusername\fR on the IMAP server.
  316. Note that this option is \fInot\fR required.
  317. If neither a password nor a password command is specified in the
  318. configuration file, \fBmbsync\fR will prompt you for a password.
  319. ..
  320. .TP
  321. \fBPassCmd\fR [\fB+\fR]\fIcommand\fR
  322. Specify a shell command to obtain a password rather than specifying a
  323. password directly. This allows you to use password files and agents.
  324. The command must produce exactly one line on stdout; the trailing newline is
  325. optional.
  326. Prepend \fB+\fR to the command to indicate that it produces TTY output
  327. (e.g., a decryption password prompt); failure to do so will merely produce
  328. messier output.
  329. ..
  330. .TP
  331. \fBTunnel\fR \fIcommand\fR
  332. Specify a command to run to establish a connection rather than opening a TCP
  333. socket. This allows you to run an IMAP session over an SSH tunnel, for
  334. example.
  335. ..
  336. .TP
  337. \fBAuthMechs\fR \fItype\fR ...
  338. The list of acceptable authentication mechanisms.
  339. In addition to the mechanisms listed in the SASL registry (link below),
  340. the legacy IMAP \fBLOGIN\fR mechanism is known.
  341. The wildcard \fB*\fR represents all mechanisms that are deemed secure
  342. enough for the current \fBSSLType\fR setting.
  343. The actually used mechanism is the most secure choice from the intersection
  344. of this list, the list supplied by the server, and the installed SASL modules.
  345. (Default: \fB*\fR)
  346. ..
  347. .TP
  348. \fBSSLType\fR {\fBNone\fR|\fBSTARTTLS\fR|\fBIMAPS\fR}
  349. Select the connection security/encryption method:
  350. .br
  351. \fBNone\fR - no security.
  352. This is the default when \fBTunnel\fR is set, as tunnels are usually secure.
  353. .br
  354. \fBSTARTTLS\fR - security is established via the STARTTLS extension
  355. after connecting the regular IMAP port 143. Most servers support this,
  356. so it is the default (unless a tunnel is used).
  357. .br
  358. \fBIMAPS\fR - security is established by starting SSL/TLS negotiation
  359. right after connecting the secure IMAP port 993.
  360. ..
  361. .TP
  362. \fBSSLVersions\fR [\fBSSLv2\fR] [\fBSSLv3\fR] [\fBTLSv1\fR] [\fBTLSv1.1\fR] [\fBTLSv1.2\fR]
  363. Select the acceptable SSL/TLS versions.
  364. Use of SSLv2 is strongly discouraged for security reasons, but might be the
  365. only option on some very old servers.
  366. Generally, the newest TLS version is recommended, but as this confuses some
  367. servers, \fBTLSv1\fR is the default.
  368. ..
  369. .TP
  370. \fBSystemCertificates\fR \fByes\fR|\fBno\fR
  371. Whether the system's default root cerificate store should be loaded.
  372. (Default: \fByes\fR)
  373. ..
  374. .TP
  375. \fBCertificateFile\fR \fIpath\fR
  376. File containing additional X.509 certificates used to verify server
  377. identities. Directly matched peer certificates are always trusted,
  378. regardless of validity.
  379. .br
  380. Note that the system's default certificate store is always used
  381. (unless \fBSystemCertificates\fR is disabled)
  382. and should not be specified here.
  383. ..
  384. .TP
  385. \fBClientCertificate\fR \fIpath\fR
  386. File containing a client certificate to send to the server.
  387. \fBClientKey\fR should also be specified.
  388. .br
  389. Note that client certificate verification is usually not required,
  390. so it is unlikely that you need this option.
  391. ..
  392. .TP
  393. \fBClientKey\fR \fIpath\fR
  394. File containing the private key corresponding to \fBClientCertificate\fR.
  395. ..
  396. .TP
  397. \fBPipelineDepth\fR \fIdepth\fR
  398. Maximum number of IMAP commands which can be simultaneously in flight.
  399. Setting this to \fI1\fR disables pipelining.
  400. This is mostly a debugging option, but may also be used to limit average
  401. bandwidth consumption (GMail may require this if you have a very fast
  402. connection), or to spare flaky servers like M$ Exchange.
  403. (Default: \fIunlimited\fR)
  404. ..
  405. .TP
  406. \fBDisableExtension\fR[\fBs\fR] \fIextension\fR ...
  407. Disable the use of specific IMAP extensions.
  408. This can be used to work around bugs in servers
  409. (and possibly \fBmbsync\fR itself).
  410. (Default: empty)
  411. ..
  412. .SS IMAP Stores
  413. The reference point for relative \fBPath\fRs is whatever the server likes it
  414. to be; probably the user's $HOME or $HOME/Mail on that server. The location
  415. of \fBINBOX\fR is up to the server as well and is usually irrelevant.
  416. .TP
  417. \fBIMAPStore\fR \fIname\fR
  418. Define the IMAP4 Store \fIname\fR, opening a section for its parameters.
  419. ..
  420. .TP
  421. \fBAccount\fR \fIaccount\fR
  422. Specify which IMAP4 Account to use. Instead of defining an Account and
  423. referencing it here, it is also possible to specify all the Account options
  424. directly in the Store's section - this makes sense if an Account is used for
  425. one Store only anyway.
  426. ..
  427. .TP
  428. \fBUseNamespace\fR \fByes\fR|\fBno\fR
  429. Selects whether the server's first "personal" NAMESPACE should be prefixed to
  430. mailbox names. Disabling this makes sense for some broken IMAP servers.
  431. This option is meaningless if a \fBPath\fR was specified.
  432. (Default: \fByes\fR)
  433. ..
  434. .TP
  435. \fBPathDelimiter\fR \fIdelim\fR
  436. Specify the server's hierarchy delimiter.
  437. (Default: taken from the server's first "personal" NAMESPACE)
  438. .br
  439. Do \fInot\fR abuse this to re-interpret the hierarchy.
  440. Use \fBFlatten\fR instead.
  441. ..
  442. .SS Channels
  443. .TP
  444. \fBChannel\fR \fIname\fR
  445. Define the Channel \fIname\fR, opening a section for its parameters.
  446. ..
  447. .TP
  448. {\fBMaster\fR|\fBSlave\fR} \fB:\fIstore\fB:\fR[\fImailbox\fR]
  449. Specify the Master resp. Slave Store to be connected by this Channel.
  450. If \fBPatterns\fR are specified, \fImailbox\fR is interpreted as a
  451. prefix which is not matched against the patterns, and which is not
  452. affected by mailbox list overrides.
  453. Otherwise, if \fImailbox\fR is omitted, \fBINBOX\fR is assumed.
  454. ..
  455. .TP
  456. \fBPattern\fR[\fBs\fR] [\fB!\fR]\fIpattern\fR ...
  457. Instead of synchronizing only one mailbox pair, synchronize all mailboxes
  458. that match the \fIpattern\fR(s). The mailbox names are the same on both
  459. Master and Slave. Patterns are IMAP4 patterns, i.e., \fB*\fR matches anything
  460. and \fB%\fR matches anything up to the next hierarchy delimiter. Prepending
  461. \fB!\fR to a pattern makes it an exclusion. Multiple patterns can be specified
  462. (either by supplying multiple arguments or by using \fBPattern\fR multiple
  463. times); later matches take precedence.
  464. .br
  465. Note that \fBINBOX\fR is not matched by wildcards, unless it lives under
  466. \fBPath\fR.
  467. .br
  468. The mailbox list selected by \fBPatterns\fR can be overridden by a mailbox
  469. list in a channel reference (a \fBGroup\fR specification or the command line).
  470. .br
  471. Example: "\fBPatterns\fR\ \fI%\ !Trash\fR"
  472. ..
  473. .TP
  474. \fBMaxSize\fR \fIsize\fR[\fBk\fR|\fBm\fR][\fBb\fR]
  475. Analogous to the homonymous option in the Stores section, but applies equally
  476. to Master and Slave. Note that this actually modifies the Stores, so take care
  477. not to provide conflicting settings if you use the Stores in multiple Channels.
  478. ..
  479. .TP
  480. \fBMaxMessages\fR \fIcount\fR
  481. Sets the maximum number of messages to keep in each Slave mailbox.
  482. This is useful for mailboxes where you keep a complete archive on the server,
  483. but want to mirror only the last messages (for instance, for mailing lists).
  484. The messages that were the first to arrive in the mailbox (independently of
  485. the actual date of the message) will be deleted first.
  486. Messages that are flagged (marked as important) and (by default) unread
  487. messages will not be automatically deleted.
  488. If \fIcount\fR is 0, the maximum number of messages is \fBunlimited\fR
  489. (Default: \fI0\fR).
  490. ..
  491. .TP
  492. \fBExpireUnread\fR \fByes\fR|\fBno\fR
  493. Selects whether unread messages should be affected by \fBMaxMessages\fR.
  494. Normally, unread messages are considered important and thus never expired.
  495. This ensures that you never miss new messages even after an extended absence.
  496. However, if your archive contains large amounts of unread messages by design,
  497. treating them as important would practically defeat \fBMaxMessages\fR. In this
  498. case you need to enable this option.
  499. (Default: \fBno\fR).
  500. ..
  501. .TP
  502. \fBSync\fR {\fBNone\fR|[\fBPull\fR] [\fBPush\fR] [\fBNew\fR] [\fBReNew\fR] [\fBDelete\fR] [\fBFlags\fR]|\fBAll\fR}
  503. Select the synchronization operation(s) to perform:
  504. .br
  505. \fBPull\fR - propagate changes from Master to Slave.
  506. .br
  507. \fBPush\fR - propagate changes from Slave to Master.
  508. .br
  509. \fBNew\fR - propagate newly appeared messages.
  510. .br
  511. \fBReNew\fR - previously refused messages are re-evaluated for propagation.
  512. Useful after flagging affected messages in the source Store or enlarging
  513. MaxSize in the destination Store.
  514. .br
  515. \fBDelete\fR - propagate message deletions. This applies only to messages that
  516. are actually gone, i.e., were expunged. The affected messages in the remote
  517. Store are marked as deleted only, i.e., they won't be really deleted until
  518. that Store is expunged.
  519. .br
  520. \fBFlags\fR - propagate flag changes. Note that Deleted/Trashed is a flag as
  521. well; this is particularly interesting if you use \fBmutt\fR with the
  522. maildir_trash option.
  523. .br
  524. \fBAll\fR (\fB--full\fR on the command line) - all of the above.
  525. This is the global default.
  526. .br
  527. \fBNone\fR (\fB--noop\fR on the command line) - don't propagate anything.
  528. Useful if you want to expunge only.
  529. .IP
  530. \fBPull\fR and \fBPush\fR are direction flags, while \fBNew\fR, \fBReNew\fR,
  531. \fBDelete\fR and \fBFlags\fR are type flags. The two flag classes make up a
  532. two-dimensional matrix (a table). Its cells are the individual actions to
  533. perform. There are two styles of asserting the cells:
  534. .br
  535. In the first style, the flags select entire rows/colums in the matrix. Only
  536. the cells which are selected both horizontally and vertically are asserted.
  537. Specifying no flags from a class is like specifying all flags from this class.
  538. For example, "\fBSync\fR\ \fBPull\fR\ \fBNew\fR\ \fBFlags\fR" will propagate
  539. new messages and flag changes from the Master to the Slave,
  540. "\fBSync\fR\ \fBNew\fR\ \fBDelete\fR" will propagate message arrivals and
  541. deletions both ways, and "\fBSync\fR\ \fBPush\fR" will propagate all changes
  542. from the Slave to the Master.
  543. .br
  544. In the second style, direction flags are concatenated with type flags; every
  545. compound flag immediately asserts a cell in the matrix. In addition to at least
  546. one compound flag, the individual flags can be used as well, but as opposed to
  547. the first style, they immediately assert all cells in their respective
  548. row/column. For example,
  549. "\fBSync\fR\ \fBPullNew\fR\ \fBPullDelete\fR\ \fBPush\fR" will propagate
  550. message arrivals and deletions from the Master to the Slave and any changes
  551. from the Slave to the Master.
  552. Note that it is not allowed to assert a cell in two ways, e.g.
  553. "\fBSync\fR\ \fBPullNew\fR\ \fBPull\fR" and
  554. "\fBSync\fR\ \fBPullNew\fR\ \fBDelete\fR\ \fBPush\fR" induce error messages.
  555. ..
  556. .TP
  557. \fBCreate\fR {\fBNone\fR|\fBMaster\fR|\fBSlave\fR|\fBBoth\fR}
  558. Automatically create missing mailboxes [on the Master/Slave].
  559. Otherwise print an error message and skip that mailbox pair if a mailbox
  560. and the corresponding sync state does not exist.
  561. (Global default: \fBNone\fR)
  562. ..
  563. .TP
  564. \fBRemove\fR {\fBNone\fR|\fBMaster\fR|\fBSlave\fR|\fBBoth\fR}
  565. Propagate mailbox deletions [to the Master/Slave].
  566. Otherwise print an error message and skip that mailbox pair if a mailbox
  567. does not exist but the corresponding sync state does.
  568. .br
  569. For MailDir mailboxes it is sufficient to delete the cur/ subdirectory to
  570. mark them as deleted. This ensures compatibility with \fBSyncState *\fR.
  571. .br
  572. Note that for safety, non-empty mailboxes are never deleted.
  573. .br
  574. (Global default: \fBNone\fR)
  575. ..
  576. .TP
  577. \fBExpunge\fR {\fBNone\fR|\fBMaster\fR|\fBSlave\fR|\fBBoth\fR}
  578. Permanently remove all messages [on the Master/Slave] marked for deletion.
  579. See \fBRECOMMENDATIONS\fR below.
  580. (Global default: \fBNone\fR)
  581. ..
  582. .TP
  583. \fBCopyArrivalDate\fR {\fByes\fR|\fBno\fR}
  584. Selects whether their arrival time should be propagated together with
  585. the messages.
  586. Enabling this makes sense in order to keep the time stamp based message
  587. sorting intact.
  588. Note that IMAP does not guarantee that the time stamp (termed \fBinternal
  589. date\fR) is actually the arrival time, but it is usually close enough.
  590. (Default: \fBno\fR)
  591. ..
  592. .P
  593. \fBSync\fR, \fBCreate\fR, \fBRemove\fR, \fBExpunge\fR,
  594. \fBMaxMessages\fR, and \fBCopyArrivalDate\fR
  595. can be used before any section for a global effect.
  596. The global settings are overridden by Channel-specific options,
  597. which in turn are overridden by command line switches.
  598. ..
  599. .TP
  600. \fBSyncState\fR {\fB*\fR|\fIpath\fR}
  601. Set the location of this Channel's synchronization state files. \fB*\fR means
  602. that the state should be saved in a file named .mbsyncstate in the
  603. Slave mailbox itself; this has the advantage that you needn't to care for the
  604. state file if you delete the mailbox, but it works only with Maildir mailboxes,
  605. obviously. Otherwise this is interpreted as a string to prepend to the Slave
  606. mailbox name to make up a complete path.
  607. .br
  608. This option can be used outside any section for a global effect. In this case
  609. the appended string is made up according to the pattern
  610. \fB:\fImaster\fB:\fImaster-box\fB_:\fIslave\fB:\fIslave-box\fR
  611. (see also \fBFieldDelimiter\fR below).
  612. .br
  613. (Global default: \fI~/.mbsync/\fR).
  614. ..
  615. .SS Groups
  616. .TP
  617. \fBGroup\fR \fIname\fR [\fIchannel\fR[\fB:\fIbox\fR[\fB,\fR...]]] ...
  618. Define the Group \fIname\fR, opening a section for its parameters.
  619. Note that even though Groups have an own namespace, they will "hide" Channels
  620. with the same name on the command line.
  621. .br
  622. One or more Channels can be specified on the same line.
  623. .br
  624. If you supply one or more \fIbox\fRes to a \fIchannel\fR, they will be used
  625. instead of what is specified in the Channel's Patterns.
  626. The same can be done on the command line, except that there newlines can be
  627. used as mailbox name separators as well.
  628. ..
  629. .TP
  630. \fBChannel\fR[\fBs\fR] \fIchannel\fR[\fB:\fIbox\fR[\fB,\fR...]] ...
  631. Add the specified channels to the group. This option can be specified multiple
  632. times within a Group.
  633. ..
  634. .SS Global Options
  635. .TP
  636. \fBFSync\fR \fByes\fR|\fBno\fR
  637. .br
  638. Selects whether \fBmbsync\fR performs forced flushing, which determines
  639. the level of data safety after system crashes and power outages.
  640. Disabling it is reasonably safe for file systems which are mounted with
  641. data=ordered mode.
  642. Enabling it is a wise choice for file systems mounted with data=writeback,
  643. in particular modern systems like ext4, btrfs and xfs. The performance impact
  644. on older file systems may be disproportionate.
  645. (Default: \fByes\fR)
  646. ..
  647. .TP
  648. \fBFieldDelimiter\fR \fIdelim\fR
  649. The character to use to delimit fields in the string appended to a global
  650. \fBSyncState\fR.
  651. \fBmbsync\fR prefers to use the colon, but this is incompatible with
  652. DOS/Windows file systems.
  653. This option is meaningless for \fBSyncState\fR if the latter is \fB*\fR,
  654. obviously. However, it also determines the default of \fBInfoDelimiter\fR.
  655. (Global default: \fI;\fR on Windows, \fI:\fR everywhere else)
  656. ..
  657. .TP
  658. \fBBufferLimit\fR \fIsize\fR[\fBk\fR|\fBm\fR][\fBb\fR]
  659. The per-Channel, per-direction instantaneous memory usage above which
  660. \fBmbsync\fR will refrain from using more memory. Note that this is no
  661. absolute limit, as even a single message can consume more memory than
  662. this.
  663. (Default: \fI10M\fR)
  664. ..
  665. .SH CONSOLE OUTPUT
  666. If \fBmbsync\fR's output is connected to a console, it will print progress
  667. counters by default. The output will look like this:
  668. .P
  669. .in +4
  670. C: 1/2 B: 3/4 M: +13/13 *23/42 #0/0 S: +0/7 *0/0 #0/0
  671. .in -4
  672. .P
  673. This represents the cumulative progress over channels, boxes, and messages
  674. affected on master and slave, respectively.
  675. The message counts represent added messages, messages with updated flags,
  676. and trashed messages, respectively.
  677. No attempt is made to calculate the totals in advance, so they grow over
  678. time as more information is gathered.
  679. ..
  680. .SH RECOMMENDATIONS
  681. Make sure your IMAP server does not auto-expunge deleted messages - it is
  682. slow, and semantically somewhat questionable. Specifically, Gmail needs to
  683. be configured not to do it.
  684. .P
  685. By default, \fBmbsync\fR will not delete any messages - deletions are
  686. propagated by marking the messages as deleted on the remote store.
  687. Once you have verified that your setup works, you will typically want to
  688. set \fBExpunge\fR to \fBBoth\fR, so that deletions become effective.
  689. .P
  690. \fBmbsync\fR's built-in trash functionality relies on \fBmbsync\fR doing
  691. the expunging of deleted messages. This is the case when it propagates
  692. deletions of previously propagated messages, and the trash is on the target
  693. store (typically your IMAP server).
  694. .br
  695. However, when you intend \fBmbsync\fR to trash messages which were not
  696. propagated yet, the MUA must mark the messages as deleted without expunging
  697. them (e.g., \fBMutt\fR's \fBmaildir_trash\fR option). Note that most
  698. messages are propagated a long time before they are deleted, so this is a
  699. corner case you probably do not want to optimize for. This also implies
  700. that the \fBTrashNewOnly\fR and \fBTrashRemoteNew\fR options are typically
  701. not very useful.
  702. .P
  703. If your server supports auto-trashing (as Gmail does), it is probably a
  704. good idea to rely on that instead of \fBmbsync\fR's trash functionality.
  705. If you do that, and intend to synchronize the trash like other mailboxes,
  706. you should not use \fBmbsync\fR's \fBTrash\fR option at all.
  707. .P
  708. Use of the \fBTrash\fR option with M$ Exchange 2013 requires the use of
  709. \fBDisableExtension MOVE\fR due to a server bug.
  710. ..
  711. .SH INHERENT PROBLEMS
  712. Changes done after \fBmbsync\fR has retrieved the message list will not be
  713. synchronised until the next time \fBmbsync\fR is invoked.
  714. .P
  715. Using \fBTrash\fR on IMAP Stores without the UIDPLUS extension (notably,
  716. M$ Exchange up to at least 2010) bears a race condition: messages will be
  717. lost if they are marked as deleted after the message list was retrieved but
  718. before the mailbox is expunged.
  719. There is no risk as long as the IMAP mailbox is accessed by only one client
  720. (including \fBmbsync\fR) at a time.
  721. ..
  722. .SH FILES
  723. .TP
  724. .B ~/.mbsyncrc
  725. Default configuration file
  726. .TP
  727. .B ~/.mbsync/
  728. Directory containing synchronization state files
  729. ..
  730. .SH SEE ALSO
  731. mdconvert(1), isync(1), mutt(1), maildir(5)
  732. .P
  733. Up to date information on \fBmbsync\fR can be found at http://isync.sf.net/
  734. .P
  735. SASL mechanisms are listed at
  736. http://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
  737. ..
  738. .SH AUTHORS
  739. Originally written by Michael R. Elkins,
  740. rewritten and currently maintained by Oswald Buddenhagen,
  741. contributions by Theodore Y. Ts'o.