diff options
author | pav <pav@FreeBSD.org> | 2004-02-29 01:51:56 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2004-02-29 01:51:56 +0800 |
commit | 132bb447f6582d2fc685f8cf3054d89063b9d071 (patch) | |
tree | 614a8f38889c19d22bd4827debd0b8a8aed847b4 /mail | |
parent | 205a3658d211ca7af4b75d4d3634d70c388ef208 (diff) | |
download | freebsd-ports-gnome-132bb447f6582d2fc685f8cf3054d89063b9d071.tar.gz freebsd-ports-gnome-132bb447f6582d2fc685f8cf3054d89063b9d071.tar.zst freebsd-ports-gnome-132bb447f6582d2fc685f8cf3054d89063b9d071.zip |
- Add WITH_ESMTP_SIZE_OPTION knob
PR: ports/61490
Submitted by: Michael Ranner <mranner@inode.at>
Approved by: maintainer
Diffstat (limited to 'mail')
-rw-r--r-- | mail/messagewall/Makefile | 11 | ||||
-rw-r--r-- | mail/messagewall/files/esmtpsize.patch | 39 |
2 files changed, 50 insertions, 0 deletions
diff --git a/mail/messagewall/Makefile b/mail/messagewall/Makefile index 898b96a3f7fd..6723552c03ca 100644 --- a/mail/messagewall/Makefile +++ b/mail/messagewall/Makefile @@ -34,6 +34,11 @@ pre-fetch: @${ECHO} " The profile for the first recipient will be applied to all" @${ECHO} " recipients of the message." @${ECHO} "" + @${ECHO} " -DWITH_ESMTP_SIZE_OPTION to allow messagewall to handle the" + @${ECHO} " size option in MAIL FROM: <foo@bar.com> SIZE=12345678 (RFC1870)" + @${ECHO} " This can safe a lot of bandwith, because it rejects any email," + @${ECHO} " if message size is greater than max message size." + @${ECHO} "" # Patch from "Quentin Guernsey" <quentin@wingateweb.com> # for details see http://www.messagewall.org/cgi-bin/ezmlm-browse.cgi?command=showmsg&list=messagewall-discuss&month=200303&msgnum=921&threadid=lcjcimckfmdphlhpjjhn @@ -41,6 +46,12 @@ pre-fetch: EXTRA_PATCHES+= ${PATCHDIR}/allow-multiple-recipients.patch .endif +# Patch from "Michael Ranner" <mranner@inode.at> +# for details see http://www.ranner.jawa.at/messagewall.php +.if defined(WITH_ESMTP_SIZE_OPTION) +EXTRA_PATCHES+= ${PATCHDIR}/esmtpsize.patch +.endif + post-patch: ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/firemake.cflags \ diff --git a/mail/messagewall/files/esmtpsize.patch b/mail/messagewall/files/esmtpsize.patch new file mode 100644 index 000000000000..724bcc291312 --- /dev/null +++ b/mail/messagewall/files/esmtpsize.patch @@ -0,0 +1,39 @@ +--- smtp.c.orig Fri Jan 16 00:00:00 2004 ++++ smtp.c Fri Jan 16 00:04:04 2004 +@@ -394,6 +394,8 @@ + int atsign; + int l; + int j; ++ int k; ++ long message_size; + + if (outline.a == 0) + firestring_estr_alloc(&outline,SMTP_LINE_MAXLEN); +@@ -582,6 +584,27 @@ + fprintf(stderr,"{%d} (%d) SMTP/REJECT: MAIL path too long\n",process,client); + tls_client_write(client,SMTP_BADCHAR,sizeof(SMTP_BADCHAR) - 1); + return 0; ++ } ++ ++ /* ++ * ESMPT SIZE patch (2004-01-16) from Michael Ranner <mranner@inode.at> ++ * With this patch, messagewall handles the ESMTP SIZE option (RFC1870) ++ * "MAIL FROM: <mranner@inode.at> SIZE=12345" like sendmail does. ++ * This patch can help you to safe a lot of bandwith. ++ */ ++ k = firestring_estr_stristr(line,"size",l); ++ ++ if (k > -1) { ++ k = firestring_estr_strchr(line,'=',k); ++ if ((k > -1) && (line->l > ++k)) { ++ message_size = strtol(&line->s[k],(char **)NULL,10); ++ if (message_size > max_message_size) { ++ fprintf(stderr,"{%d} (%d) SMTP/REJECT: esmtp size %d bytes, message too long\n",process,client,message_size); ++ tls_client_write(client,SMTP_MESSAGE_TOOLONG,sizeof(SMTP_MESSAGE_TOOLONG) + 1); ++ } else { ++ fprintf(stderr,"{%d} (%d) SMTP/STATUS: esmtp size %d bytes\n",process,client,message_size); ++ } ++ } + } + + /* |