Greetings.

The build now succeeds with the post-build tests in Debian Experimental for all architectures except hurd-amd64 and hurd-i386. 45 tests fail on those architectures.
This is acceptable as those are not official "release" architectures.

https://buildd.debian.org/status/package.php?p=mlmmj&suite=experimental

I'm attaching the patch I used to for the build to Experimental. Commit 49f2bd13f44d112ded78df9bb688777f11ecf45e had to be removed from it, it broke the build everywhere. I'm going to double-check that locally after exporting that commit as a patch from Git.

Thanks for your work

   -- Chris

Chris Knadle
chris.kna...@coredump.us

On 5/27/25 07:29, Baptiste Daroussin wrote:
Hello,

1.5.2 is out with more fixes.

Best regards,
Bapt
On Tue 27 May 00:58, Chris Knadle wrote:
Hello, Baptiste.

I can't (or shouldn't) upload the 1.5.1 tarball because I need to do uploads
"as a patch". So what I've done is patch the 1.5.0 version with the changes
for 1.5.1, but called it 1.5.0-1+replacetests.
The version of MLMMJ in Debian Unstable is 1.5.0-1, and I don't want to
confuse things between Unstable and Experimental. If I have any chance of
uploading something in Unstable to target the next release, is has to have a
higher version # than the version in Experimental. So to insure I don't
screw that up I didn't call it 1.5.1-<something>.

    -- Chris

Chris Knadle
chris.kna...@coredump.us

On 5/27/25 00:49, Baptiste Daroussin wrote:
Le 27 mai 2025 02:33:02 GMT+02:00, Chris Knadle
<chris.kna...@coredump.us> a écrit :

     Hello. The build for MLMMJ failed on i386 due to 2 out of 196 test
     failures (resend-queue and resend-requeue):
     
https://buildd.debian.org/status/fetch.php?pkg=mlmmj&arch=i386&ver=1.5.0-1%2Breplacetests&stamp=1748301180&raw=0
     
<https://buildd.debian.org/status/fetch.php?pkg=mlmmj&arch=i386&ver=1.5.0-1%2Breplacetests&stamp=1748301180&raw=0>
     I tried the build three times with the same results on three
     different i386 build systems:
     
https://buildd.debian.org/status/logs.php?pkg=mlmmj&ver=1.5.0-1%2Breplacetests&arch=i386
     
<https://buildd.debian.org/status/logs.php?pkg=mlmmj&ver=1.5.0-1%2Breplacetests&arch=i386>
     I386 is a release architecture so the package cannot transition as
     long as it fails to build for it. All of the other release
     architectures build successfully.
     https://buildd.debian.org/status/package.php?p=mlmmj&suite=experimental
     <https://buildd.debian.org/status/package.php?p=mlmmj&suite=experimental>
        -- Chris Chris Knadle chris.kna...@coredump.us On 5/26/25
     10:48, Erwan MAS wrote:

         Hi , I fix 2 bugs that is preventing tests to complete without
         failure . They are now integrated into 1.5.1 , see
         
https://codeberg.org/mlmmj/mlmmj/commits/commit/67c405177dfa6bce8495ba0a51bea4c6373fbef6
         see commit
         
https://codeberg.org/mlmmj/mlmmj/commit/98358dc423a95f5ea152acdbb6380037957b107c
         see commit
         
https://codeberg.org/mlmmj/mlmmj/commit/e8253bb6bc6c677f462b1274d448e8f8532e1e24
         So i tested on aarch64 , and now i have: 196/196 passed (0
         failed)


I still see 1.5.0 not 1.5.1 am I missing something?

Bapt
Description: fix FTBFS bug
  Prior to this patch MLMMJ 1.5.0 compiles successfully on all Debian
  architectures but then fails the atf-sh post-compile tests intermittently.
Author: Erwan MAS <er...@mas.nom.fr>, Baptiste Daroussin <b...@freebsd.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103308
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104274
Applied-Upstream: yes, most of the upstream commits between 1.5.0 and 1.5.2
Last-Updated: 2025-05-27

--- a/src/gethdrline.c
+++ b/src/gethdrline.c
@@ -36,7 +36,7 @@
 char *gethdrline(FILE *f, char **unfolded)
 {
 	char *line = NULL, *retstr = NULL, *oldretstr = NULL, *oldunfolded = NULL;
-	char ch;
+	int ch;
 	size_t linecap = 0;
 
 	if (getline(&line, &linecap, f) <= 0) {
--- a/tests/mlmmj.c
+++ b/tests/mlmmj.c
@@ -257,7 +257,7 @@
 		int s = fakesmtp(mypipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		/*
 		 * Now we can accept incoming connections one
 		 * at a time using accept(2).
@@ -1005,7 +1005,7 @@
 		int s = fakesmtp(smtppipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			err(5, "accept()");
@@ -1045,7 +1045,7 @@
 		int s = fakesmtp(smtppipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			err(5, "accept()");
@@ -1070,7 +1070,7 @@
 		int s = fakesmtp(smtppipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			err(5, "accept()");
@@ -1097,7 +1097,7 @@
 		int s = fakesmtp(smtppipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			err(5, "accept()");
@@ -1888,20 +1888,26 @@
 	finish_subs_list(s);
 }
 
+static void
+setup_listtext(const atf_tc_t *tc)
+{
+	char *dir = NULL;
+	rmdir("list/text");
+	xasprintf(&dir, "%s/../listtexts/en",
+	    atf_tc_get_config_var(tc, "srcdir"));
+
+	symlink(dir, "list/text");
+}
+
 ATF_TC_BODY(notify_sub, tc)
 {
-	char *dir;
 	const char *path;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	int smtppipe[2];
@@ -2100,7 +2106,7 @@
 		int s = fakesmtp(smtppipe[1]);
 		int c;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			err(5, "accept()");
@@ -2225,18 +2231,13 @@
 
 ATF_TC_BODY(generate_subscription, tc)
 {
-	char *dir;
 	const char *path;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	int smtppipe[2];
@@ -2273,18 +2274,13 @@
 
 ATF_TC_BODY(generate_subconfirm, tc)
 {
-	char *dir;
 	const char *path;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	int smtppipe[2];
@@ -2429,18 +2425,13 @@
 
 ATF_TC_BODY(send_confirmation_mail, tc)
 {
-	char *dir;
 	const char *path;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	int smtppipe[2];
@@ -2562,17 +2553,12 @@
 
 ATF_TC_BODY(send_help, tc)
 {
-	char *dir;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	atf_utils_create_file("mail", "headers\n\nbody\n");
@@ -2703,6 +2689,8 @@
 	pid_t p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2713,6 +2701,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2723,6 +2713,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2736,6 +2728,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2747,6 +2741,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2761,6 +2757,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2775,6 +2773,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2788,6 +2788,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2800,6 +2802,8 @@
 	p = atf_utils_fork();
 	if (p == 0) {
 		struct ml ml;
+		ml_init(&ml);
+		ml.dir = "list";
 		enum subtype subtype = 0;
 		char *addr;
 		ml.fd = open(".", O_DIRECTORY);
@@ -2811,17 +2815,12 @@
 
 ATF_TC_BODY(send_probe, tc)
 {
-	char *dir;
 	init_ml(true);
 	struct ml ml;
 	ml_init(&ml);
 	ml.dir = "list";
 	ml_open(&ml, false);
-	rmdir("list/text");
-	xasprintf(&dir, "%s/listtexts/en",
-	    atf_tc_get_config_var(tc, "top_srcdir"));
-
-	symlink(dir, "list/text");
+	setup_listtext(tc);
 	atf_utils_create_file("list/control/smtpport", "25678");
 	atf_utils_create_file("list/control/smtphelo", "heloname");
 	int smtppipe[2];
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.69])
-AC_INIT([mlmmj],[1.5.0],[b...@nours.eu])
+AC_INIT([mlmmj],[1.5.2],[b...@nours.eu])
 
 VERSION=$PACKAGE_VERSION
 AC_SUBST(VERSION)
--- a/tests/mlmmj-process.in
+++ b/tests/mlmmj-process.in
@@ -77,6 +77,8 @@
 Bcc: list@test
 EOF
 	echo "list@test" > list/control/listaddress
+	# ensure we don't try to really send email to a real mailserver
+	echo "25678" > list/control/smtpport
 	rmdir list/text
 	ln -s ${top_srcdir}/listtexts/en list/text
 	atf_check -s exit:0 $mlmmjprocess -L list -m mailfile
--- a/src/mlmmj-maintd.c
+++ b/src/mlmmj-maintd.c
@@ -203,7 +203,7 @@
 			   mail currently being sent */
 			t = time(NULL);
 			if(fstatat(qfd, dp->d_name, &st, 0) == 0) {
-				if(t - st.st_mtime > (time_t)36000) {
+				if(t -  (time_t)36000 > st.st_mtime) {
 					unlinkat(qfd, dp->d_name, 0);
 					/* avoid leaving orphans */
 					unlinkat(qfd, fromname, 0);
@@ -221,7 +221,7 @@
 		/* before we try again, check and see if it's old */
 		bouncelife = ctrltimet(ml->ctrlfd, "bouncelife", BOUNCELIFE);
 		t = time(NULL);
-		if(t - st.st_mtime > bouncelife) {
+		if(t - bouncelife > st.st_mtime ) {
 			if (unlinkat(qfd, dp->d_name, 0) == -1) {
 				log(" - Could not remove queue/%s: %s\n",
 				    dp->d_name, strerror(errno));
@@ -291,7 +291,7 @@
 
 		/* Remove old empty directories */
 		t = time(NULL);
-		if(t - st.st_mtime > (time_t)3600 &&
+		if(t - (time_t)3600 > st.st_mtime &&
 		    unlinkat(fd, dp->d_name, AT_REMOVEDIR) == 0)
 			continue;
 
--- a/tests/mlmmj-maintd.in
+++ b/tests/mlmmj-maintd.in
@@ -737,7 +737,7 @@
 	rm list/requeue/1
 	mkdir list/requeue/1
 	mkdir list/requeue/2
-	touch -t 000101010101 list/requeue/2
+	touch -t 197001010101 list/requeue/2
 	mkdir list/requeue/3
 	cat >> list/requeue/1/subscribers <<EOF
 user1@test1
@@ -917,13 +917,13 @@
 	atf_check -s exit:0 test -f list/queue/file
 	atf_check -s exit:1 test -f list/queue/plop.hey
 
-	touch -t 000101010101 list/queue/file
+	touch -t 197001010101 list/queue/file
 	# no .mailfrom, no.reciptto no.reply-to but recent
 	atf_check $mlmmjmaintd -L list -F
 	atf_check -s exit:1 test -f mail-1.txt
 	atf_check -s exit:1 test -f list/queue/file
 
-	touch -t 000101010101 list/queue/file
+	touch -t 197001010101 list/queue/file
 	echo "bla" > list/queue/file.mailfrom
 	# no.reciptto no.reply-to old recent
 	atf_check $mlmmjmaintd -L list -F
@@ -931,7 +931,7 @@
 	atf_check -s exit:1 test -f list/queue/file
 	atf_check -s exit:1 test -f list/queue/file.mailfrom
 
-	touch -t 000101010101 list/queue/file
+	touch -t 197001010101 list/queue/file
 	echo "bla" > list/queue/file.mailfrom
 	touch list/queue/file.reply-to
 	# no.reciptto no.reply-to old recent
@@ -940,7 +940,7 @@
 	atf_check -s exit:1 test -f list/queue/file.mailfrom
 	atf_check -s exit:1 test -f list/queue/file.reply-to
 
-	touch -t 000101010101 list/queue/file
+	touch -t 197001010101 list/queue/file
 	echo "bla" > list/queue/file.mailfrom
 	echo "meh" > list/queue/file.reciptto
 	touch list/queue/file.reply-to
--- a/tests/mlmmj-bounce.in
+++ b/tests/mlmmj-bounce.in
@@ -89,6 +89,7 @@
 
 basics_6_body()
 {
+	test $(id -u) = 0 && atf_skip "Can only be run as non-root"
 	mlmmjbounce=$(command -v mlmmj-bounce)
 	init_ml ml
 	echo test@mlmmjtest > ml/control/listaddress
--- a/tests/mlmmj_tests.c
+++ b/tests/mlmmj_tests.c
@@ -115,7 +115,7 @@
 		int c;
 		char *r;
 		struct sockaddr_in cl;
-		socklen_t clsize = 0;
+		socklen_t clsize = sizeof(struct sockaddr_in);
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
 			exit(5);
--- a/tests/fakesmtpd.c
+++ b/tests/fakesmtpd.c
@@ -52,7 +52,7 @@
 {
 	int s, c;
 	FILE *f;
-	socklen_t clsize = 0;
+	socklen_t clsize = sizeof(struct sockaddr_in);
 	struct sockaddr_in me = { 0 }, cl;
 	char *line = NULL;
 	size_t linecap = 0;
@@ -60,17 +60,18 @@
 
 	s = socket(AF_INET, SOCK_STREAM, 0);
 	if (s < 0)
-		exit(1);
-	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &(int) { 1 }, sizeof(int)) != 0)
-		exit(2);
+		err(EXIT_FAILURE, "socket");
+	int opt = 1;
+	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) != 0)
+		err(EXIT_FAILURE, "setsockopt");
 	me.sin_family = AF_INET;
 	me.sin_addr.s_addr = inet_addr("127.0.0.1");
 	/* specific interface */
 	me.sin_port = htons(25678);
 	if (bind(s, (struct sockaddr *) &me, sizeof(me)) == -1)
-		exit(EXIT_FAILURE);
+		err(EXIT_FAILURE, "bin");
 	if (listen(s, 1) == -1)
-		exit(EXIT_FAILURE);
+		err(EXIT_FAILURE, "listen");
 
 	if (daemon(1, 0) != 0)
 		err(EXIT_FAILURE, "daemon");
@@ -82,7 +83,7 @@
 		FILE *fp, *fp2;
 		c = accept(s, (struct sockaddr *) &cl, &clsize);
 		if (c == -1)
-			exit(EXIT_FAILURE);
+			err(EXIT_FAILURE, "accept");
 
 		mailnum++;
 		asprintf(&mail, "mail-%d.txt", mailnum);

Reply via email to