From 7d50d83ab52148285c642158bd57bdd18a1ee6d4 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 16 May 2019 01:05:25 +0200 Subject: interimap: accept C-style escape sequences in 'list-mailbox'. This is useful for defining names containing control characters (incl. \0 for unspecified hierarchy delimiter). --- interimap.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'interimap.md') diff --git a/interimap.md b/interimap.md index 4d85eaf..a230c09 100644 --- a/interimap.md +++ b/interimap.md @@ -82,10 +82,10 @@ the *list-mailbox*, *list-select-opts* and *ignore-mailbox* options from the [configuration file](#configuration-file) can be used to shrink that list and save bandwidth. However if some extra argument are provided on the command line, -`interimap` ignores said options and synchronizes the given +`interimap` ignores these options and synchronizes the given *MAILBOX*es instead. Note that each *MAILBOX* is taken “as is”; in particular, it must be [UTF-7 encoded][RFC 2152], unquoted, and the list -wildcards ‘\*’ and ‘%’ are not expanded. +wildcards ‘\*’ and ‘%’ are passed verbatim to the IMAP server. If the synchronization was interrupted during a previous run while some messages were being replicated (but before the `UIDNEXT` or @@ -219,12 +219,16 @@ Valid options are: : A space separated list of mailbox patterns to use when issuing the initial `LIST` command (overridden by the *MAILBOX*es given as command-line arguments). - Note that each pattern containing special characters such as spaces - or brackets (see [RFC 3501] for the exact syntax) must be quoted. + Names containing special characters such as spaces or brackets need + to be enclosed in double quotes. Within double quotes C-style + backslash escape sequences can be used (‘\\t’ for an horizontal tab, + ‘\\n’ for a new line, ‘\\\\’ for a backslash, etc.), as well as + hexadecimal escape sequences ‘\\xHH’. Furthermore, non-ASCII names must be [UTF-7 encoded][RFC 2152]. - Two wildcards are available: a ‘\*’ character matches zero or more - characters, while a ‘%’ character matches zero or more characters up - to the mailbox's hierarchy delimiter. + Two wildcards are available, and passed verbatim to the IMAP server: + a ‘\*’ character matches zero or more characters, while a ‘%’ + character matches zero or more characters up to the hierarchy + delimiter. This option is only available in the default section. (The default pattern, `*`, matches all visible mailboxes on the server.) -- cgit v1.2.3 From bacb78530555f9a73d86564837a11d6e75236de5 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 25 May 2019 15:27:59 +0200 Subject: libinterimap: use socketpair(2) in tunnel mode. Rather than two pipe(2). Also, use SOCK_CLOEXEC to save a fcntl() call when setting the close-on-exec flag on the socket (even though Perl will likely call fcntl() anyway). --- interimap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'interimap.md') diff --git a/interimap.md b/interimap.md index a230c09..2f064e1 100644 --- a/interimap.md +++ b/interimap.md @@ -265,8 +265,9 @@ Valid options are: : One of `imap`, `imaps` or `tunnel`. `type=imap` and `type=imaps` are respectively used for IMAP and IMAP over SSL/TLS connections over a INET socket. - `type=tunnel` causes `interimap` to open a pipe to a *command* - instead of a raw socket. + `type=tunnel` causes `interimap` to create an unnamed pair of + connected sockets for interprocess communication with a *command* + instead of a opening a network socket. Note that specifying `type=tunnel` in the `[remote]` section makes the default *database* to be `localhost.db`. (Default: `imaps`.) -- cgit v1.2.3 From 456946609aa1e64a42578ff1c4962ea939d31da4 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 21 May 2019 14:12:26 +0200 Subject: New option 'list-reference' to specify a reference name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful for synchronizing multiple remote servers against different namespaces belonging to the same local IMAP server (using a different InterIMAP instance for each local namespace ↔ remote synchronization, for instance with the newy provided systemd template unit file). --- interimap.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'interimap.md') diff --git a/interimap.md b/interimap.md index 2f064e1..50c1832 100644 --- a/interimap.md +++ b/interimap.md @@ -214,6 +214,23 @@ Valid options are: (Default: `HOST.db`, where *HOST* is taken from the `[remote]` or `[local]` sections, in that order.) +*list-reference* + +: An optional “reference name” to use for the initial `LIST` command, + indicating the context in which the *MAILBOX*es are interpreted. + For instance, by specifying `list-reference=perso/` in the `[local]` + section, *MAILBOX* names are interpreted relative to `perso/` on the + local server; in other words the remote mailbox hierarchy is mapped + to the `perso/` sub-hierarchy on the local server. This is useful + for synchronizing multiple remote servers against different + namespaces belonging to the same local IMAP server (using a + different InterIMAP instance for each local namespace ↔ remote + synchronization). + + (Note that if the reference name is not a level of mailbox hierarchy + and/or does not end with the hierarchy delimiter, by [RFC 3501] its + interpretation by the IMAP server is implementation-dependent.) + *list-mailbox* : A space separated list of mailbox patterns to use when issuing the -- cgit v1.2.3