subonlypost, mlmmj-process and Envelope-from.
Hi everyone,
I'm using mlmmj for a couple of low traffic lists. Two days ago I was greatly surprised to discover that mlmmj doesn't allow for people to post through GMane.
A quick scan through the archives revealed that I could use the "access" feature to work around this, but I didn't understand why it was needed at all. GMane does the "correct thing" by setting the envelope sender to a subscribed address and faking the From: header.
I didn't want to switch to a bigger list manager so I read through the sources. In mlmmj-process there seems to be absolutely no distinction of Envelope-from and From. From: is used anywhere, by restricting it to the first valid From: address. Looks broken to me, especially when checking for loops (comparing list-address against From).
I patched mlmmj so that Envelope-from: is used for processing/subonlypost and access control. From: is used only when generating the body of help messages.
This fixed gmane for me.
I also shuffled mlmmj-process.c so that address validation checks are performed before using the addresses themselves. listprocess.c could also use some extra-cleanup (efrom is validated in 10 different places, but could probably be done just once in mlmmj-process.c when efrom is extracted).
I'm attaching the patch against 1.2.17.
Can anyone comment on this? Am I doing something wrong? Any chance this gets integrated?
Thanks again.
TUNABLES +2 -1
@@ -42,7 +42,8 @@ � subonlypost (boolean) When this file is present, only people who are subscribed to the list, - are allowed to post to it. The check is made against the "From:" header. + are allowed to post to it. The check is made against the "Envelope-from:" + header. � modnonsubposts (boolean)
include/listcontrol.h +5 -4
@@ -26,9 +26,10 @@#include "find_email_adr.h" -int listcontrol (struct email_container *fromemails,const char *listdir, -const char *controlstr,const char *mlmmjsub, -const char *mlmmjunsub,const char *mlmmjsend, -const char *mlmmjbounce,const char *mailname); +int listcontrol (const char *efrom,struct email_container *fromemails, +const char *listdir,const char *controlstr, +const char *mlmmjsub,const char *mlmmjunsub, +const char *mlmmjsend,const char *mlmmjbounce, +const char *mailname);#endif /* LISTCONTROL_H */
include/send_help.h +1 -1
@@ -24,7 +24,7 @@#ifndef SEND_HELP_H #define SEND_HELP_H -void send_help (const char *listdir,const char *emailaddr, +void send_help (const char *listdir,const char * efrom,const char *emailaddr,const char *mlmmjsend,const char *name,const char *textfile);#endif
src/listcontrol.c +57 -63
281 lines not on this page · raw message
src/mlmmj-process.c +56 -61
219 lines not on this page · raw message
src/send_help.c +2 -2
@@ -42,7 +42,7 @@#include "prepstdreply.h" #include "memory.h" -void send_help (const char *listdir,const char *emailaddr, +void send_help (const char *listdir,const char * efrom,const char *emailaddr,const char *mlmmjsend,const char *name,const char *textfile) {char *queuefilename, *listaddr, *listdelim, *listname, *listfqdn;
@@ -70,7 +70,7 @@execlp (mlmmjsend, mlmmjsend,"-l" ,"1" ,"-L" , listdir, -"-T" , emailaddr, +"-T" , efrom,"-F" , fromaddr,"-m" , queuefilename, (char *)NULL );
Quoted 11 lines · Yuri D'Elia
I patched mlmmj so that Envelope-from: is used for processing/subonlypost and access control. From: is used only when generating the body of help messages.
This fixed gmane for me.
I also shuffled
mlmmj-process.cso that address validation checks are performed before using the addresses themselves.listprocess.ccould also use some extra-cleanup (efrom is validated in 10 different places, but could probably be done just once inmlmmj-process.cwhen efrom is extracted).
Was anyone able to look at this? I've been using this patch on production since then without [noticing] problems.
Thanks.