commit:     a04937260b6f3d546bbc482389c95e5d1e16fa60
Author:     Gabi Falk <gabifalk <AT> gmx <DOT> com>
AuthorDate: Wed Aug 13 10:00:00 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 13 11:03:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0493726

mail-mta/msmtp: fix tests failing without USE=daemon

Closes: https://bugs.gentoo.org/948087
Link: https://github.com/marlam/msmtp/pull/200
Signed-off-by: Gabi Falk <gabifalk <AT> gmx.com>
Part-of: https://github.com/gentoo/gentoo/pull/43427
Closes: https://github.com/gentoo/gentoo/pull/43427
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/msmtp-fix-tests-without-msmtpd.patch     | 56 ++++++++++++++++++++++
 mail-mta/msmtp/msmtp-1.8.28.ebuild                 |  2 +
 mail-mta/msmtp/msmtp-1.8.30.ebuild                 |  2 +
 3 files changed, 60 insertions(+)

diff --git a/mail-mta/msmtp/files/msmtp-fix-tests-without-msmtpd.patch 
b/mail-mta/msmtp/files/msmtp-fix-tests-without-msmtpd.patch
new file mode 100644
index 000000000000..a7c5cf17f1d1
--- /dev/null
+++ b/mail-mta/msmtp/files/msmtp-fix-tests-without-msmtpd.patch
@@ -0,0 +1,56 @@
+https://github.com/marlam/msmtp/pull/200
+https://bugs.gentoo.org/948087
+
+From fce1dfefd7af8175708deabc3e55f8682d181d22 Mon Sep 17 00:00:00 2001
+From: Gabi Falk <[email protected]>
+Date: Wed, 13 Aug 2025 09:00:00 +0000
+Subject: [PATCH] tests: skip msmtpd-dependent tests if msmtpd is not built
+
+Link: https://bugs.gentoo.org/948087
+---
+ tests/test-auth-plain.sh      | 8 +++++++-
+ tests/test-header-handling.sh | 8 +++++++-
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-auth-plain.sh b/tests/test-auth-plain.sh
+index 27d406e..a670dcd 100755
+--- a/tests/test-auth-plain.sh
++++ b/tests/test-auth-plain.sh
+@@ -2,9 +2,15 @@
+ 
+ set -e
+ 
++msmtpd=../src/msmtpd
++if [ ! -x $msmtpd ]; then
++      echo 'msmtpd is not built'
++      exit 77
++fi
++
+ # Start an msmtpd with PLAIN authentication
+ echo "Starting msmtpd"
+-../src/msmtpd --interface=::1 --port=12345 --auth='testuser,echo 
testpassword' \
++$msmtpd --interface=::1 --port=12345 --auth='testuser,echo testpassword' \
+       --command='cat > out-auth-plain-mail.txt; echo > 
out-auth-plain-rcpt.txt' &
+ MSMTPD_PID=$!
+ trap "kill $MSMTPD_PID" EXIT
+diff --git a/tests/test-header-handling.sh b/tests/test-header-handling.sh
+index e58cde4..9109bd3 100755
+--- a/tests/test-header-handling.sh
++++ b/tests/test-header-handling.sh
+@@ -2,9 +2,15 @@
+ 
+ set -e
+ 
++msmtpd=../src/msmtpd
++if [ ! -x $msmtpd ]; then
++      echo 'msmtpd is not built'
++      exit 77
++fi
++
+ # Start an msmtpd that dumps the mail and the recipient lists so we can check 
them
+ echo "Starting msmtpd"
+-../src/msmtpd --interface=::1 --port=12346 \
++$msmtpd --interface=::1 --port=12346 \
+       --command='cat > out-header-handling-mail.txt; echo > 
out-header-handling-rcpt.txt' &
+ MSMTPD_PID=$!
+ trap "kill $MSMTPD_PID" EXIT

diff --git a/mail-mta/msmtp/msmtp-1.8.28.ebuild 
b/mail-mta/msmtp/msmtp-1.8.28.ebuild
index 817e0e7b10d3..ca630062ed1c 100644
--- a/mail-mta/msmtp/msmtp-1.8.28.ebuild
+++ b/mail-mta/msmtp/msmtp-1.8.28.ebuild
@@ -58,6 +58,8 @@ BDEPEND="
 
 DOCS="AUTHORS ChangeLog NEWS README THANKS doc/msmtprc*"
 
+PATCHES=( "${FILESDIR}/${PN}-fix-tests-without-msmtpd.patch" )
+
 src_prepare() {
        # Use default Gentoo location for mail aliases
        sed 's:/etc/aliases:/etc/mail/aliases:' \

diff --git a/mail-mta/msmtp/msmtp-1.8.30.ebuild 
b/mail-mta/msmtp/msmtp-1.8.30.ebuild
index 190d9f4f528a..6d7dbf7aa1b0 100644
--- a/mail-mta/msmtp/msmtp-1.8.30.ebuild
+++ b/mail-mta/msmtp/msmtp-1.8.30.ebuild
@@ -58,6 +58,8 @@ BDEPEND="
 
 DOCS="AUTHORS ChangeLog NEWS README THANKS doc/msmtprc*"
 
+PATCHES=( "${FILESDIR}/${PN}-fix-tests-without-msmtpd.patch" )
+
 src_prepare() {
        # Use default Gentoo location for mail aliases
        sed 's:/etc/aliases:/etc/mail/aliases:' \

Reply via email to