From 060ff57642fc74f320761586e244151c04e63755 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 9 Sep 2021 09:51:03 -0300 Subject: [PATCH 1/5] lib: use 'localhost' rather than fqdn for default mail address. As discussed in the thread starting at [1], the fully qualified domain name is a bit tricky to get reproducibly, might reveal information people prefer to keep private, and somewhat unlikely to provide reliable mail routing. The new approach of $current_username@localhost is better for the first two considerations, and probably at least as good as a test mail address. [1]: id:87sfyibqhj.fsf@tethera.net --- lib/config.cc | 16 +--------------- test/T590-libconfig.sh | 10 ++++------ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/config.cc b/lib/config.cc index 7ecc3c7b..8775b00a 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -543,25 +543,11 @@ _get_username_from_passwd_file (void *ctx) static const char * _get_email_from_passwd_file (void *ctx) { - - char hostname[256]; - struct hostent *hostent; - const char *domainname; char *email; char *username = _get_username_from_passwd_file (ctx); - gethostname (hostname, 256); - hostname[255] = '\0'; - - hostent = gethostbyname (hostname); - if (hostent && (domainname = strchr (hostent->h_name, '.'))) - domainname += 1; - else - domainname = "(none)"; - - email = talloc_asprintf (ctx, "%s@%s.%s", - username, hostname, domainname); + email = talloc_asprintf (ctx, "%s@localhost", username); talloc_free (username); return email; diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 41f67bae..59b82a6f 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -12,12 +12,10 @@ import os, sys, pwd, socket pw = pwd.getpwuid(os.getuid()) user = pw.pw_name name = pw.pw_gecos.partition(",")[0] -fqdn = socket.getaddrinfo(socket.gethostname(), 0, 0, - socket.SOCK_STREAM, 0, socket.AI_CANONNAME)[0][3] + for l in sys.stdin: if l[:4] == "08: ": - l = l.replace(user, "USERNAME", 1).replace("@" + fqdn, "@FQDN", 1) - l = l.replace(".(none)", "", 1).replace(".localdomain", "", 1) + l = l.replace(user, "USERNAME", 1) elif l[:4] == "10: ": l = l.replace("'" + name, "'USER_FULL_NAME", 1) sys.stdout.write(l) @@ -416,7 +414,7 @@ cat <<'EOF' >EXPECTED 05: 'unread;inbox' 06: '' 07: 'true' -08: 'USERNAME@FQDN' +08: 'USERNAME@localhost' 09: 'NULL' 10: 'USER_FULL_NAME' 11: '8000' @@ -761,7 +759,7 @@ cat <<'EOF' >EXPECTED 05: 'unread;inbox' 06: '' 07: 'true' -08: 'USERNAME@FQDN' +08: 'USERNAME@localhost' 09: 'NULL' 10: 'USER_FULL_NAME' 11: '8000' From c6524148fcc7bdab7e6fd3c82b2adafa01799221 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 10 Sep 2021 08:21:28 -0300 Subject: [PATCH 2/5] version: bump to 0.33.1 --- bindings/python-cffi/version.txt | 2 +- bindings/python/notmuch/version.py | 2 +- version.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python-cffi/version.txt b/bindings/python-cffi/version.txt index 94b357ed..8df3f459 100644 --- a/bindings/python-cffi/version.txt +++ b/bindings/python-cffi/version.txt @@ -1 +1 @@ -0.33 +0.33.1 diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py index eaa3fce7..27b651b1 100644 --- a/bindings/python/notmuch/version.py +++ b/bindings/python/notmuch/version.py @@ -1,3 +1,3 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.33' +__VERSION__ = '0.33.1' SOVERSION = '5' diff --git a/version.txt b/version.txt index 94b357ed..8df3f459 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.33 +0.33.1 From 76ec0b409fe5e2881d74ca661efd8d09f5bdaf00 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 10 Sep 2021 08:28:04 -0300 Subject: [PATCH 3/5] NEWS: update for 0.33.1 --- NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 2ce632f0..fe8b3cad 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +Notmuch 0.33.1 (2021-09-10) +=========================== + +General +------- + +Replace the fully-qualified-domain-name of the host with "localhost" +in the default email address. This should fix two flaky subtests in +T590-libconfig. + Notmuch 0.33 (2021-09-03) ========================= From b5c6fdd480a758c849335dba5a639905cdad560b Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 10 Sep 2021 08:30:07 -0300 Subject: [PATCH 4/5] debian: changelog for 0.33.1-1 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index cf400c2c..a985c505 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +notmuch (0.33.1-1) unstable; urgency=medium + + * Upstream fix for flaky tests in T590-libconfig + + -- David Bremner Fri, 10 Sep 2021 08:28:48 -0300 + notmuch (0.33-2) unstable; urgency=medium * Disable two flaky tests in T590-libconfig. From 8e59438025c88ebd83a78cf12c06ff954d979e01 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 10 Sep 2021 08:30:24 -0300 Subject: [PATCH 5/5] debian: drop debian specific test exclusion In principle these tests should pass now. --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 1d25f9c3..fa0551a9 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ override_dh_auto_configure: --localstatedir=/var override_dh_auto_test: - dh_auto_test -- V=1 NOTMUCH_SKIP_TESTS="libconfig.18 libconfig.31" + dh_auto_test -- V=1 override_dh_auto_build: dh_auto_build -- V=1