* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
@ 2007-01-10 10:31 ` Christoph Wilke
2007-01-22 19:27 ` Sven 'Darkman' Michels
` (18 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-01-10 10:31 UTC (permalink / raw)
To: mlmmj
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
Hej!
On Tue, January 9, 2007 23:40, Morten K. Poulsen wrote:
>
> Hi Dan,
>
> Daniel Walrond <daniel@walrond.co.uk> wrote:
>>> The patch looks very clean and simple. I just didn't know it
>>> existed.
>>> I will merge it for mlmmj-1.2.13.
>>
>> Did you add the following patch to mlmmj 1.2.13?
>> http://mlmmj.mmj.dk/archive/0794.html
>
> S##t, I forgot about that. Sorry. It will be in 1.2.14.
I updated the patch to match version 1.2.13-RC1.
There is one issue I didn't fixed yet (no time):
If a mail hits the limit, it bounces - no problem here.
But the temporary mailfile created in the incoming
directory isn't deleted.
Maybe someone can have a look on this? :)
>
> Morten
Ciao
Chris
[-- Attachment #2: mlmmj-1.2.13-RC1-maxmailsize.diff --]
[-- Type: application/octet-stream, Size: 5531 bytes --]
diff -Nru mlmmj-1.2.13-RC1-orig/listtexts/de/maxmailsize mlmmj-1.2.13-RC1/listtexts/de/maxmailsize
--- mlmmj-1.2.13-RC1-orig/listtexts/de/maxmailsize 1970-01-01 01:00:00.000000000 +0100
+++ mlmmj-1.2.13-RC1/listtexts/de/maxmailsize 2006-12-11 14:54:49.000000000 +0100
@@ -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.13-RC1-orig/listtexts/maxmailsize mlmmj-1.2.13-RC1/listtexts/maxmailsize
--- mlmmj-1.2.13-RC1-orig/listtexts/maxmailsize 1970-01-01 01:00:00.000000000 +0100
+++ mlmmj-1.2.13-RC1/listtexts/maxmailsize 2006-12-11 14:54:49.000000000 +0100
@@ -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.13-RC1-orig/src/mlmmj-process.c mlmmj-1.2.13-RC1/src/mlmmj-process.c
--- mlmmj-1.2.13-RC1-orig/src/mlmmj-process.c 2006-12-06 14:19:09.000000000 +0100
+++ mlmmj-1.2.13-RC1/src/mlmmj-process.c 2006-12-11 14:58:09.000000000 +0100
@@ -348,7 +348,9 @@
int i, j, opt, noprocess = 0, moderated = 0;
int hdrfd, footfd, rawmailfd, donemailfd;
int subonlypost = 0, addrtocc = 1, intocc = 0, modnonsubposts = 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) {
diff -Nru mlmmj-1.2.13-RC1-orig/TUNABLES mlmmj-1.2.13-RC1/TUNABLES
--- mlmmj-1.2.13-RC1-orig/TUNABLES 2006-12-10 16:00:09.000000000 +0100
+++ mlmmj-1.2.13-RC1/TUNABLES 2006-12-11 14:56:18.000000000 +0100
@@ -183,3 +183,13 @@
If this file exists, subscription to the nomail version of the mailinglist
will be denied. (Useful if you don't want to allow nomail and notify users
about it).
+
+
+ · 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.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
2007-01-10 10:31 ` Christoph Wilke
@ 2007-01-22 19:27 ` Sven 'Darkman' Michels
2007-01-22 20:17 ` Sven 'Darkman' Michels
` (17 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-01-22 19:27 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
today we had a bigger mail to a list which results in many
bounces since most of the subscribers have a lower limit. So
i want to limit per list. I remembered the patch about this and
then saw that its not yet included... ;-)
Christoph Wilke wrote:
> There is one issue I didn't fixed yet (no time):
> If a mail hits the limit, it bounces - no problem here.
> But the temporary mailfile created in the incoming
> directory isn't deleted.
> Maybe someone can have a look on this? :)
Well, i'm not a coder, but isn't this just a missing
unlink(mailfile); after the unlink(donemailname);?
Would be nice if someone can confirm this, i'd like to test
it soon ;-)
Regards,
Darkman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFFtRAOQoCguWUBzBwRAsyPAKCizZUxdogEnNKIbkbDagRQyNCAnQCeO6WJ
zikqeSnkvbQCVD5gpAiTs1o=Mz6q
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
2007-01-10 10:31 ` Christoph Wilke
2007-01-22 19:27 ` Sven 'Darkman' Michels
@ 2007-01-22 20:17 ` Sven 'Darkman' Michels
2007-01-23 11:06 ` Christoph Wilke
` (16 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-01-22 20:17 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi myself,
Sven 'Darkman' Michels wrote:
> Would be nice if someone can confirm this, i'd like to test
> it soon ;-)
well, i just added two unlinks and it seems to work "so far", but:
the bounce mail generated by mlmmj isn't parsed properly. The reason
is, that your patch uses "new" macros which are not implemented anyway.
New is: $oldsubject$, $maxmailsize$
Anyone knows where to add it? ;) Didn't found something helpfull (maybe
this is again over my skills ;)
Regards,
Darkman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFFtRvZQoCguWUBzBwRAifgAKCWD6KgZRyXfdBKilQu+j/H8X6VDwCdGamG
cFssNyHv4O1UuF92rejXxcY=3PlQ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (2 preceding siblings ...)
2007-01-22 20:17 ` Sven 'Darkman' Michels
@ 2007-01-23 11:06 ` Christoph Wilke
2007-01-24 14:29 ` Christoph Wilke
` (15 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-01-23 11:06 UTC (permalink / raw)
To: mlmmj
Hej,
On Mon, January 22, 2007 21:17, Sven 'Darkman' Michels wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi myself,
>
> Sven 'Darkman' Michels wrote:
>> Would be nice if someone can confirm this, i'd like to test
>> it soon ;-)
>
> well, i just added two unlinks and it seems to work "so far", but:
> the bounce mail generated by mlmmj isn't parsed properly. The reason
Nice. ;)
> is, that your patch uses "new" macros which are not implemented
> anyway.
> New is: $oldsubject$, $maxmailsize$
Hmm. I Introduced them, but only $maxmailsize$ is used.
Just kick the other one out, I just forgot to remove it, sorry.
> Anyone knows where to add it? ;) Didn't found something helpfull
> (maybe
> this is again over my skills ;)
Hopefully I can fix this this afternoon, and send a new
patch tomorrow.
>
> Regards,
> Darkman
Ciao
Chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
>
> iD8DBQFFtRvZQoCguWUBzBwRAifgAKCWD6KgZRyXfdBKilQu+j/H8X6VDwCdGamG
> cFssNyHv4O1UuF92rejXxcY=
> =3PlQ
> -----END PGP SIGNATURE-----
>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (3 preceding siblings ...)
2007-01-23 11:06 ` Christoph Wilke
@ 2007-01-24 14:29 ` Christoph Wilke
2007-02-01 22:20 ` Morten K. Poulsen
` (14 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-01-24 14:29 UTC (permalink / raw)
To: mlmmj
Hej,
On Tue, January 23, 2007 12:06, Christoph Wilke wrote:
[...]
>
> Hopefully I can fix this this afternoon, and send a new
> patch tomorrow.
Sorry, I helped my girlfriend to TeX some work..
This needs more time than I expected, but I will
work on this patch next week(end).
Ciao
Chris
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (4 preceding siblings ...)
2007-01-24 14:29 ` Christoph Wilke
@ 2007-02-01 22:20 ` Morten K. Poulsen
2007-02-13 18:19 ` Christoph Wilke
` (13 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Morten K. Poulsen @ 2007-02-01 22:20 UTC (permalink / raw)
To: mlmmj
"Christoph Wilke" <chris@filmkreis.tu-darmstadt.de> wrote:
> On Tue, January 23, 2007 12:06, Christoph Wilke wrote:
>> Hopefully I can fix this this afternoon, and send a new
>> patch tomorrow.
>
> Sorry, I helped my girlfriend to TeX some work..
Priorities! ;)
No hurry. I don't plan on a 1.2.14 any time soon.
Morten
--
Morten K. Poulsen <morten@afdelingp.dk>
http://www.afdelingp.dk/
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (5 preceding siblings ...)
2007-02-01 22:20 ` Morten K. Poulsen
@ 2007-02-13 18:19 ` Christoph Wilke
2007-02-14 12:42 ` Sven 'Darkman' Michels
` (12 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-02-13 18:19 UTC (permalink / raw)
To: mlmmj
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
Hej!
On Mon, January 22, 2007 21:17, Sven 'Darkman' Michels wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi myself,
>
> Sven 'Darkman' Michels wrote:
>> Would be nice if someone can confirm this, i'd like to test
>> it soon ;-)
>
> well, i just added two unlinks and it seems to work "so far", but:
> the bounce mail generated by mlmmj isn't parsed properly. The reason
> is, that your patch uses "new" macros which are not implemented
> anyway.
> New is: $oldsubject$, $maxmailsize$
I fixed now (at last) the missing macro ($maxmailsize$).
Patch attached.
Ciao
Chris
ps. Sorry for the long delay, but all the time I thought I
had some spare time, I had to do some other work first...
[-- Attachment #2: mlmmj-1.2.13-maxmailsize_rev2.diff --]
[-- Type: text/plain, Size: 5805 bytes --]
diff -Nru mlmmj-1.2.13.orig/listtexts/de/maxmailsize mlmmj-1.2.13-maxmailsize/listtexts/de/maxmailsize
--- mlmmj-1.2.13.orig/listtexts/de/maxmailsize 1970-01-01 01:00:00.000000000 +0100
+++ mlmmj-1.2.13-maxmailsize/listtexts/de/maxmailsize 2007-02-13 18:55:00.000000000 +0100
@@ -0,0 +1,11 @@
+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
+von $maxmailsize$.
diff -Nru mlmmj-1.2.13.orig/listtexts/maxmailsize mlmmj-1.2.13-maxmailsize/listtexts/maxmailsize
--- mlmmj-1.2.13.orig/listtexts/maxmailsize 1970-01-01 01:00:00.000000000 +0100
+++ mlmmj-1.2.13-maxmailsize/listtexts/maxmailsize 2007-02-13 18:54:16.000000000 +0100
@@ -0,0 +1,11 @@
+Subject: Post to $listaddr$ denied due to size limit
+
+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.13.orig/src/mlmmj-process.c mlmmj-1.2.13-maxmailsize/src/mlmmj-process.c
--- mlmmj-1.2.13.orig/src/mlmmj-process.c 2007-02-09 00:05:10.000000000 +0100
+++ mlmmj-1.2.13-maxmailsize/src/mlmmj-process.c 2007-02-13 18:53:47.000000000 +0100
@@ -348,7 +348,9 @@
int i, j, opt, noprocess = 0, moderated = 0;
int hdrfd, footfd, rawmailfd, donemailfd;
int subonlypost = 0, addrtocc = 1, intocc = 0, modnonsubposts = 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,7 +358,8 @@
char *bindir, *subjectprefix, *discardname, *listaddr, *listdelim;
char *listfqdn, *listname, *fromaddr;
char *queuefilename, *recipextra = NULL, *owner = NULL;
- char *maildata[2] = { "posteraddr", NULL };
+ char *maxmailsizestr;
+ char *maildata[4] = { "posteraddr", NULL, "maildata", NULL };
char *envstr, *efrom;
struct stat st;
uid_t uid;
@@ -631,6 +634,80 @@
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);
+#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);
+ unlink(mailfile);
+ myfree(donemailname);
+ myfree(mailfile);
+ myfree(maxmailsizestr);
+ 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);
+ maildata[3] = maxmailsizestr;
+ queuefilename = prepstdreply(listdir,
+ "maxmailsize", "$listowner$",
+ fromemails.emaillist[0],
+ NULL, 2, maildata, NULL);
+ MY_ASSERT(queuefilename)
+ myfree(listdelim);
+ myfree(listname);
+ myfree(listfqdn);
+ unlink(donemailname);
+ unlink(mailfile);
+ myfree(donemailname);
+ myfree(mailfile);
+ myfree(maxmailsizestr);
+ 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 +750,9 @@
unlink(mailfile);
+ /* maxmailsize need this earlier...
listaddr = getlistaddr(listdir);
- alternates = ctrlvalues(listdir, "listaddress");
+ alternates = ctrlvalues(listdir, "listaddress"); */
addrtocc = !(statctrl(listdir, "tocc"));
if(addrtocc) {
diff -Nru mlmmj-1.2.13.orig/TUNABLES mlmmj-1.2.13-maxmailsize/TUNABLES
--- mlmmj-1.2.13.orig/TUNABLES 2007-02-09 00:05:10.000000000 +0100
+++ mlmmj-1.2.13-maxmailsize/TUNABLES 2007-02-13 18:49:31.000000000 +0100
@@ -183,3 +183,13 @@
If this file exists, subscription to the nomail version of the mailinglist
will be denied. (Useful if you don't want to allow nomail and notify users
about it).
+
+
+ · 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.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (6 preceding siblings ...)
2007-02-13 18:19 ` Christoph Wilke
@ 2007-02-14 12:42 ` Sven 'Darkman' Michels
2007-02-14 15:15 ` Sven 'Darkman' Michels
` (11 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-02-14 12:42 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Christoph Wilke wrote:
> Hej!
> I fixed now (at last) the missing macro ($maxmailsize$).
> Patch attached.
Whatever you did, the patch doesn't work anymore for me. Maybe
i have some time to check but atm not. The mail just got discarded,
no error mail, nothing in the logs (not in mail log nor in mlmmjs
log). But i see the bounce mail in queue dir - without parsed
macro - horray.
Any ideas?
Thanks!
Sven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFF0wPJQoCguWUBzBwRAusaAJ0djczDwsqlSxJmkBi9B2EMwfEEIwCfTwTw
PXedShxst2VHNpGgQTA3K7A=5/J5
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (7 preceding siblings ...)
2007-02-14 12:42 ` Sven 'Darkman' Michels
@ 2007-02-14 15:15 ` Sven 'Darkman' Michels
2007-02-14 22:23 ` Morten K. Poulsen
` (10 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-02-14 15:15 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi me, again ;-)
Sven 'Darkman' Michels wrote:
>
> Any ideas?
I got another timeslot to get this sorted. It seems now to work and
i fixed the parse of $maxmailsize$, too. So if anyone is interested,
here is a cleaned patch:
http://www.darkman.de/~sven/mlmmj-1.2.13-maxmailsize-darkman.patch
I still get nothing in the logs, but that may some other problem...
What i changed:
- - char *maildata[4] = { "posteraddr", NULL, "maildata", NULL };
+ char *maildata[4] = { "posteraddr", NULL, "maxmailsize", NULL };
and removed two free's:
myfree(donemailname);
myfree(mailfile);
after the unlink and moved the free of maxmailsizestr befor the unlink.
Please, someone with more mlmmj knowhow or even more c code knowhow,
take a look if thats okay.
Thanks and regards,
Sven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFF0yepQoCguWUBzBwRAh+sAKCYaMdB2ZLZDvhZXQZ/Z91iZOiPWwCgkiLz
wS9z2IxRd9jK6iha9/pAh5w\vJK
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (8 preceding siblings ...)
2007-02-14 15:15 ` Sven 'Darkman' Michels
@ 2007-02-14 22:23 ` Morten K. Poulsen
2007-02-14 23:09 ` Sven 'Darkman' Michels
` (9 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Morten K. Poulsen @ 2007-02-14 22:23 UTC (permalink / raw)
To: mlmmj
Sven 'Darkman' Michels <sven@darkman.de> wrote:
> I still get nothing in the logs, but that may some other problem...
[snip]
> Please, someone with more mlmmj knowhow or even more c code knowhow,
> take a look if thats okay.
+ if((st.st_size > maxmailsize)) {
+#if 0
+ log_error(LOG_ARGS, "%s is %d bytes too big.\n",
+ donemailname,
+ (st.st_size - maxmailsize));
+#endif
The missing log entry might be because of the "#if 0" ;-)
Otherwise, it looks ok. I will review it in depth and commit it "soon."
Morten
--
Morten K. Poulsen <morten@afdelingp.dk>
http://www.afdelingp.dk/
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (9 preceding siblings ...)
2007-02-14 22:23 ` Morten K. Poulsen
@ 2007-02-14 23:09 ` Sven 'Darkman' Michels
2007-02-15 22:20 ` Christoph Wilke
` (8 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-02-14 23:09 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hej,
Morten K. Poulsen wrote:
> + if((st.st_size > maxmailsize)) {
> +#if 0
> + log_error(LOG_ARGS, "%s is %d bytes too big.\n",
> + donemailname,
> + (st.st_size - maxmailsize));
> +#endif
>
> The missing log entry might be because of the "#if 0" ;-)
DAMN! ;-) I can't belive i overlooked this for hours... ;)
Thanks for the light...
> Otherwise, it looks ok. I will review it in depth and commit it "soon."
Thanks again :)
Regards,
Sven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFF05agQoCguWUBzBwRAnoQAJ4g+V5VpIQPL8zeDxfHcwUDbkOc2QCfWu8V
A12kjqCNsphwpu4eqYZVPXs¶3I
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (10 preceding siblings ...)
2007-02-14 23:09 ` Sven 'Darkman' Michels
@ 2007-02-15 22:20 ` Christoph Wilke
2007-02-16 2:45 ` Sven 'Darkman' Michels
` (7 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-02-15 22:20 UTC (permalink / raw)
To: mlmmj
On Wed, February 14, 2007 16:15, Sven 'Darkman' Michels wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi me, again ;-)
Hej.
>
> Sven 'Darkman' Michels wrote:
>>
>> Any ideas?
>
> I got another timeslot to get this sorted. It seems now to work and
> i fixed the parse of $maxmailsize$, too. So if anyone is interested,
> here is a cleaned patch:
> http://www.darkman.de/~sven/mlmmj-1.2.13-maxmailsize-darkman.patch
>
> I still get nothing in the logs, but that may some other problem...
>
> What i changed:
>
> - - char *maildata[4] = { "posteraddr", NULL, "maildata", NULL };
> + char *maildata[4] = { "posteraddr", NULL, "maxmailsize", NULL };
*doi*
Sorry for this inconvenience.
>
> and removed two free's:
> myfree(donemailname);
> myfree(mailfile);
> after the unlink and moved the free of maxmailsizestr befor the
> unlink.
Why do you free maxmailsizestr but mailfile and donemailname
not?
Did I miss something?
>
> Please, someone with more mlmmj knowhow or even more c code knowhow,
> take a look if thats okay.
>
> Thanks and regards,
> Sven
Ciao
Chris
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (11 preceding siblings ...)
2007-02-15 22:20 ` Christoph Wilke
@ 2007-02-16 2:45 ` Sven 'Darkman' Michels
2007-02-16 19:19 ` Christoph Wilke
` (6 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-02-16 2:45 UTC (permalink / raw)
To: mlmmj
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey,
Christoph Wilke wrote:
>> - - char *maildata[4] = { "posteraddr", NULL, "maildata", NULL };
>> + char *maildata[4] = { "posteraddr", NULL, "maxmailsize", NULL };
>
> *doi*
> Sorry for this inconvenience.
No Problem, for me as a no-coder it just takes a little longer
to understand such patches, but at least i got this fixed ;)
>> and removed two free's:
>> myfree(donemailname);
>> myfree(mailfile);
>> after the unlink and moved the free of maxmailsizestr befor the
>> unlink.
>
> Why do you free maxmailsizestr but mailfile and donemailname
> not?
> Did I miss something?
well, simple: if i free them, it doesn't work anymore. When i
leave them as you posted them, the reject mail isn't send to the
user anymore. I get a file in queue which *should* go to the user,
but they never get sent out. After removing the two frees, it
works. Thats why i asked for a review ;)
Regards,
Sven
PS: your mailaddress was bouncing, got this fixed? ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFF1RrZQoCguWUBzBwRAjGVAJ9NbP4s+s2bixPesBcNVYEAVj9NiACfdvfP
YskITftEQwlX+pg1XE3NEbE’cT
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (12 preceding siblings ...)
2007-02-16 2:45 ` Sven 'Darkman' Michels
@ 2007-02-16 19:19 ` Christoph Wilke
2007-02-16 19:26 ` Christoph Wilke
` (5 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-02-16 19:19 UTC (permalink / raw)
To: mlmmj
On Fri, February 16, 2007 03:45, Sven 'Darkman' Michels wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey,
>
> Christoph Wilke wrote:
>>> - - char *maildata[4] = { "posteraddr", NULL, "maildata", NULL };
>>> + char *maildata[4] = { "posteraddr", NULL, "maxmailsize", NULL };
>>
>> *doi*
>> Sorry for this inconvenience.
>
> No Problem, for me as a no-coder it just takes a little longer
> to understand such patches, but at least i got this fixed ;)
>
>
>>> and removed two free's:
>>> myfree(donemailname);
>>> myfree(mailfile);
>>> after the unlink and moved the free of maxmailsizestr befor the
>>> unlink.
>>
>> Why do you free maxmailsizestr but mailfile and donemailname
>> not?
>> Did I miss something?
>
> well, simple: if i free them, it doesn't work anymore. When i
> leave them as you posted them, the reject mail isn't send to the
> user anymore. I get a file in queue which *should* go to the user,
> but they never get sent out. After removing the two frees, it
> works. Thats why i asked for a review ;)
Interesting.
In my understanding prepstdreply() creates a real file and
return its descriptor. Mlmmjsend() only operates on this
existing fd (queuefilename) and shouldn't care about
donemailname and mailfile.
So the variables could be freed (the associated files are
already removed (unlinked)).
-- Or not??
>
> Regards,
> Sven
>
> PS: your mailaddress was bouncing, got this fixed? ;)
Ciao
Chris
ps. I know. Forgot to save the config before restarting the
router... *doiagain*
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
>
> iD8DBQFF1RrZQoCguWUBzBwRAjGVAJ9NbP4s+s2bixPesBcNVYEAVj9NiACfdvfP
> YskITftEQwlX+pg1XE3NEbE=
> =92cT
> -----END PGP SIGNATURE-----
>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (13 preceding siblings ...)
2007-02-16 19:19 ` Christoph Wilke
@ 2007-02-16 19:26 ` Christoph Wilke
2007-02-18 11:53 ` Mads Martin Joergensen
` (4 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-02-16 19:26 UTC (permalink / raw)
To: mlmmj
On Wed, February 14, 2007 23:23, Morten K. Poulsen wrote:
>
> Sven 'Darkman' Michels <sven@darkman.de> wrote:
>> I still get nothing in the logs, but that may some other problem...
> [snip]
>> Please, someone with more mlmmj knowhow or even more c code knowhow,
>> take a look if thats okay.
>
> + if((st.st_size > maxmailsize)) {
> +#if 0
> + log_error(LOG_ARGS, "%s is %d bytes too big.\n",
> + donemailname,
> + (st.st_size - maxmailsize));
> +#endif
>
> The missing log entry might be because of the "#if 0" ;-)
>
> Otherwise, it looks ok. I will review it in depth and commit it
> "soon."
Maybe it's better to change this log_error() to an log_oper()
as Henne suggested for the access rules?
>
> Morten
Ciao
Chris
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (14 preceding siblings ...)
2007-02-16 19:26 ` Christoph Wilke
@ 2007-02-18 11:53 ` Mads Martin Joergensen
2007-02-18 12:20 ` Sven 'Darkman' Michels
` (3 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Mads Martin Joergensen @ 2007-02-18 11:53 UTC (permalink / raw)
To: mlmmj
* Christoph Wilke <chris@filmkreis.tu-darmstadt.de> [Feb 16. 2007 20:21]:
> In my understanding prepstdreply() creates a real file and
> return its descriptor. Mlmmjsend() only operates on this
> existing fd (queuefilename) and shouldn't care about
> donemailname and mailfile.
It doesn't return a fd, but a char* with the filename for sending. Just
returning the fd, would leave the caller without knowing what the
filename is, and in many cases the user of prepstdreply() don't have to
open the file again--just pass the filename on to mlmmj-send.
--
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?"
-- A. P. J.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (15 preceding siblings ...)
2007-02-18 11:53 ` Mads Martin Joergensen
@ 2007-02-18 12:20 ` Sven 'Darkman' Michels
2007-02-18 21:38 ` Christoph Wilke
` (2 subsequent siblings)
19 siblings, 0 replies; 21+ messages in thread
From: Sven 'Darkman' Michels @ 2007-02-18 12:20 UTC (permalink / raw)
To: mlmmj
Mads Martin Joergensen wrote:
> * Christoph Wilke <chris@filmkreis.tu-darmstadt.de> [Feb 16. 2007 20:21]:
>> In my understanding prepstdreply() creates a real file and
>> return its descriptor. Mlmmjsend() only operates on this
>> existing fd (queuefilename) and shouldn't care about
>> donemailname and mailfile.
>
> It doesn't return a fd, but a char* with the filename for sending. Just
> returning the fd, would leave the caller without knowing what the
> filename is, and in many cases the user of prepstdreply() don't have to
> open the file again--just pass the filename on to mlmmj-send.
>
so i was "right" with removing the two free's?
Regards,
Sven
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (16 preceding siblings ...)
2007-02-18 12:20 ` Sven 'Darkman' Michels
@ 2007-02-18 21:38 ` Christoph Wilke
2007-02-20 23:01 ` Morten K. Poulsen
2007-03-03 17:43 ` Morten K. Poulsen
19 siblings, 0 replies; 21+ messages in thread
From: Christoph Wilke @ 2007-02-18 21:38 UTC (permalink / raw)
To: mlmmj
On Sun, February 18, 2007 13:20, Sven 'Darkman' Michels wrote:
> Mads Martin Joergensen wrote:
>> * Christoph Wilke <chris@filmkreis.tu-darmstadt.de> [Feb 16. 2007
>> 20:21]:
>>> In my understanding prepstdreply() creates a real file and
>>> return its descriptor. Mlmmjsend() only operates on this
>>> existing fd (queuefilename) and shouldn't care about
>>> donemailname and mailfile.
>>
>> It doesn't return a fd, but a char* with the filename for sending.
>> Just
>> returning the fd, would leave the caller without knowing what the
>> filename is, and in many cases the user of prepstdreply() don't have
>> to
>> open the file again--just pass the filename on to mlmmj-send.
>>
>
> so i was "right" with removing the two free's?
You were. But I don't have an idea why.
And if it is correct to have no myfree()s there.
Maybe someone can clarify this, please?
>
> Regards,
> Sven
Ciao
Chris
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (17 preceding siblings ...)
2007-02-18 21:38 ` Christoph Wilke
@ 2007-02-20 23:01 ` Morten K. Poulsen
2007-03-03 17:43 ` Morten K. Poulsen
19 siblings, 0 replies; 21+ messages in thread
From: Morten K. Poulsen @ 2007-02-20 23:01 UTC (permalink / raw)
To: mlmmj
Hi,
"Christoph Wilke" <chris@filmkreis.tu-darmstadt.de> wrote:
> On Sun, February 18, 2007 13:20, Sven 'Darkman' Michels wrote:
>> so i was "right" with removing the two free's?
>
> You were. But I don't have an idea why.
> And if it is correct to have no myfree()s there.
> Maybe someone can clarify this, please?
The myfree()s should be there. And having them there should not
cause any kind of problems. If it does, could you try to debug
it? We might have some other memory bug, which is triggered by
the myfree()s.
Morten
--
Morten K. Poulsen <morten@afdelingp.dk>
http://www.afdelingp.dk/
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: mlmmj maxmailsize patch
2007-01-09 22:40 mlmmj maxmailsize patch Morten K. Poulsen
` (18 preceding siblings ...)
2007-02-20 23:01 ` Morten K. Poulsen
@ 2007-03-03 17:43 ` Morten K. Poulsen
19 siblings, 0 replies; 21+ messages in thread
From: Morten K. Poulsen @ 2007-03-03 17:43 UTC (permalink / raw)
To: mlmmj
Hi all,
>>>> so i was "right" with removing the two free's?
>>>
>>> You were. But I don't have an idea why.
[snip]
>> The myfree()s should be there.
So... I found the problem: I was wrong, mailfile should not
be myfree()d - it's a pointer to an argument (which is on
the stack, not the heap).
I removed the statctrl() call as ctrlvalue() returns NULL for a non-
exsisting tunable, and rearranged a few of the code lines.
The patch I committed is available here:
http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.13-maxmailsize.diff
Christoph has written an English and a German version of the new
maxmailsize list text. Everybody who maintains a translation,
please translate this new file:
http://mlmmj.mmj.dk/~mortenp/maxmailsize
Have fun,
Morten
--
Morten K. Poulsen <morten@afdelingp.dk>
http://www.afdelingp.dk/
^ permalink raw reply [flat|nested] 21+ messages in thread