From mranner@dwarf.jawa.at  Sat Jan 17 11:26:47 2004
Return-Path: <mranner@dwarf.jawa.at>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D84C016A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <mranner@inode.at>
Reply-To: Michael Ranner <mranner@inode.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mail/messagewall patch with esmtp size option improvement
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 17 11:30:08 PST 2004
>Closed-Date:    Sat Feb 28 09:52:15 PST 2004
>Last-Modified:  Sat Feb 28 09:52:15 PST 2004
>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 <patch-messagewall
>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: <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
  .if defined(MESSAGEWALL_ALLOW_MULT_RCPT)
  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:
*** 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 <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);
+ +				}
+ +			}
+  		}
+  
+  		/*

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback  
State-Changed-By: krion 
State-Changed-When: Sun Jan 18 01:43:46 PST 2004 
State-Changed-Why:  
Asked maintainer about this update. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61490 

From: Kirill Ponomarew <krion@FreeBSD.org>
To: opr@bsdaemon.be
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/61490: mail/messagewall patch with esmtp size option improvement
Date: Sun, 18 Jan 2004 10:43:32 +0100

 --NMuMz9nt05w80d4+
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Hi,
 
 On Sat, Jan 17, 2004 at 08:25:57PM +0100, Michael Ranner wrote:
 >=20
 > >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
 
 Do you approve or reject this update ?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/61490
 
 -Kirill
 
 --NMuMz9nt05w80d4+
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQFAClVEQC1G6a60JuURAvQkAJ0XyDGCfYTYU2FLhj5aHL1BakR+LgCeLaaS
 zOqhZSHU7luLoahs231OjVQ=
 =UV/d
 -----END PGP SIGNATURE-----
 
 --NMuMz9nt05w80d4+--

From: "Pieter Danhieux" <opr@bsdaemon.be>
To: "Kirill Ponomarew" <krion@FreeBSD.org>
Cc: <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: ports/61490: mail/messagewall patch with esmtp size option improvement
Date: Sun, 18 Jan 2004 10:45:03 +0100

 patch approved
 
 ----- Original Message ----- 
 From: "Kirill Ponomarew" <krion@FreeBSD.org>
 To: <opr@bsdaemon.be>
 Cc: <FreeBSD-gnats-submit@FreeBSD.org>
 Sent: Sunday, January 18, 2004 10:43 AM
 Subject: Re: ports/61490: mail/messagewall patch with esmtp size option
 improvement
 
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Sat Feb 28 09:52:05 PST 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61490 
>Unformatted:
