diff -Nru mlmmj-1.2.12-RC1_orig/ChangeLog mlmmj-1.2.12-RC1_maxmailsize/ChangeLog
--- mlmmj-1.2.12-RC1_orig/ChangeLog	Mon Sep  4 18:06:32 2006
+++ mlmmj-1.2.12-RC1_maxmailsize/ChangeLog	Thu Sep  7 15:50:15 2006
@@ -11,6 +11,7 @@
    forking. This is neccesary on FreeBSD.
  o No need to check for subscribers in 0-sized files
  o Make sure chomp works with empty strings (Frank Denis)
+ o Introduced a rule for limiting by mail size  (Christoph Wilke)
 1.2.11
  o Previous fix to find_email_adr() was incomplete, so in some
    cases mails would get rejected due to the To: or Cc: rule. Thanks
diff -Nru mlmmj-1.2.12-RC1_orig/TUNABLES mlmmj-1.2.12-RC1_maxmailsize/TUNABLES
--- mlmmj-1.2.12-RC1_orig/TUNABLES	Mon Sep  4 17:56:48 2006
+++ mlmmj-1.2.12-RC1_maxmailsize/TUNABLES	Thu Sep  7 15:13:49 2006
@@ -166,3 +166,12 @@
 
    If this file exists, digest mails won't have a text part with a thread
    summary.
+
+ · maxmailsize			(normal)
+
+   With this option the maximal allowed size of incoming mails can be specified.
+
+ · nomaxmailsizedenymails	(boolean)
+
+   If this is set, no reject notifications caused by violation of maxmailsize
+   will be sent.
diff -Nru mlmmj-1.2.12-RC1_orig/listtexts/de/maxmailsize mlmmj-1.2.12-RC1_maxmailsize/listtexts/de/maxmailsize
--- mlmmj-1.2.12-RC1_orig/listtexts/de/maxmailsize	Thu Jan  1 01:00:00 1970
+++ mlmmj-1.2.12-RC1_maxmailsize/listtexts/de/maxmailsize	Thu Sep  7 15:03:31 2006
@@ -0,0 +1,10 @@
+Subject: Beitrag zur Liste $listaddr$ wegen Größenüberschreitung abgelehnt
+
+Hallo, dies ist das mlmmj Programm das die Mailingliste
+
+$listaddr$
+
+verwaltet.
+
+Tut mir leid aber Ihre Mail konnte nicht versandt werden. Die von
+Ihnen verschickte Mail überschreitet das bestehende Größenlimit.
diff -Nru mlmmj-1.2.12-RC1_orig/listtexts/maxmailsize mlmmj-1.2.12-RC1_maxmailsize/listtexts/maxmailsize
--- mlmmj-1.2.12-RC1_orig/listtexts/maxmailsize	Thu Jan  1 01:00:00 1970
+++ mlmmj-1.2.12-RC1_maxmailsize/listtexts/maxmailsize	Thu Sep  7 15:05:07 2006
@@ -0,0 +1,11 @@
+Subject: Post to $listaddr$ denied due to size limit [was: "$oldsubject$"]
+
+Hi, this is the mlmmj program managing the mailinglist
+
+$listaddr$
+
+I'm sorry to inform you that your message could not be delivered to the
+list. Your mail was rejected due to the size limit of $maxmailsize$.
+
+Thanks.
+
diff -Nru mlmmj-1.2.12-RC1_orig/src/mlmmj-process.c mlmmj-1.2.12-RC1_maxmailsize/src/mlmmj-process.c
--- mlmmj-1.2.12-RC1_orig/src/mlmmj-process.c	Mon Sep  4 00:04:11 2006
+++ mlmmj-1.2.12-RC1_maxmailsize/src/mlmmj-process.c	Thu Sep  7 16:52:56 2006
@@ -348,7 +348,9 @@
 	int i, j, opt, noprocess = 0, moderated = 0;
 	int hdrfd, footfd, rawmailfd, donemailfd;
 	int subonlypost = 0, addrtocc = 1, intocc = 0;
+	int maxmailsize = 0;
 	int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0;
+	int nomaxmailsizedenymails = 0;
 	char *listdir = NULL, *mailfile = NULL, *headerfilename = NULL;
 	char *footerfilename = NULL, *donemailname = NULL;
 	char *randomstr = NULL, *mqueuename;
@@ -356,6 +358,7 @@
 	char *bindir, *subjectprefix, *discardname, *listaddr, *listdelim;
 	char *listfqdn, *listname, *fromaddr;
 	char *queuefilename, *recipextra = NULL, *owner = NULL;
+	char *maxmailsizestr;
 	char *maildata[2] = { "posteraddr", NULL };
 	char *envstr, *efrom;
 	struct stat st;
@@ -631,6 +634,74 @@
 		return EXIT_SUCCESS;
 	}
 
+	/* this declaration is needed here... */
+	listaddr = getlistaddr(listdir);
+	alternates = ctrlvalues(listdir, "listaddress");
+	
+	/* checking incoming mail's size */
+#if 0
+	log_error(LOG_ARGS, "%d", statctrl(listdir, "maxmailsize"));
+#endif
+	maxmailsize = statctrl(listdir, "maxmailsize");
+	if(maxmailsize) {
+		maxmailsizestr = ctrlvalue(listdir, "maxmailsize");
+		if(maxmailsizestr) {
+			maxmailsize = atol(maxmailsizestr);
+			myfree(maxmailsizestr);
+#if 0
+			log_error(LOG_ARGS, "max = %d", maxmailsize);
+#endif
+			if(stat(donemailname, &st) < 0) {
+				log_error(LOG_ARGS, "something went wrong"
+					" during stat(%s,..)", donemailname);
+			}
+			nomaxmailsizedenymails = statctrl(listdir, "nomaxmailsizedenymails");
+			if((st.st_size > maxmailsize) && nomaxmailsizedenymails) {
+#if 0
+				log_error(LOG_ARGS, "%d", nomaxmailsizedenymails);
+#endif
+				log_error(LOG_ARGS, "discarding mail %s due to"
+						" size limit (%d bytes too big) \n",
+						donemailname, (st.st_size - maxmailsize));
+				unlink(donemailname);
+				myfree(donemailname);
+				exit(EXIT_SUCCESS);
+			}
+			if((st.st_size > maxmailsize)) {
+#if 0
+				log_error(LOG_ARGS, "%s is %d bytes too big.\n",
+						donemailname,
+						(st.st_size - maxmailsize));
+#endif
+				listdelim = getlistdelim(listdir);
+				listname = genlistname(listaddr);
+				listfqdn = genlistfqdn(listaddr);
+				fromaddr = concatstr(4, listname, listdelim,
+						"bounces-help@", listfqdn);
+				queuefilename = prepstdreply(listdir,
+						"maxmailsize", "$listowner$",
+						fromemails.emaillist[0],
+						NULL, 0, NULL, NULL);
+				MY_ASSERT(queuefilename)
+				myfree(listdelim);
+				myfree(listname);
+				myfree(listfqdn);
+				unlink(donemailname);
+				myfree(donemailname);
+				execlp(mlmmjsend, mlmmjsend,
+						"-l", "1",
+						"-L", listdir,
+						"-T", fromemails.emaillist[0],
+						"-F", fromaddr,
+						"-m", queuefilename, (char *)NULL);
+	
+				log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjsend);
+				exit(EXIT_FAILURE);
+	
+			}
+		}
+	}
+
 	/* discard malformed mail with invalid From: */
 	if(fromemails.emailcount != 1) { 
 		for(i = 0; i < fromemails.emailcount; i++)
@@ -673,8 +744,9 @@
 
 	unlink(mailfile);
 
+	/* maxmailsize need this earlier...
 	listaddr = getlistaddr(listdir);
-	alternates = ctrlvalues(listdir, "listaddress");
+	alternates = ctrlvalues(listdir, "listaddress"); */
 
 	addrtocc = !(statctrl(listdir, "tocc"));
 	if(addrtocc) {

