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,117 +1,118 @@ PORTNAME= nmh PORTVERSION= ${NMH_COMMIT_DATE} +PORTREVISION= 1 MASTER_SITES= # CATEGORIES= mail PKGNAMESUFFIX= -devel DISTNAME= ${PORTNAME}${PKGNAMESUFFIX}-${NMH_COMMIT_DATE}-${GIT_TAGNAME} MAINTAINER= cy@FreeBSD.org COMMENT= Cleaned up MH mailer suite WWW= https://savannah.nongnu.org/projects/nmh/ GIT_TAGNAME= fefdea3 NMH_COMMIT_DATE= 2023.12.03 WRKSRC= ${WRKDIR}/${PORTNAME}-${GIT_TAGNAME} LICENSE= BSD3CLAUSE USES= autoreconf:build cpe gmake iconv ncurses readline shebangfix SHEBANG_FILES= docs/contrib/ml docs/contrib/replyfilter docs/contrib/vpick GNU_CONFIGURE= yes CONFIGURE_ARGS= --libdir=${PREFIX}/libexec/nmh \ --sysconfdir=${PREFIX}/etc \ --docdir=${DOCSDIR} LIB_DEPENDS= libcurl.so:ftp/curl \ liblockfile.so:devel/liblockfile OPTIONS_DEFINE= DOCS HASH_BKP SASL2 TLS REPLYFILTER OPTIONS_RADIO= MIME_HTML OPTIONS_SINGLE= MTS LOCKING OPTIONS_SINGLE_MTS= SMTP SENDMAIL_SMTP SENDMAIL_PIPE OPTIONS_SINGLE_LOCKING= DOT FCNTL FLOCK LOCKF OPTIONS_RADIO_MIME_HTML= ELINKS LINKS LYNX W3M SASL2_DESC= SASL2 support SASL2_CONFIGURE_WITH= cyrus-sasl SASL2_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASL2_LDFLAGS=-L${LOCALBASE}/lib SASL2_CPPFLAGS=-I${LOCALBASE}/include HASH_BKP_DESC= Use hash as backup prefix (default is a comma) HASH_BKP_CONFIGURE_WITH= hash-backup REPLYFILTER_DESC= Install dependencies for contrib/replyfilter REPLYFILTER_RUN_DEPENDS= p5-MIME-Tools>=0:mail/p5-MIME-Tools \ p5-Mail-Tools>=0:mail/p5-Mail-Tools \ w3m>=0:www/w3m \ par>=0:textproc/par SMTP_DESC= Use remote SMTP SMTP_CONFIGURE_ON= --with-mts=smtp SENDMAIL_SMTP_DESC= Use local sendmail (connect through socket) SENDMAIL_SMTP_CONFIGURE_ON= --with-mts=sendmail/smtp SENDMAIL_PIPE_DESC= Use local sendmail (connect through pipe) SENDMAIL_PIPE_CONFIGURE_ON= --with-mts=sendmail/pipe DOT_DESC= Dot file locking DOT_CONFIGURE_ON= --with-locking=dot FCNTL_DESC= fcntl() file locking FCNTL_CONFIGURE_ON= --with-locking=fcntl FLOCK_DESC= flock() file locking FLOCK_CONFIGURE_ON= --with-locking=flock LOCKF_DESC= lockf file locking LOCKF_CONFIGURE_ON= --with-locking=lockf # The reason for BUILD_DEPENDS is nmh detects and configures itself for # whichever text-based browser is installed. ELINKS_DESC= Install dependencies for www/elinks ELINKS_BUILD_DEPENDS= elinks>=0:www/elinks ELINKS_RUN_DEPENDS= elinks>=0:www/elinks LINKS_DESC= Install dependencies for www/links LINKS_BUILD_DEPENDS= links>=0:www/links LINKS_RUN_DEPENDS= links>=0:www/links LYNX_DESC= Install dependencies for www/lynx LYNX_BUILD_DEPENDS= lynx>=0:www/lynx LYNX_RUN_DEPENDS= lynx>=0:www/lynx W3M_DESC= Install dependencies for www/w3m W3M_BUILD_DEPENDS= w3m>=0:www/w3m W3M_RUN_DEPENDS= w3m>=0:www/w3m OPTIONS_DEFAULT= SENDMAIL_PIPE FLOCK W3M .include .if ${PORT_OPTIONS:MTLS} CONFIGURE_ARGS+= --with-tls USES+= ssl .else CONFIGURE_ARGS+= --without-tls .endif .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-debug LDFLAGS+= -g DEBUG_FLAGS+= -O0 -Wall -Wextra -g .endif CONFLICTS_INSTALL= ali ja-mh pixie p5-Dist-Joseki nmh-1.* do-fetch: @cd ${DISTDIR} && \ if [ ! -f ${DISTNAME}${EXTRACT_SUFX} ]; then \ fetch -o ${DISTNAME}${EXTRACT_SUFX} \ "https://git.savannah.gnu.org/gitweb/?p=nmh.git;a=snapshot;h=${GIT_TAGNAME};sf=tgz"; \ fi pre-configure: cd ${WRKSRC} && ./autogen.sh post-install: @${FIND} ${STAGEDIR}${ETCDIR} -type f -exec ${MV} {} {}-dist \; .include 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);