summaryrefslogtreecommitdiffstats
path: root/mail/messagewall/files
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2004-02-28 17:51:56 +0000
committerpav <pav@FreeBSD.org>2004-02-28 17:51:56 +0000
commit132bb447f6582d2fc685f8cf3054d89063b9d071 (patch)
tree614a8f38889c19d22bd4827debd0b8a8aed847b4 /mail/messagewall/files
parent205a3658d211ca7af4b75d4d3634d70c388ef208 (diff)
downloadFreeBSD-ports-132bb447f6582d2fc685f8cf3054d89063b9d071.zip
FreeBSD-ports-132bb447f6582d2fc685f8cf3054d89063b9d071.tar.gz
- Add WITH_ESMTP_SIZE_OPTION knob
PR: ports/61490 Submitted by: Michael Ranner <mranner@inode.at> Approved by: maintainer
Diffstat (limited to 'mail/messagewall/files')
-rw-r--r--mail/messagewall/files/esmtpsize.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/mail/messagewall/files/esmtpsize.patch b/mail/messagewall/files/esmtpsize.patch
new file mode 100644
index 0000000..724bcc2
--- /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);
++ }
++ }
+ }
+
+ /*
OpenPOWER on IntegriCloud