mbsync.1 30 KB

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