From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jan 17 11:31:01 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2524316A4CE for ; Sat, 17 Jan 2004 11:31:01 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C38E43D41 for ; Sat, 17 Jan 2004 11:30:09 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0HJU8FR019436 for ; Sat, 17 Jan 2004 11:30:08 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0HJU8QM019435; Sat, 17 Jan 2004 11:30:08 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 17 Jan 2004 11:30:08 -0800 (PST) Resent-Message-Id: <200401171930.i0HJU8QM019435@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Ranner Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D84C016A4CF for ; Sat, 17 Jan 2004 11:26:47 -0800 (PST) Received: from dwarf.jawa.at (line187.adsl-dynamic.inode.at [213.229.7.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1A0B43D41 for ; Sat, 17 Jan 2004 11:26:43 -0800 (PST) (envelope-from mranner@dwarf.jawa.at) Received: from dwarf.jawa.at (localhost.jawa.at [127.0.0.1]) by dwarf.jawa.at (8.12.9p2/8.12.9) with ESMTP id i0HJPvSe009589 for ; Sat, 17 Jan 2004 20:25:57 +0100 (CET) (envelope-from mranner@dwarf.jawa.at) Received: (from root@localhost) by dwarf.jawa.at (8.12.9p2/8.12.9/Submit) id i0HJPvpY009588; Sat, 17 Jan 2004 20:25:57 +0100 (CET) (envelope-from mranner) Message-Id: <200401171925.i0HJPvpY009588@dwarf.jawa.at> Date: Sat, 17 Jan 2004 20:25:57 +0100 (CET) From: Michael Ranner To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/61490: mail/messagewall patch with esmtp size option improvement X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Michael Ranner List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2004 19:31:01 -0000 >Number: 61490 >Category: ports >Synopsis: mail/messagewall patch with esmtp size option improvement >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jan 17 11:30:08 PST 2004 >Closed-Date: >Last-Modified: >Originator: Michael Ranner >Release: FreeBSD 4.9-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD dwarf.jawa.at 4.9-RELEASE-p1 FreeBSD 4.9-RELEASE-p1 #4: Sat Nov 29 11:09:14 CET 2003 root@dwarf.jawa.at:/usr/src/sys/compile/DWARF i386 >Description: Messagewall lacks some necessary features, one of them is hanling of ESMTP SIZE option in MAIL FROM. This patch adds this functionality to the FreeBSD messagewall port. I have contacted maintainer and developer but got no response until now. >How-To-Repeat: cd /usr/ports/mail/messagewall && patch Fix: *** Makefile.orig Sat Jan 17 00:36:50 2004 --- Makefile Sat Jan 17 00:32:15 2004 *************** *** 7,13 **** PORTNAME= messagewall PORTVERSION= 1.0.8 ! PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.messagewall.org/download/ DISTNAME= messagewall-${PORTVERSION} --- 7,13 ---- PORTNAME= messagewall PORTVERSION= 1.0.8 ! PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= http://www.messagewall.org/download/ DISTNAME= messagewall-${PORTVERSION} *************** *** 34,44 **** --- 34,55 ---- @${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: 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" # for details see http://www.messagewall.org/cgi-bin/ezmlm-browse.cgi?command=showmsg&list=messagewall-discuss&month=200303&msgnum=921&threadid=lcjcimckfmdphlhpjjhn .if defined(MESSAGEWALL_ALLOW_MULT_RCPT) EXTRA_PATCHES+= ${PATCHDIR}/allow-multiple-recipients.patch + .endif + + # Patch from "Michael Ranner" + # for details see http://www.ranner.jawa.at/messagewall.php + .if defined(WITH_ESMTP_SIZE_OPTION) + EXTRA_PATCHES+= ${PATCHDIR}/esmtpsize.patch .endif post-patch: *** files/esmtpsize.patch.orig Sat Jan 17 00:37:21 2004 --- files/esmtpsize.patch Sat Jan 17 00:32:04 2004 *************** *** 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 + + * With this patch, messagewall handles the ESMTP SIZE option (RFC1870) + + * "MAIL FROM: 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); + + } + + } + } + + /* >Release-Note: >Audit-Trail: >Unformatted: