isync.1 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. .ig
  2. \" isync - IMAP4 to maildir mailbox synchronizer
  3. \" Copyright (C) 2000-2002 Michael R. Elkins <me@mutt.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. \" As a special exception, isync may be linked with the OpenSSL library,
  20. \" despite that library's more restrictive license.
  21. ..
  22. .TH isync 1 "2002 Dec 22"
  23. ..
  24. .SH NAME
  25. isync - synchronize IMAP4 and maildir mailboxes
  26. ..
  27. .SH SYNOPSIS
  28. \fBisync\fR [\fIoptions...\fR] \fImailbox\fR [\fImailbox ...\fR]
  29. .br
  30. \fBisync\fR [\fIoptions...\fR] \fI-a\fR
  31. .br
  32. \fBisync\fR [\fIoptions...\fR] \fI-l\fR
  33. ..
  34. .SH DESCRIPTION
  35. \fBisync\fR is a command line application which synchronizes a local
  36. maildir-style mailbox with a remote IMAP4 mailbox, suitable for use in
  37. IMAP-disconnected mode. Multiple copies of the remote IMAP4 mailbox can
  38. be maintained, and all flags are synchronized.
  39. ..
  40. .SH OPTIONS
  41. .TP
  42. \fB-c\fR, \fB--config\fR \fIfile\fR
  43. Read configuration from \fIfile\fR.
  44. By default, the configuration is read from ~/.isyncrc if it exists.
  45. .TP
  46. \fB-1\fR, \fB--one-to-one\fR
  47. Instead of using the mailbox specifications in ~/.isyncrc, isync will pick up
  48. all mailboxes from the local directory and remote folder and map them 1:1
  49. onto each other according to their names.
  50. .TP
  51. \fB-I\fR, \fB--inbox\fR \fImailbox\fR
  52. Exception to the 1:1 mapping created by -1: the special IMAP mailbox \fIINBOX\fR
  53. is mapped to the local \fImailbox\fR (relative to the maildir).
  54. .TP
  55. \fB-a\fR, \fB--all\fR
  56. Synchronize all mailboxes (either specified in ~/.isyncrc or determined by the
  57. 1:1 mapping).
  58. .TP
  59. \fB-l\fR, \fB--list\fR
  60. Don't synchronize anything, but list all mailboxes and exit.
  61. .TP
  62. \fB-L\fR, \fB--create-local\fR
  63. Automatically create the local maildir-style mailbox if it doesn't already
  64. exist.
  65. .TP
  66. \fB-R\fR, \fB--create-remote\fR
  67. Automatically create the remote IMAP mailbox if it doesn't already exist.
  68. .TP
  69. \fB-C\fR, \fB--create\fR
  70. Automatically create any mailboxes if they don't already exist.
  71. This is simply a combination of -L and -R.
  72. .TP
  73. \fB-d\fR, \fB--delete\fR
  74. Causes \fBisync\fR to delete messages from the local maildir mailbox
  75. which do not exist on the IMAP server. By default, \fIdead\fR messages
  76. are \fBnot\fR deleted.
  77. .TP
  78. \fB-e\fR, \fB--expunge\fR
  79. Causes \fBisync\fR to permanently remove all messages marked for deletion
  80. in both the local maildir mailbox and the remote IMAP mailbox. By default,
  81. \fIdeleted\fR messages are \fBnot\fR expunged.
  82. .TP
  83. \fB-f\fR, \fB--fast\fR
  84. Causes \fBisync\fR to skip the step of synchronzing message flags between the
  85. local maildir mailbox and the IMAP mailbox. Only new messages existing on the
  86. server will be fetched into the local mailbox.
  87. .TP
  88. \fB-h\fR, \fB--help\fR
  89. Displays a summary of command line options
  90. .TP
  91. \fB-p\fR, \fB--port\fR \fIport\fR
  92. Specifies the port on the IMAP server to connect to (default: 143)
  93. .TP
  94. \fB-q\fR, \fB--quiet\fR
  95. Suppress informational messages.
  96. If specified twice, suppress warning messages as well.
  97. .TP
  98. \fB-r\fR, \fB--remote\fR \fIbox\fR
  99. Specifies the name of the remote IMAP mailbox to synchronize with
  100. (Default: INBOX)
  101. .TP
  102. \fB-s\fR, \fB--host\fR \fB[\fRimaps:\fB]\fR\fIhost\fR
  103. Specifies the hostname of the IMAP server
  104. .TP
  105. \fB-u\fR, \fB--user\fR \fIuser\fR
  106. Specifies the login name to access the IMAP server (default: $USER)
  107. .TP
  108. \fB-M\fR, \fB--maildir\fR \fIdir\fR
  109. Specifies the location for your local mailboxes.
  110. .TP
  111. \fB-F\fR, \fB--folder\fR \fIfolder\fR/
  112. Specifies the location for your remote mailboxes.
  113. .TP
  114. \fB-v\fR, \fB--version\fR
  115. Displays \fBisync\fR version information.
  116. .TP
  117. \fB-V\fR, \fB--verbose\fR
  118. Enables \fIverbose\fR mode, which displays the IMAP4 network traffic.
  119. ..
  120. .SH CONFIGURATION
  121. \fBisync\fR reads \fI~/.isyncrc\fR to load default configuration data.
  122. Each line of the configuration file consists of a command.
  123. The following commands are understood:
  124. .TP
  125. \fBMailbox\fR \fIpath\fR
  126. Defines a local maildir mailbox. All configuration commands following this
  127. line, up until the next \fIMailbox\fR command, apply to this mailbox only.
  128. ..
  129. .TP
  130. \fBHost\fR \fB[\fRimaps:\fB]\fR\fIname\fR
  131. Defines the DNS name or IP address of the IMAP server. If the hostname is
  132. prefixed with \fIimaps:\fR the connection is assumed to be a SSL connection
  133. to port 993 (though you can change this by placing a \fBPort\fR command
  134. \fBafter\fR the \fBHost\fR command. Note that some servers support SSL on
  135. the default port 143. \fBisync\fR will always attempt to use SSL if available.
  136. ..
  137. .TP
  138. \fBPort\fR \fIport\fR
  139. Defines the TCP port number on the IMAP server to use (Default: 143)
  140. ..
  141. .TP
  142. \fBBox\fR \fImailbox\fR
  143. Defines the name of the remote IMAP mailbox associated with the local
  144. maildir mailbox (Default: INBOX)
  145. ..
  146. .TP
  147. \fBUser\fR \fIusername\fR
  148. Defines the login name on the IMAP server (Default: current user)
  149. ..
  150. .TP
  151. \fBPass\fR \fIpassword\fR
  152. Defines the password for \fIusername\fR on the IMAP server.
  153. Note that this option is \fBNOT\fR required.
  154. If no password is specified in the configuration file, \fBisync\fR
  155. will prompt you for it.
  156. ..
  157. .TP
  158. \fBAlias\fR \fIstring\fR
  159. Defines an alias for the mailbox which can be used as a shortcut on the
  160. command line.
  161. ..
  162. .TP
  163. \fBCopyDeletedTo\fR \fImailbox\fR
  164. Specifies the remote IMAP mailbox to copy deleted messages prior to
  165. expunging (Default: none).
  166. ..
  167. .TP
  168. \fBDelete\fR \fIyes\fR|\fIno\fR
  169. Specifies whether messages in the local copy of the mailbox which don't
  170. exist on the server are automatically deleted. (Default: no).
  171. \fBNOTE:\fR The \fI-d\fR command line option overrides this setting when
  172. set to \fIno\fR.
  173. ..
  174. .TP
  175. \fBExpunge\fR \fIyes\fR|\fIno\fR
  176. Specifies whether deleted messages are expunged by default (Default: no).
  177. \fBNOTE:\fR The \fI-e\fR command line option overrides this setting when
  178. set to \fIno\fR.
  179. ..
  180. .TP
  181. \fBMailDir\fR \fIdirectory\fR
  182. Specifies the location of your local mailboxes if a relative path is
  183. specified in a \fIMailbox\fR command (Default: \fI~\fR).
  184. \fBNOTE:\fR This directive is only meaningful in the \fIglobal\fR
  185. section (see below).
  186. ..
  187. .TP
  188. \fBFolder\fR \fIdirectory\fR/
  189. Specifies the location of your IMAP mailboxes
  190. specified in \fIBox\fR commands (Default: \fI""\fR).
  191. \fBNOTE:\fR You \fBmust\fR append the hierarchy delimiter (usually
  192. a slash) to this specification.
  193. \fBNOTE 2:\fR This directive is only meaningful in the \fIglobal\fR
  194. section (see below).
  195. ..
  196. .TP
  197. \fBMaxMessages\fR \fIcount\fR
  198. Sets the number of messages \fBisync\fR should keep in a mailbox.
  199. This is useful for mailboxes where you keep a complete archive on the
  200. server, but want to mirror only the last messages (for instance, for mailing
  201. lists.)
  202. The messages that were the first to arrive in the mailbox (independent of the
  203. actual date of the message) will automatically be deleted if you
  204. pass \fBisync\fR the delete (-d, --delete) flag.
  205. Messages that are flagged (marked as important) will not be automatically
  206. deleted.
  207. If \fIcount\fR is 0, the maximum number of messages is \fBunlimited\fR
  208. (Default: 0).
  209. ..
  210. .TP
  211. \fBMaxSize\fR \fIbytes\fR
  212. Sets a threshold for the maximum message size (in bytes) for which \fBisync\fR
  213. should transfer over the wire. This is useful for weeding out messages with
  214. large attachments. If \fIbytes\fR is 0, the maximum file size is \fBunlimited\fR.
  215. ..
  216. .TP
  217. \fBTunnel\fR \fIcommand\fR
  218. Specify a command to run to establish a connection rather than opening a TCP
  219. socket. This allows you to run an IMAP session over an SSH tunnel, for
  220. example.
  221. .TP
  222. \fBUseNamespace\fR \fIyes\fR|\fIno\fR
  223. Selects whether \fBisync\fR should select mailboxes using the namespace given
  224. by the NAMESPACE command. This is useful with broken IMAP servers. (Default:
  225. \fIyes\fR)
  226. ..
  227. .TP
  228. \fBRequireCRAM\fR \fIyes\fR|\fIno\fR
  229. If set to \fIyes\fR, \fBisync\fR will require that the server accept CRAM-MD5
  230. intead of PLAIN to authenticate the user.
  231. ..
  232. .TP
  233. \fBRequireSSL\fR \fIyes\fR|\fIno\fR
  234. \fBisync\fR will abort the connection if a TLS/SSL session to the IMAP
  235. server can not be established. (Default: \fIyes\fR)
  236. ..
  237. .TP
  238. \fBCertificateFile\fR \fIpath\fR
  239. File containing X.509 CA certificates used to verify server identities.
  240. ..
  241. .TP
  242. \fBUseSSLv2\fR \fIyes\fR|\fIno\fR
  243. Should \fBisync\fR use SSLv2 for communication with the IMAP server over SSL?
  244. (Default: \fIyes\fR if the imaps port is used, otherwise \fIno\fR)
  245. ..
  246. .TP
  247. \fBUseSSLv3\fR \fIyes\fR|\fIno\fR
  248. Should \fBisync\fR use SSLv3 for communication with the IMAP server over SSL?
  249. (Default: \fIyes\fR if the imaps port is used, otherwise \fIno\fR)
  250. ..
  251. .TP
  252. \fBUseTLSv1\fR \fIyes\fR|\fIno\fR
  253. Should \fBisync\fR use TLSv1 for communication with the IMAP server over SSL?
  254. (Default: \fIyes\fR)
  255. ..
  256. .TP
  257. \fBOneToOne\fR
  258. \fBisync\fR will ignore any \fIMailbox\fR specifications and instead pick up
  259. all mailboxes from the local \fIMailDir\fR and remote \fIFolder\fR and map
  260. them 1:1 onto each other according to their names.
  261. \fBNOTE:\fR This directive is only meaningful in the \fIglobal\fR
  262. section (see below).
  263. ..
  264. .TP
  265. \fBInbox\fR \fImailbox\fR
  266. Exception to the OneToOne mapping: the special IMAP mailbox \fIINBOX\fR
  267. is mapped to the local \fImailbox\fR (relative to the \fIMailDir\fR).
  268. \fBNOTE:\fR This directive is only meaningful in the \fIglobal\fR
  269. section (see below).
  270. ..
  271. .P
  272. Configuration commands that appear prior to the first \fBMailbox\fR
  273. command are considered to be \fIglobal\fR
  274. options which are used as defaults when those specific options are not
  275. specifically set for a defined Mailbox. For example, if you use the same
  276. login name for several IMAP servers, you can put a \fBUser\fR command before
  277. the first \fBMailbox\fR command, and then leave out the \fBUser\fR command
  278. in the sections for each mailbox.
  279. \fBisync\fR will then use the global value by default.
  280. ..
  281. .SH MAIL USER AGENT INTERACTION
  282. To use \fBisync\fR effectively, you need a mail client that sets the T
  283. (trashed) flag when it deletes a message from a maildir mailbox, instead of
  284. just removing it altogether. Without such a client, \fBisync\fR will refetch the
  285. locally deleted messages from the server since they will never get expunged.
  286. Mutt (starting with version 1.3.27) is known to support this. Be sure to put
  287. .IP "" 2
  288. set maildir_trash
  289. .PP
  290. in your ~/.muttrc when using Mutt.
  291. .br
  292. \fBisync\fR can be integrated into Mutt fairly easily with a few hooks:
  293. .IP "" 2
  294. .nf
  295. folder-hook ~A bind index $ <sync-mailbox>
  296. .br
  297. folder-hook +\fImdir\fR 'macro index $ "<sync-mailbox>!isync -e \fImdir\fR\\n"'
  298. .fi
  299. .PP
  300. where \fImdir\fR is the name of the local mailbox (or its \fIalias\fR).
  301. This works well so long as you are not modifying the IMAP mailbox outside of
  302. Mutt. However, if you are using another mail program simultaneously Mutt
  303. will have the wrong idea of the local mailbox flags and messages will start
  304. disappearing from its index display (don't worry, they are still on disk).
  305. ..
  306. .SH FILES
  307. .TP
  308. .B ~/.isyncrc
  309. Default configuration file
  310. ..
  311. .SH BUGS
  312. No support for IMAP subfolders.
  313. .P
  314. \fBisync\fR does not use NFS-safe locking. It will correctly prevent
  315. concurrent synchronization of a mailbox on the same host, but not across NFS.
  316. .P
  317. When synchronizing multiple mailboxes on the same IMAP server, it is not
  318. possible to select different SSL options for each mailbox. Only the options
  319. from the first mailbox are applied since the SSL session is reused.
  320. .P
  321. If new mail arrives in the IMAP mailbox after \fBisync\fR
  322. has retrieved the initial message list, the new mail will not be fetched
  323. until the next time \fBisync\fR is invoked.
  324. .P
  325. It is currently impossible to unset the \\Flagged attribute of a message
  326. once it is set. It has to be manually unset everywhere since isync
  327. doesn't have enough information to know which was the last status of the
  328. message.
  329. .P
  330. The ndbm database created for each mailbox is not portable across different
  331. architectures. It currently stores the UID in host byte order.
  332. .P
  333. The configuration file takes precedence over command line options.
  334. .br
  335. Use -c /dev/null to work around.
  336. .SH SEE ALSO
  337. mutt(1), maildir(5)
  338. .P
  339. Up to date information on \fBisync\fR can be found at http://isync.sf.net/
  340. ..
  341. .SH AUTHOR
  342. Written by Michael R. Elkins <me@mutt.org>,
  343. .br
  344. maintained by Oswald Buddenhagen <ossi@users.sf.net>.