From nobody Fri Dec 08 23:42:15 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sn73C6gqRz53cyg; Fri, 8 Dec 2023 23:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sn73C65jsz3FsC; Fri, 8 Dec 2023 23:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702078935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mNW+p/NtREk7rWEcLCIMiSVylP2ggDvtcwnVLAs4heE=; b=nX/wXApaThwkDKEJTjK/kCGBrje11Lvm9nLyAmrLbIEwQzXprH0ymsXy6L1yTGiQ0wDgz7 5EyPmJCyoQe4BA5UaQBkjXVbWqq2BvU+HBqDjPY6kbSLaAvobYApr0xfRr+U/YZ/mEYFvp RCzBtBGM0gb91Vnqu4QXOjSpex5CvRrMmyJ5PmciE756XkVsZW1LA/lTZXPfu6qXi4a9yx Ql8UJkt4RH0TX4sRnrBnA5y1Pk/coRA9Vb5VehYGjE538mk4wJzTBWvB0SeBfdmWE4hTgQ rE73SUCu8/wXmvpbnGUfWceLwBMJgNemmqhAfTEKAx9iLawWfagDjc9iHwQD3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702078935; a=rsa-sha256; cv=none; b=AzXPc2bInEpZ4qBZim/oX2Qn++G/NlPYXDnwBKdXqYnNxN6cYHYH10uqsnvnkiGoaW6VHE u1RKIQpnMRhpY/cJWiXOM2R2IgLexYUq9inINsuW6nNOC7P2fqQBFouCb2WQhBCkPW/cOh fIYQKvA7ab0QE8/4nfb/HbEZpWYEOtAxRf4WSFh/utw6Z4UxRV0oLuqqsOGmLRA3QYhGlQ vdUx/RqWwxP5Ex3ssZPBPggjICrBidbCT9vfi7b56Pqn4u5ShMpu9U1S3MkF+NMTb/hsZL 5VyaACo/fjgIyXNvpIVppiqV87y5f6kmOZY+cX5j0t6Cnu1iUo242f5/L+5r7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702078935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mNW+p/NtREk7rWEcLCIMiSVylP2ggDvtcwnVLAs4heE=; b=KTodrJWkOuc/ZPVxIEGD5B379tG93ZIcOfb1Lf03Fl13u2ivm4D8wYKK8TYhafRAEmn67E nEOpm9Um9wxV3drkU78eI+33hA8tZb/3NOBLR+fW9vYG6haI16W+0Cdbh/r1AUdbdHIFHU IEeakGJDtdx2qLNFg40pJdT4Ng3Oil8BsBGbR13Quh7DO5ZmsRv/F/UkbbKlnK8ciVgTvC OgW8K18iS+i+Lvu//TPsge/6QkpeanbUPMTN/K/yuqlUFX01Xwc2zTwzFmiz0f+Wk4/Twr a4eBp1kcKxYUpVcXu4dTsEPF/V2NpmS2nSG4p27UjjgNCbNUBsfVHjFgEqhdvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sn73C4tTWzhJd; Fri, 8 Dec 2023 23:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B8NgFXD089589; Fri, 8 Dec 2023 23:42:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B8NgF9s089585; Fri, 8 Dec 2023 23:42:15 GMT (envelope-from git) Date: Fri, 8 Dec 2023 23:42:15 GMT Message-Id: <202312082342.3B8NgF9s089585@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 7767c9dff70c - main - mail/nmh-devel: Fix message corruption List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7767c9dff70c419bf936b26e8ada6a545dab5817 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=7767c9dff70c419bf936b26e8ada6a545dab5817 commit 7767c9dff70c419bf936b26e8ada6a545dab5817 Author: Cy Schubert AuthorDate: 2023-12-08 23:39:12 +0000 Commit: Cy Schubert CommitDate: 2023-12-08 23:42:08 +0000 mail/nmh-devel: Fix message corruption Upstream 8f897f65 (2023-03-12) has resulted in data corruption with sent emails. This commit removes this upstream commmit and all that subsequently "fix" it. --- mail/nmh-devel/Makefile | 1 + mail/nmh-devel/files/patch-test_fakesmtp.c | 29 +++++++++ mail/nmh-devel/files/patch-test_mhshow_test-binary | 20 ++++++ .../files/patch-test_post_test-post-basic | 74 ++++++++++++++++++++++ mail/nmh-devel/files/patch-uip_post.c | 40 ++++++++++++ 5 files changed, 164 insertions(+) diff --git a/mail/nmh-devel/Makefile b/mail/nmh-devel/Makefile index f7da515c6556..cdbcf2471fd6 100644 --- a/mail/nmh-devel/Makefile +++ b/mail/nmh-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= nmh PORTVERSION= ${NMH_COMMIT_DATE} +PORTREVISION= 1 MASTER_SITES= # CATEGORIES= mail PKGNAMESUFFIX= -devel diff --git a/mail/nmh-devel/files/patch-test_fakesmtp.c b/mail/nmh-devel/files/patch-test_fakesmtp.c new file mode 100644 index 000000000000..65fa3c744d58 --- /dev/null +++ b/mail/nmh-devel/files/patch-test_fakesmtp.c @@ -0,0 +1,29 @@ +--- test/fakesmtp.c.orig 2023-12-04 03:00:44 UTC ++++ test/fakesmtp.c +@@ -35,13 +35,12 @@ enum { + SMTP_XOAUTH_ERR + }; + +-static ssize_t getsmtp(int, char *); ++static int getsmtp(int, char *); + + int + main(int argc, char *argv[]) + { +- ssize_t rc; +- int conn, smtp_state; ++ int rc, conn, smtp_state; + FILE *f; + const char *xoauth = getenv("XOAUTH"); + const char *smtputf8 = getenv("SMTPUTF8"); +@@ -74,8 +73,8 @@ main(int argc, char *argv[]) + if (rc == -1) + break; /* EOF */ + +- fwrite(line, rc, 1, f); +- fwrite("\n", 1, 1, f); ++ fputs(line, f); ++ putc('\n', f); + + switch (smtp_state) { + case SMTP_DATA: diff --git a/mail/nmh-devel/files/patch-test_mhshow_test-binary b/mail/nmh-devel/files/patch-test_mhshow_test-binary new file mode 100644 index 000000000000..73aabc7d7060 --- /dev/null +++ b/mail/nmh-devel/files/patch-test_mhshow_test-binary @@ -0,0 +1,20 @@ +--- test/mhshow/test-binary.orig 2023-12-04 03:00:44 UTC ++++ test/mhshow/test-binary +@@ -21,7 +21,7 @@ expected="$MH_TEST_DIR/test-binary$$.expected" + + #### Use the printf to output the NUL byte so that this + #### file (test-binary) doesn't need to be a binary file. +-printf '%s\000%s' >"${expected}" \ ++printf '%s\x00%s' >"${expected}" \ + "[ Message inbox:11 ] + To: recipient@example.edu + From: sender@example.edu +@@ -33,7 +33,7 @@ Here's a null byte: " ". + Here's a null byte: " ". + " + +-printf '%s\000%s' >`mhpath new` \ ++printf '%s\x00%s' >`mhpath new` \ + "From: sender@example.edu + To: recipient@example.edu + Subject: test binary content diff --git a/mail/nmh-devel/files/patch-test_post_test-post-basic b/mail/nmh-devel/files/patch-test_post_test-post-basic new file mode 100644 index 000000000000..5ed616ed67ce --- /dev/null +++ b/mail/nmh-devel/files/patch-test_post_test-post-basic @@ -0,0 +1,74 @@ +--- test/post/test-post-basic.orig 2023-12-04 03:00:44 UTC ++++ test/post/test-post-basic +@@ -143,13 +143,12 @@ check "${testname}.err" "${testname}.err.expected" + set +e + check "${testname}.err" "${testname}.err.expected" + +-#### Cheat: SMTPUTF8 enables 8BITMIME in fakestmp. Set it for each test +-#### that needs it below. +- + # + # 8-bit with 8BITMIME support + # + start_test '8-bit with 8BITMIME support' ++# Cheat: SMTPUTF8 enables 8BITMIME in fakestmp ++SMTPUTF8=1; export SMTPUTF8 + cat > "${testname}.expected" < BODY=8BITMIME +@@ -168,8 +167,9 @@ EOF + . + QUIT + EOF +-SMTPUTF8=1 test_post "${testname}.actual" "${testname}.expected" ++test_post "${testname}.actual" "${testname}.expected" + ++ + # + # 8-bit with 8BITMIME support, inferred from content + # +@@ -202,43 +202,7 @@ EOF + . + QUIT + EOF +-SMTPUTF8=1 test_post "${testname}.actual" "${testname}.expected" +- +-# +-# binary content containing a NUL +-# +-start_test "content containing NUL" +-#### Use the printf to output the NUL byte so that this +-#### file (test-binary) doesn't need to be a binary file. +-printf '%s\000%s' > "${MH_TEST_DIR}/Mail/draft" \ +-"From: Mr Nobody +-To: Somebody Else +-Subject: Test +-MIME-Version: 1.0 +-Content-Type: application/octet-stream +-Content-Transfer-Encoding: binary +- +-This is a test, with a NUL character: " " +-" +- +-printf '%s\000%s' > "${testname}.expected" \ +-"EHLO nosuchhost.example.com +-MAIL FROM: BODY=8BITMIME +-RCPT TO: +-DATA +-From: Mr Nobody +-To: Somebody Else +-Subject: Test +-MIME-Version: 1.0 +-Content-Type: application/octet-stream +-Content-Transfer-Encoding: binary +-Date: +- +-This is a test, with a NUL character: " " +-. +-QUIT +-" +-SMTPUTF8=1 test_post "${testname}.actual" "${testname}.expected" ++test_post "${testname}.actual" "${testname}.expected" + + + finish_test diff --git a/mail/nmh-devel/files/patch-uip_post.c b/mail/nmh-devel/files/patch-uip_post.c new file mode 100644 index 000000000000..9284651a3b47 --- /dev/null +++ b/mail/nmh-devel/files/patch-uip_post.c @@ -0,0 +1,40 @@ +--- uip/post.c.orig 2023-12-04 03:00:44 UTC ++++ uip/post.c +@@ -657,34 +657,17 @@ main (int argc, char **argv) + free (cp); + continue; + +- case BODY: { +- size_t n, n_written; +- ++ case BODY: + finish_headers (out); + if (whomsw) + break; +- if (fwrite ("\n", 1, 1, out) != 1) { +- adios ("write of newline between header and body", +- "failed"); +- } +- /* Don't emit trailing NUL, to not interfere with SMTP +- conversation. */ +- n = bufsz > 0 && buf[bufsz-1] == '\0' ? bufsz - 1 : bufsz; +- if (n > 0 && (n_written = fwrite (buf, 1, n, out)) != n) { +- adios ("octets of body", "wrote %ld instead of %ld", +- n_written, n); +- } ++ fprintf (out, "\n%s", buf); + while (state == BODY) { + bufsz = sizeof buf; + state = m_getfld2(&gstate, name, buf, &bufsz); +- n = bufsz > 0 && buf[bufsz-1] == '\0' ? bufsz - 1 : bufsz; +- if (n > 0 && (n_written = fwrite (buf, 1, n, out)) != n) { +- adios ("octets of body continuation", +- "wrote %ld instead of %ld", n_written, n); +- } ++ fputs (buf, out); + } + break; +- } + + case FILEEOF: + finish_headers (out);