aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-07-02 00:15:41 +0200
committerGuilhem Moulin <guilhem@fripost.org>2020-07-02 00:15:41 +0200
commit9bf5257bb6f0e67d49015941827496586271bede (patch)
treeedc8fe5f36b22b509092395a32e72796efeda85d
parentc54903cd6308cf4a56a439ea74d3f8943e5b605c (diff)
parent95df46e54ce090506cdce1c54616ea849670c2db (diff)
Merge tag 'upstream/0.5.1' into debian
Upstream version 0.5.1
-rw-r--r--Changelog12
-rw-r--r--Makefile52
-rw-r--r--doc/development.md2
-rw-r--r--doc/getting-started.md3
-rw-r--r--doc/index.md16
-rwxr-xr-xinterimap3
-rwxr-xr-xpullimap3
-rw-r--r--tests/db-exclusive-lock/t4
-rw-r--r--tests/db-no-create--watch/t2
-rw-r--r--tests/pullimap/t10
10 files changed, 75 insertions, 32 deletions
diff --git a/Changelog b/Changelog
index 68e3267..43648d0 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,14 @@
-interimap (0.5-rc) upstream;
+interimap (0.5.1) upstream;
+
+ + pullimap: also compare RFC 5322 date and envelope information in
+ mailbox comparison tests.
+ + interimap, pullimap: remove `use lib` statement.
+ * Makefile: major refactoring, add install and uninstall targets, honor
+ BUILD_DOCDIR and DESTDIR variables.
+
+ -- Guilhem Moulin <guilhem@fripost.org> Thu, 02 Jul 2020 00:15:03 +0200
+
+interimap (0.5) upstream;
Breaking changes:
* interimap: when matching mailbox names against the 'ignore-mailbox'
diff --git a/Makefile b/Makefile
index b232602..35f1334 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,25 @@
+DESTDIR ?= /usr/local
+BUILD_DOCDIR ?= ./doc
+CSS ?= /usr/share/javascript/bootstrap4/css/bootstrap.css
+HTML_TEMPLATE ?= ./doc/template.html
+
+HTML_FILES = $(addprefix $(BUILD_DOCDIR)/,$(patsubst ./doc/%.md,%.html,$(wildcard ./doc/*.md)))
+MANUAL_FILES = $(addprefix $(BUILD_DOCDIR)/,$(patsubst ./doc/%.md,%,$(wildcard ./doc/*.[1-9].md)))
+
all: manual
-MANUALS = $(patsubst %.md,%,$(wildcard ./doc/*.[1-9].md))
-manual: $(MANUALS)
+manual: $(MANUAL_FILES)
+html: $(HTML_FILES)
# upper case the headers and remove the links
-$(MANUALS): %: %.md
+$(MANUAL_FILES): $(BUILD_DOCDIR)/%: ./doc/%.md
pandoc -f markdown -t json -- "$<" | ./pandoc2man.jq | pandoc -s -f json -t man+smart -o "$@"
test:
@./tests/run-all
-HTML_ROOTDIR ?= ./doc
-CSS ?= /usr/share/javascript/bootstrap/css/bootstrap.min.css
-HTML_TEMPLATE ?= ./doc/template.html
-
-HTML_FILES = $(addprefix $(HTML_ROOTDIR)/,$(patsubst ./doc/%.md,%.html,$(wildcard ./doc/*.md)))
-html: $(HTML_FILES)
-
-## CSS="https://guilhem.org/static/css/bootstrap.min.css" HTML_ROOTDIR="$XDG_RUNTIME_DIR/Downloads" make html
-$(HTML_ROOTDIR)/%.html: ./doc/%.md $(HTML_TEMPLATE)
+## make html CSS="https://guilhem.org/static/css/bootstrap.min.css" BUILD_DOCDIR="$XDG_RUNTIME_DIR/Downloads"
+$(HTML_FILES): $(BUILD_DOCDIR)/%.html: ./doc/%.md $(HTML_TEMPLATE)
mtime="$$(git --no-pager log -1 --pretty="format:%ct" -- "$<" 2>/dev/null)"; \
[ -n "$$mtime" ] || mtime="$$(date +%s -r "$<")"; \
[ "$<" = "doc/index.md" ] && parent="" || parent="./index.html"; \
@@ -31,9 +32,30 @@ $(HTML_ROOTDIR)/%.html: ./doc/%.md $(HTML_TEMPLATE)
doc: manual html
-install:
+prefix ?= $(DESTDIR)
+exec_prefix ?= $(prefix)
+bindir ?= $(exec_prefix)/bin
+libdir ?= $(exec_prefix)/lib
+datarootdir ?= $(DESTDIR)/share
+mandir ?= $(datarootdir)/man
+man1dir ?= $(mandir)/man1
+
+install: all
+ install -m0755 -vDt $(bindir) ./interimap ./pullimap
+ install -m0644 -vDT ./lib/Net/IMAP/InterIMAP.pm $(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
+ install -m0644 -vDt $(man1dir) $(BUILD_DOCDIR)/interimap.1 $(BUILD_DOCDIR)/pullimap.1
+ install -m0644 -vDt $(datarootdir)/doc/pullimap ./pullimap.sample
+ install -m0644 -vDt $(datarootdir)/doc/interimap ./interimap.sample ./doc/getting-started.md ./doc/multi-account.md README
+ install -m0644 -vDt $(libdir)/systemd/user ./*.service
+
+uninstall:
+ rm -vf -- $(bindir)/interimap $(man1dir)/interimap.1 $(libdir)/systemd/user/interimap*.service
+ rm -vf -- $(bindir)/pullimap $(man1dir)/pullimap.1 $(libdir)/systemd/user/pullimap*.service
+ rm -vf -- $(datarootdir)/perl5/Net/IMAP/InterIMAP.pm
+ rm -rvf -- $(datarootdir)/doc/interimap $(datarootdir)/doc/pullimap
+ rm -vf -- $(BUILD_DOCDIR)/interimap.1 $(BUILD_DOCDIR)/pullimap.1
clean:
- rm -f $(MANUALS) $(HTML_FILES)
+ rm -vf -- $(MANUAL_FILES) $(HTML_FILES)
-.PHONY: all manual html doc test install clean
+.PHONY: all manual html doc test install uninstall clean
diff --git a/doc/development.md b/doc/development.md
index 52ebf90..708712f 100644
--- a/doc/development.md
+++ b/doc/development.md
@@ -193,7 +193,7 @@ recursively remove the directory `$BASEDIR`.
[IMAP4rev1]: https://tools.ietf.org/html/rfc3501
[Dovecot]: https://dovecot.org
-[Dovecot Logging]: https://doc.dovecot.org/admin_manual/dovecot_logging/
+[Dovecot Logging]: https://doc.dovecot.org/admin_manual/logging/
[Dovecot LDA]: https://wiki.dovecot.org/LDA
[`getlogin`(3)]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html
[User Databases]: https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/
diff --git a/doc/getting-started.md b/doc/getting-started.md
index c497ec6..1d059b4 100644
--- a/doc/getting-started.md
+++ b/doc/getting-started.md
@@ -30,7 +30,8 @@ perform significant optimizations, yielding [much faster](benchmark.html)
synchronization.
*Note*: InterIMAP uses the [Quick Mailbox Resynchronization][RFC 7162]
extension for stateful synchronization, hence won't work on IMAP servers
-that don't advertise support for that extension.
+that don't advertise [support](https://www.imapwiki.org/Specs#line-68)
+for that extension.
Installing an [IMAP4rev1] server on a single-user workstation may sound
overkill, but we argue that most systems, not only servers, come with a
diff --git a/doc/index.md b/doc/index.md
index d475592..4dd72f1 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -1,18 +1,32 @@
% InterIMAP & PullIMAP
% [Guilhem Moulin](mailto:guilhem@fripost.org)
+InterIMAP synchronizes emails and their metadata between a remote IMAP
+server and local storage. By leveraging the [*Quick Mailbox
+Resynchronization*][RFC 7162] IMAP extension, it can offer [*much better
+performance*](benchmark.html) than tools such as [OfflineIMAP].
+
+PullIMAP retrieves messages from an IMAP mailbox and deliver them
+locally. It can use the the [*IDLE*][RFC 2177] IMAP extension to reduce
+both latency and network traffic.
+
+[RFC 2177]: https://tools.ietf.org/html/rfc2177
+[RFC 7162]: https://tools.ietf.org/html/rfc7162
+[OfflineIMAP]: https://www.offlineimap.org/
+
General documentation
---------------------
* [Getting started with InterIMAP](getting-started.html)
* [Multi-remote setup for InterIMAP](multi-account.html)
* [InterIMAP benchmark metrics and comparison](benchmark.html)
+ * [Presentation at DebConf19](https://debconf19.debconf.org/talks/78-interimap-the-case-for-local-imap-servers-and-fast-bidirectional-synchronization/)
Manuals (HTML versions)
-----------------------
* [`interimap`(1)](interimap.1.html) — Fast bidirectional
- synchronization for QRESYNC-capable IMAP servers
+ synchronization for IMAP servers
* [`pullimap`(1)](pullimap.1.html) — Pull mails from an IMAP mailbox
and deliver them to an SMTP session
diff --git a/interimap b/interimap
index f9be72d..6448d2b 100755
--- a/interimap
+++ b/interimap
@@ -22,7 +22,7 @@ use v5.14.2;
use strict;
use warnings;
-our $VERSION = '0.5';
+our $VERSION = '0.5.1';
my $NAME = 'interimap';
my $DATABASE_VERSION = 1;
use Getopt::Long qw/:config posix_default no_ignore_case gnu_compat
@@ -32,7 +32,6 @@ use DBD::SQLite::Constants ':file_open';
use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC/;
use List::Util 'first';
-use lib 'lib';
use Net::IMAP::InterIMAP 0.0.5 qw/xdg_basedir read_config compact_set/;
# Clean up PATH
diff --git a/pullimap b/pullimap
index ee2168d..d1c607a 100755
--- a/pullimap
+++ b/pullimap
@@ -22,7 +22,7 @@ use v5.20.2;
use strict;
use warnings;
-our $VERSION = '0.4';
+our $VERSION = '0.5.1';
my $NAME = 'pullimap';
use Errno 'EINTR';
@@ -31,7 +31,6 @@ use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version
use List::Util 'first';
use Socket qw/PF_INET PF_INET6 SOCK_STREAM IPPROTO_TCP/;
-use lib 'lib';
use Net::IMAP::InterIMAP 0.0.5 qw/xdg_basedir read_config compact_set/;
# Clean up PATH
diff --git a/tests/db-exclusive-lock/t b/tests/db-exclusive-lock/t
index 88172c9..c2df4b5 100644
--- a/tests/db-exclusive-lock/t
+++ b/tests/db-exclusive-lock/t
@@ -10,7 +10,7 @@ sleep .5
# subsequent runs fail as we can't acquire the exclusive lock
! interimap || error
-grep -Fx "DBD::SQLite::db do failed: database is locked at ./interimap line 177." <"$STDERR" \
- || error "Is \$DBH->do(\"PRAGMA locking_mode = EXCLUSIVE\"); at line 177?"
+grep -Fx "DBD::SQLite::db do failed: database is locked at ./interimap line 176." <"$STDERR" \
+ || error "Is \$DBH->do(\"PRAGMA locking_mode = EXCLUSIVE\"); at line 176?"
# vim: set filetype=sh :
diff --git a/tests/db-no-create--watch/t b/tests/db-no-create--watch/t
index 89f1e3e..a8ea07e 100644
--- a/tests/db-no-create--watch/t
+++ b/tests/db-no-create--watch/t
@@ -1,6 +1,6 @@
! interimap --watch=60 || error
-grep -Ex "DBI connect\(.*\) failed: unable to open database file at \./interimap line 173\." <"$STDERR" || error
+grep -Ex "DBI connect\(.*\) failed: unable to open database file at \./interimap line 172\." <"$STDERR" || error
test \! -e "$XDG_DATA_HOME/interimap/remote.db" || error
# vim: set filetype=sh :
diff --git a/tests/pullimap/t b/tests/pullimap/t
index 115432d..0dfe634 100644
--- a/tests/pullimap/t
+++ b/tests/pullimap/t
@@ -6,15 +6,13 @@ step_start "\`pullimap --idle\` refuses to create the state file"
! pullimap --idle "remote" || error
step_done
-# compare mailboxes; can't compare the RFC 3501 TEXT as LMTP adds a
-# Received: header.
-# TODO unset lmtp_add_received_header once available in sid:
-# https://doc.dovecot.org/settings/dovecot_core_settings/#lmtp-add-received-header
+# compare mailboxes (can't compare the RFC 3501 TEXT as the LMTPd inconditionally
+# adds a Return-Path: header -- and also Delivered-To: and Received: to by default)
list_mails_sha256() {
local u="$1" guid uid
+ local fields="body date.sent imap.bodystructure imap.envelope"
while read guid uid; do
- doveadm -u "$u" -f "flow" fetch body mailbox-guid "$guid" uid "$uid" \
- | sed "1s/body=//" | sha256sum
+ doveadm -u "$u" -f "flow" fetch "$fields" mailbox-guid "$guid" uid "$uid" | sha256sum
done < <(doveadm -u "$u" search mailbox "$MAILBOX") | sort -f
}
check() {