Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2004 20:25:57 +0100 (CET)
From:      Michael Ranner <mranner@inode.at>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61490: mail/messagewall patch with esmtp size option improvement
Message-ID:  <200401171925.i0HJPvpY009588@dwarf.jawa.at>
Resent-Message-ID: <200401171930.i0HJU8QM019435@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401171925.i0HJPvpY009588>