namespace.
* libinterimap: in tunnel mode, use a socketpair rather than two pipes
for IPC between the interimap and the IMAP server. Also, use
- SOCK_CLOEXEC to save a fcntl() call when setting the close-on-exec
+ SOCK_CLOEXEC to save an fcntl() call when setting the close-on-exec
flag on the socket.
* interimap: new option 'list-reference' to specify a reference name.
This is useful for synchronizing multiple remote servers against
different InterIMAP instance for each local namespace <-> remote
synchronization, for instance with the newly provided systemd
template unit file).
- * Add a small test-suite (requires dovecot-imapd).
+ * Add a test-suite. (Requires dovecot-imapd, pkill(1) and xxd(1).)
+ interimap: write which --target to use in --delete command
suggestions.
+ interimap: avoid caching hierarchy delimiters forever in the
interimap (0.3) upstream;
+ New script 'pullimap', to pull mails from an IMAP mailbox and
- deliver them to a SMTP session.
+ deliver them to an SMTP session.
+ Convert manpage format from groff to pandoc.
+ interimap: Add support for IMAP NOTIFY [RFC 5465].
+ 'fingerprint' now only pins the cert's SPKI, not the cert itself
compresses pretty well: enabling compression can save a great amount of
network resources.
-However establishing a SSL/TLS connection (type=imaps, or type=imap and
+However establishing an SSL/TLS connection (type=imaps, or type=imap and
STARTTLS=YES) yields a small overhead due to the SSL/TLS handshake.
On the other hand if SSH access is allowed on the remote server, one can
2. Propagate these changes onto the other server: get the corresponding
UIDs from the database, then:
- a. issue an `UID STORE` command, followed by `UID EXPUNGE`, to
+ a. issue a `UID STORE` command, followed by `UID EXPUNGE`, to
remove messages that have not already been deleted on both
servers; and
b. issue some `UID STORE` commands to propagate flag updates (send
Otherwise, update the `HIGHESTMODSEQ` value in the database.
3. Process new messages (if the current `UIDNEXT` value of the mailbox
- differs from the one found in the database) by issuing an `UID
- FETCH` command; process each received message on-the-fly by issuing
- an `APPEND` command with the message's `RFC822` body, `FLAGS` and
+ differs from the one found in the database) by issuing a `UID FETCH`
+ command; process each received message on-the-fly by issuing an
+ `APPEND` command with the message's `RFC822` body, `FLAGS` and
`INTERNALDATE`.
Repeat this step if the server received new messages in the
meantime. Otherwise, update the `UIDNEXT` value in the database.
existing UID; and
3/ ensure that both flag lists match.
Any message found on a server but not in the database is replicated
- on the other server (which in the worst case, might lead to a
- message duplicate).
+ on the other server (which in the worst case, might yield a message
+ duplicate).
Flag conflicts are solved by updating each message to the union of
both lists.
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
+ different `interimap` instance for each local namespace ↔ remote
synchronization).
(Note that if the reference name is not a level of mailbox hierarchy
: 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.
+ over SSL/TLS connections over an INET 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.
+ instead of opening a network socket.
Note that specifying `type=tunnel` in the `[remote]` section makes
the default *database* to be `localhost.db`.
(Default: `imaps`.)
protocol][RFC 3501] on its standard output, and understand it on its
standard input. The value is passed to `` `/bin/sh -c` `` if it
contains shell metacharacters; otherwise it is split into words and
- the list is passed to `execvp`(3).
+ the resulting list is passed to `execvp`(3).
*STARTTLS*
Attempting to connect to a server with a non-matching certificate
SPKI fingerprint causes `interimap` to abort the connection during
the SSL/TLS handshake.
-
- You can use the following command to compute the SHA-256 digest of
- certificate's Subject Public Key Info.
+ The following command can be used to compute the SHA-256 digest of a
+ certificate's Subject Public Key Info:
openssl x509 -in /path/to/server/certificate.pem -pubkey \
| openssl pkey -pubin -outform DER \
# $self->search($criterion)
-# Issue an UID SEARCH command with the given $criterion. For the "normal"
+# Issue a UID SEARCH command with the given $criterion. For the "normal"
# UID SEARCH command from RFC 3501, return the list of matching UIDs;
# for the extended UID SEARCH command from RFC 4731 (ensuring ESEARCH
# capability is the caller's responsibility), return an optional "UID"
# $self->fetch($set, $flags, [$callback])
-# Issue an UID FETCH command with the given UID $set, $flags, and
+# Issue a UID FETCH command with the given UID $set, $flags, and
# optional $callback.
sub fetch($$$;&) {
my ($self, $set, $flags, $callback) = @_;
#!/usr/bin/perl -T
#----------------------------------------------------------------------
-# Pull mails from an IMAP mailbox and deliver them to a SMTP session
+# Pull mails from an IMAP mailbox and deliver them to an SMTP session
# Copyright © 2016-2018 Guilhem Moulin <guilhem@fripost.org>
#
# This program is free software: you can redistribute it and/or modify
Name
====
-PullIMAP - Pull mails from an IMAP mailbox and deliver them to a SMTP session
+PullIMAP - Pull mails from an IMAP mailbox and deliver them to an SMTP session
Synopsis
========
Description
===========
-`pullimap` retrieves messages from an IMAP mailbox and deliver them to a
-SMTP or LMTP transmission channel. It can also remove old messages
+`pullimap` retrieves messages from an IMAP mailbox and deliver them to
+an SMTP or LMTP transmission channel. It can also remove old messages
after a configurable retention period.
A *statefile* is used to keep track of the mailbox's `UIDVALIDITY` and
: 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.
+ over SSL/TLS connections over an INET socket.
`type=tunnel` causes `pullimap` to create an unnamed pair of
connected sockets for interprocess communication with a *command*
- instead of a opening a network socket.
+ instead of opening a network socket.
(Default: `imaps`.)
*host*
protocol][RFC 3501] on its standard output, and understand it on its
standard input. The value is passed to `` `/bin/sh -c` `` if it
contains shell metacharacters; otherwise it is split into words and
- the list is passed to `execvp`(3).
+ the resulting list is passed to `execvp`(3).
*STARTTLS*
Attempting to connect to a server with a non-matching certificate
SPKI fingerprint causes `pullimap` to abort the connection during
the SSL/TLS handshake.
-
- You can use the following command to compute the SHA-256 digest of
- certificate's Subject Public Key Info.
+ The following command can be used to compute the SHA-256 digest of a
+ certificate's Subject Public Key Info:
openssl x509 -in /path/to/server/certificate.pem -pubkey \
| openssl pkey -pubin -outform DER \
smaller than this `UIDNEXT` value have already been retrieved and
delivered).
The [IMAP4rev1 specification][RFC 3501] does not guaranty that untagged
-`FETCH` responses are sent ordered by UID in response to an `UID FETCH`
+`FETCH` responses are sent ordered by UID in response to a `UID FETCH`
command. Thus it would be unsafe for `pullimap` to update the `UIDNEXT`
value in its *statefile* while the `UID FETCH` command is progress.
Instead, for each untagged `FETCH` response received while the `UID
In more details, `pullimap` works as follows:
- 1. Issue an `UID FETCH` command to retrieve message `ENVELOPE` and
+ 1. Issue a `UID FETCH` command to retrieve message `ENVELOPE` and
`RFC822` (and `UID`) with UID bigger or equal than the `UIDNEXT`
value found in the *statefile*.
While the `UID FETCH` command is in progress, perform the following
i. append the message UID to the *statefile*.
- 2. If a SMTP/LMTP transmission channel was opened, send a `QUIT` command
+ 2. If an SMTP/LMTP transmission channel was opened, send a `QUIT` command
to terminate it gracefully.
- 3. Issue an `UID STORE` command to mark all retrieved messages (and
+ 3. Issue a `UID STORE` command to mark all retrieved messages (and
stalled UIDs found in the *statefile* after the eigth byte) as
`\Seen`.
[Unit]
-Description=Pull mails from an IMAP mailbox and deliver them to a SMTP session (instance %i)
+Description=Pull mails from an IMAP mailbox and deliver them to an SMTP session (instance %i)
Documentation=man:pullimap(1)
Wants=network-online.target
After=network-online.target