Date: Thu, 14 Jul 2022 05:53:21 GMT From: Philip Paeps <philip@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 542ccf96b5d6 - main - mail/mlmmj: allow configuring IPv6 relayhosts Message-ID: <202207140553.26E5rLKX020615@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/ports/commit/?id=542ccf96b5d67adbc9b422d8e5d63de9be4f8390 commit 542ccf96b5d67adbc9b422d8e5d63de9be4f8390 Author: Philip Paeps <philip@FreeBSD.org> AuthorDate: 2022-07-14 05:42:47 +0000 Commit: Philip Paeps <philip@FreeBSD.org> CommitDate: 2022-07-14 05:51:58 +0000 mail/mlmmj: allow configuring IPv6 relayhosts Allow IPv6 addresses and hostnames that only resolve to IPv6 addresses in control/relayhost. This fixes mlmmj on IPv6-only systems. Approved by: bapt (implicit) --- mail/mlmmj/Makefile | 2 +- mail/mlmmj/files/patch-src_mlmmj-send.c | 115 ++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) diff --git a/mail/mlmmj/Makefile b/mail/mlmmj/Makefile index c1655ca42f86..0218cba4a1b7 100644 --- a/mail/mlmmj/Makefile +++ b/mail/mlmmj/Makefile @@ -2,7 +2,7 @@ PORTNAME= mlmmj PORTVERSION= 1.3.0 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= mail MASTER_SITES= http://mlmmj.org/releases/ diff --git a/mail/mlmmj/files/patch-src_mlmmj-send.c b/mail/mlmmj/files/patch-src_mlmmj-send.c new file mode 100644 index 000000000000..1529884b0a37 --- /dev/null +++ b/mail/mlmmj/files/patch-src_mlmmj-send.c @@ -0,0 +1,115 @@ +--- src/mlmmj-send.c.orig 2022-07-14 05:25:21 UTC ++++ src/mlmmj-send.c +@@ -817,13 +817,12 @@ int main(int argc, char **argv) + char *listctrl = NULL, *subddirname = NULL, *listdir = NULL; + char *mlmmjbounce = NULL, *bindir, *mailmap, *probefile, *a; + char *body = NULL, *hdrs = NULL, *memmailsizestr = NULL, *verp = NULL; +- char relay[16], *listname, *listfqdn, *verpfrom, *maxverprecipsstr; ++ char *listname, *listfqdn, *verpfrom, *maxverprecipsstr; + char strindex[32], *reply, *strport, *smtphelo, *requeuefilename; + ssize_t memmailsize = 0; + DIR *subddir; + struct dirent *dp; + struct stat st; +- struct hostent *relayent; + uid_t uid; + struct strlist stl; + unsigned short smtpport = 25; +@@ -1080,22 +1079,11 @@ int main(int argc, char **argv) + + itoa(mindex, strindex); + +- if(!relayhost) { ++ if(!relayhost) + relayhost = ctrlvalue(listdir, "relayhost"); +- } + if(!relayhost) +- strncpy(relay, RELAYHOST, sizeof(relay)); +- else { +- relayent = gethostbyname(relayhost); +- if(relayent == NULL) { +- strncpy(relay, RELAYHOST, sizeof(relay)); +- } else { +- if(inet_ntop(relayent->h_addrtype, +- relayent->h_addr_list[0], +- relay, sizeof(relay)) == NULL) +- strncpy(relay, RELAYHOST, sizeof(relay)); +- } +- } ++ relayhost = mystrdup(RELAYHOST); ++ + strport = ctrlvalue(listdir, "smtpport"); + if(strport) + smtpport = (unsigned short)atol(strport); +@@ -1107,7 +1095,7 @@ int main(int argc, char **argv) + switch(listctrl[0]) { + case '1': /* A single mail is to be sent */ + case '6': +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(send_mail(sockfd, bounceaddr, to_addr, replyto, + mailmap, st.st_size, listdir, NULL, + hdrs, hdrslen, body, bodylen)) { +@@ -1165,7 +1153,7 @@ int main(int argc, char **argv) + } + break; + case '2': /* Moderators */ +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(send_mail_many_fd(sockfd, bounceaddr, NULL, mailmap, + st.st_size, subfd, NULL, NULL, NULL, + listdir, NULL, hdrs, hdrslen, +@@ -1177,7 +1165,7 @@ int main(int argc, char **argv) + } + break; + case '3': /* resending earlier failed mails */ +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(send_mail_many_fd(sockfd, NULL, NULL, mailmap, st.st_size, + subfd, listaddr, listdelim, mailfilename, + listdir, mlmmjbounce, hdrs, hdrslen, +@@ -1190,7 +1178,7 @@ int main(int argc, char **argv) + unlink(subfilename); + break; + case '4': /* send mails to owner */ +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(send_mail_many_fd(sockfd, bounceaddr, NULL, mailmap, + st.st_size, subfd, listaddr, listdelim, + mailfilename, listdir, mlmmjbounce, +@@ -1202,7 +1190,7 @@ int main(int argc, char **argv) + } + break; + case '5': /* bounceprobe - handle relayhost local users bouncing*/ +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(send_mail(sockfd, bounceaddr, to_addr, replyto, + mailmap, st.st_size, listdir, NULL, + hdrs, hdrslen, body, bodylen)) { +@@ -1267,7 +1255,7 @@ int main(int argc, char **argv) + } + + if(verp) { +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(sockfd > -1) { + if(write_mail_from(sockfd, verpfrom, verp)) { + log_error(LOG_ARGS, +@@ -1331,7 +1319,7 @@ int main(int argc, char **argv) + } + } + if(stl.count == maxverprecips) { +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(verp) { + sendres = send_mail_verp( + sockfd, &stl, +@@ -1375,7 +1363,7 @@ int main(int argc, char **argv) + + } + if(stl.count) { +- initsmtp(&sockfd, relay, smtpport, smtphelo); ++ initsmtp(&sockfd, relayhost, smtpport, smtphelo); + if(verp) { + sendres = send_mail_verp(sockfd, &stl, mailmap, + st.st_size, verpfrom, listdir,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207140553.26E5rLKX020615>