mlmmj-1.2.3 released. Features added and bugs squashed.
Hey all,
First, I want to express a big thank you to Andrea Barisani who once again found a pretty hard to find bug, and also helped with a lot of testing wrt. DSN support addition.
The ChangeLog has the glory details, I can recommend an upgrade:
1.2.3
o Only allow subscription of addresses with '@' in them
o Fix return value from unsubscribe function
o Add extra lock layer when accessing subscribers files
o In case of listname+bounces-INDEX use the DSN (RFC1891) report to extract the bouncing address
o Fix usage of a zero sized control/verp string
o Make the Date: header RFC2822 conformant
http://mlmmj.mmj.dk/files/mlmmj-1.2.3.tar.gz
http://mlmmj.mmj.dk/files/mlmmj-1.2.3.tar.bz2
Signature · 4 lines
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.Quoted 4 lines · Mads Martin Joergensen
Hey all,
The ChangeLog has the glory details, I can recommend an upgrade:
So no support for multiple list addresses ):
--W
Signature · 1 line
<:3 )---- Wolf Bergenheim ----( 8:>
Quoted 3 lines · Wolf Bergenheim
Quoted 1 line
The ChangeLog has the glory details, I can recommend an upgrade:
So no support for multiple list addresses ):
It's coming, but I wanted to get this bugfix out first. Next version :)
Signature · 4 lines
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.On 08-Feb-2005, Mads Martin Joergensen wrote:
Hi,
Quoted 2 lines
The ChangeLog has the glory details, I can recommend an upgrade:
1.2.3
I would like to request a feature. It's been on my wishlist for quite some time; I would like the port of the outgoing relay server to be configurable (just changing init_socket.c works i know).
mvh
Signature · 3 lines
Allan Joergensen "Do androids sleep with electric sheep?"
Quoted 6 lines · Mads Martin Joergensen
Quoted 3 lines · Wolf Bergenheim
Quoted 1 line
The ChangeLog has the glory details, I can recommend an upgrade:
So no support for multiple list addresses ):
It's coming, but I wanted to get this bugfix out first. Next version :)
Great!
I'm just impatient, because I've been asked to support 2 new parallel domains, and would like the mailinglists to work with the new domains too.
--W
Signature · 1 line
<:3 )---- Wolf Bergenheim ----( 8:>
Quoted 8 lines · Wolf Bergenheim
Quoted 3 lines
Quoted 1 line
So no support for multiple list addresses ):
It's coming, but I wanted to get this bugfix out first. Next version :)
Great!
I'm just impatient, because I've been asked to support 2 new parallel domains, and would like the mailinglists to work with the new domains too.
This is completely untested, I only made sure it compiles. So try it out and let me know if it works, then I'll commit it to CVS.
mlmmj-process.c +23 -7
@@ -50,6 +50,7 @@#include "subscriberfuncs.h" #include "memory.h" #include "log_oper.h" +#include "chomp.h" enum action {ALLOW ,
@@ -309,7 +310,7 @@int main (int argc,char **argv) { -int i, opt, noprocess =0 , moderated =0 ; +int i, j, opt, noprocess =0 , moderated =0 ;int hdrfd, footfd, rawmailfd, donemailfd;int subonlypost =0 , addrtocc =1 , intocc =0 ;int notoccdenymails =0 , noaccessdenymails =0 , nosubonlydenymails =0 ;
@@ -332,6 +333,7 @@struct strlist *access_rules =NULL ;struct strlist *delheaders =NULL ;struct strlist allheaders; +struct strlist *alternates =NULL ;struct mailhdr readhdrs[] = { {"From:" ,0 ,NULL }, {"To:" ,0 ,NULL },
@@ -601,17 +603,31 @@unlink (mailfile); listaddr =getlistaddr (listdir); + alternates =ctrlvalues (listdir,"listaddress" ); addrtocc = !(statctrl (listdir,"tocc" ));if (addrtocc) { -for (i =0 ; i < toemails.emailcount; i++) -if (strcmp (listaddr, toemails.emaillist[i]) =0 ) - intocc =1 ; -for (i =0 ; i < ccemails.emailcount; i++) -if (strcmp (listaddr, ccemails.emaillist[i]) =0 ) - intocc =1 ; +for (i =0 ; i < toemails.emailcount; i++) { +for (j =0 ; j < alternates->count; j++) { +chomp (alternates->strs[j]); +if (strcmp (alternates->strs[j], + toemails.emaillist[i]) =0 ) + intocc =1 ; + } + } +for (i =0 ; i < ccemails.emailcount; i++) { +for (j =0 ; j < alternates->count; j++) { +chomp (alternates->strs[j]); +if (strcmp (alternates->strs[j], + ccemails.emaillist[i]) =0 ) + intocc =1 ; + } + } } +for (i =0 ; i < alternates->count; i++) + myfree(alternates->strs[i]; + notoccdenymails =statctrl (listdir,"notoccdenymails" );if (addrtocc && !intocc) {
Signature · 4 lines
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.Quoted 4 lines · Mads Martin Joergensen
* Wolf Bergenheim <[email protected]> [Feb 08. 2005 12:45]:
This is completely untested, I only made sure it compiles. So try it out and let me know if it works, then I'll commit it to CVS.
ahem.. it is a production server... I'd rather not put untested code there... I hope you understand... /:
But thanks for jumping up and doing it. It's not that much of a rush.. the new domains are going live 1.3 (:
--W
It looks like it _should_ work (;
Signature · 1 line
<:3 )---- Wolf Bergenheim ----( 8:>
Quoted 8 lines · Wolf Bergenheim
Quoted 2 lines
This is completely untested, I only made sure it compiles. So try it out and let me know if it works, then I'll commit it to CVS.
ahem.. it is a production server... I'd rather not put untested code there... I hope you understand... /:
But thanks for jumping up and doing it. It's not that much of a rush.. the new domains are going live 1.3 (:
Could be you had a test setup.
Signature · 4 lines
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.Quoted 6 lines · Allan Joergensen
Quoted 2 lines
The ChangeLog has the glory details, I can recommend an upgrade:
1.2.3I would like to request a feature. It's been on my wishlist for quite some time; I would like the port of the outgoing relay server to be configurable (just changing
init_socket.cworks i know).
Allan, could you try this patch. It'll make the port configurable with LISTDIR/control/smtpport.
init_sockfd.h +1 -1
@@ -24,6 +24,6 @@#ifndef INIT_SOCKFD_H #define INIT_SOCKFD_H -void init_sockfd (int *sockfd,const char *relayhost); +void init_sockfd (int *sockfd,const char *relayhost,unsigned short port);#endif /* INIT_SOCKFD_H */
mlmmj-send.h +1 -1
@@ -45,7 +45,7 @@ size_t mailsize, const char *from, const char *listdir, const char *hdrs, size_t hdrslen, const char *body, size_t bodylen, const char *extra); -int initsmtp (int *sockfd,const char *relayhost); +int initsmtp (int *sockfd,const char *relayhost,unsigned short port);int endsmtp (int *sockfd);#endif /* MMJML_SEND_H */
init_sockfd.c +1 -2
@@ -32,11 +32,10 @@#include "init_sockfd.h" #include "log_error.h" -void init_sockfd (int *sockfd,const char *relayhost) +void init_sockfd (int *sockfd,const char *relayhost,unsigned short port) {int len;struct sockaddr_in addr; -u_short port =25 ;if (getenv ("MLMMJ_TESTING" )) { relayhost ="127.0.0.1" ;
mlmmj-send.c +14 -11
@@ -290,13 +290,13 @@return 0 ; } -int initsmtp (int *sockfd,const char *relayhost) +int initsmtp (int *sockfd,const char *relayhost,unsigned short port) {int retval =0 ;char *reply =NULL ;char *myhostname =hostnamestr (); -init_sockfd (sockfd, relayhost); +init_sockfd (sockfd, relayhost, port);if ((reply =checkwait_smtpreply (*sockfd,MLMMJ_CONNECT )) !=NULL ) { log_error(LOG_ARGS, "No proper greeting to our connect"
@@ -600,7 +600,7 @@char *mlmmjbounce =NULL , *bindir, *mailmap, *probefile, *a;char *body =NULL , *hdrs =NULL , *memmailsizestr =NULL , *verp =NULL ;char relay[16 ], *listname, *listfqdn, *verpfrom, *maxverprecipsstr; -char strindex[32 ], *reply; +char strindex[32 ], *reply, *strport;ssize_t memmailsize =0 ;DIR *subddir;struct dirent *dp;
@@ -608,6 +608,7 @@struct hostent *relayent;uid_t uid;struct strlist stl; +unsigned short smtpport;CHECKFULLPATH (argv[0 ]);
@@ -863,11 +864,13 @@strncpy (relay,RELAYHOST ,sizeof (relay)); } } + strport =ctrlvalue (listdir,"smtpport" ); + smtpport = (unsigned short )atol (strport);switch (listctrl[0 ]) {case '1' :/* A single mail is to be sent */ case '6' : -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); sendres =send_mail (sockfd, bounceaddr, to_addr, replyto, mailmap, st.st_size, listdir,NULL , hdrs, hdrslen, body, bodylen);
@@ -910,7 +913,7 @@ }break ;case '2' :/* Moderators */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (send_mail_many_fd (sockfd, bounceaddr,NULL , mailmap, st.st_size, subfd,NULL ,NULL , listdir,NULL , hdrs, hdrslen, body, bodylen))
@@ -919,7 +922,7 @@endsmtp (&sockfd);break ;case '3' :/* resending earlier failed mails */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (send_mail_many_fd (sockfd,NULL ,NULL , mailmap, st.st_size, subfd, listaddr, mailfilename, listdir, mlmmjbounce, hdrs, hdrslen, body, bodylen))
@@ -929,7 +932,7 @@unlink (subfilename);break ;case '4' :/* send mails to owner */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); if(send_mail_many_fd(sockfd, bounceaddr, NULL, mailmap, st.st_size, subfd, listaddr, mailfilename, listdir, mlmmjbounce, hdrs, hdrslen, body,
@@ -939,7 +942,7 @@endsmtp (&sockfd);break ;case '5' :/* bounceprobe - handle relayhost local users bouncing*/ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); sendres =send_mail (sockfd, bounceaddr, to_addr, replyto, mailmap, st.st_size, listdir,NULL , hdrs, hdrslen, body, bodylen);
@@ -999,7 +1002,7 @@ }if (verp) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (write_mail_from (sockfd, verpfrom, verp)) {log_error (LOG_ARGS ,"Could not write MAIL FROM\n" );
@@ -1034,7 +1037,7 @@ res =getaddrsfromfd (&stl, subfd, maxverprecips);if (stl.count = maxverprecips) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (verp) { sendres = send_mail_verp( sockfd, &stl,
@@ -1072,7 +1075,7 @@ }if (stl.count) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (verp) { sendres = send_mail_verp(sockfd, &stl, mailmap, st.st_size, verpfrom, listdir,
Signature · 4 lines
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.Quoted 10 lines · Mads Martin Joergensen
Quoted 6 lines · Allan Joergensen
Quoted 2 lines
The ChangeLog has the glory details, I can recommend an upgrade:
1.2.3I would like to request a feature. It's been on my wishlist for quite some time; I would like the port of the outgoing relay server to be configurable (just changing
init_socket.cworks i know).Allan, could you try this patch. It'll make the port configurable with LISTDIR/control/smtpport.
No, wait, there's a bit missing.
Signature · 4 lines
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.Quoted 8 lines · Mads Martin Joergensen
Quoted 6 lines
Quoted 3 lines
I would like to request a feature. It's been on my wishlist for quite some time; I would like the port of the outgoing relay server to be configurable (just changing
init_socket.cworks i know).Allan, could you try this patch. It'll make the port configurable with LISTDIR/control/smtpport.
No, wait, there's a bit missing.
Now it also defaults to 25 ;-))
init_sockfd.h +1 -1
@@ -24,6 +24,6 @@#ifndef INIT_SOCKFD_H #define INIT_SOCKFD_H -void init_sockfd (int *sockfd,const char *relayhost); +void init_sockfd (int *sockfd,const char *relayhost,unsigned short port);#endif /* INIT_SOCKFD_H */
mlmmj-send.h +1 -1
@@ -45,7 +45,7 @@ size_t mailsize, const char *from, const char *listdir, const char *hdrs, size_t hdrslen, const char *body, size_t bodylen, const char *extra); -int initsmtp (int *sockfd,const char *relayhost); +int initsmtp (int *sockfd,const char *relayhost,unsigned short port);int endsmtp (int *sockfd);#endif /* MMJML_SEND_H */
init_sockfd.c +1 -2
@@ -32,11 +32,10 @@#include "init_sockfd.h" #include "log_error.h" -void init_sockfd (int *sockfd,const char *relayhost) +void init_sockfd (int *sockfd,const char *relayhost,unsigned short port) {int len;struct sockaddr_in addr; -u_short port =25 ;if (getenv ("MLMMJ_TESTING" )) { relayhost ="127.0.0.1" ;
mlmmj-send.c +15 -11
@@ -290,13 +290,13 @@return 0 ; } -int initsmtp (int *sockfd,const char *relayhost) +int initsmtp (int *sockfd,const char *relayhost,unsigned short port) {int retval =0 ;char *reply =NULL ;char *myhostname =hostnamestr (); -init_sockfd (sockfd, relayhost); +init_sockfd (sockfd, relayhost, port);if ((reply =checkwait_smtpreply (*sockfd,MLMMJ_CONNECT )) !=NULL ) { log_error(LOG_ARGS, "No proper greeting to our connect"
@@ -600,7 +600,7 @@char *mlmmjbounce =NULL , *bindir, *mailmap, *probefile, *a;char *body =NULL , *hdrs =NULL , *memmailsizestr =NULL , *verp =NULL ;char relay[16 ], *listname, *listfqdn, *verpfrom, *maxverprecipsstr; -char strindex[32 ], *reply; +char strindex[32 ], *reply, *strport;ssize_t memmailsize =0 ;DIR *subddir;struct dirent *dp;
@@ -608,6 +608,7 @@struct hostent *relayent;uid_t uid;struct strlist stl; +unsigned short smtpport =25 ;CHECKFULLPATH (argv[0 ]);
@@ -863,11 +864,14 @@strncpy (relay,RELAYHOST ,sizeof (relay)); } } + strport =ctrlvalue (listdir,"smtpport" ); +if (strport) + smtpport = (unsigned short )atol (strport);switch (listctrl[0 ]) {case '1' :/* A single mail is to be sent */ case '6' : -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); sendres =send_mail (sockfd, bounceaddr, to_addr, replyto, mailmap, st.st_size, listdir,NULL , hdrs, hdrslen, body, bodylen);
@@ -910,7 +914,7 @@ }break ;case '2' :/* Moderators */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (send_mail_many_fd (sockfd, bounceaddr,NULL , mailmap, st.st_size, subfd,NULL ,NULL , listdir,NULL , hdrs, hdrslen, body, bodylen))
@@ -919,7 +923,7 @@endsmtp (&sockfd);break ;case '3' :/* resending earlier failed mails */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (send_mail_many_fd (sockfd,NULL ,NULL , mailmap, st.st_size, subfd, listaddr, mailfilename, listdir, mlmmjbounce, hdrs, hdrslen, body, bodylen))
@@ -929,7 +933,7 @@unlink (subfilename);break ;case '4' :/* send mails to owner */ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); if(send_mail_many_fd(sockfd, bounceaddr, NULL, mailmap, st.st_size, subfd, listaddr, mailfilename, listdir, mlmmjbounce, hdrs, hdrslen, body,
@@ -939,7 +943,7 @@endsmtp (&sockfd);break ;case '5' :/* bounceprobe - handle relayhost local users bouncing*/ -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport); sendres =send_mail (sockfd, bounceaddr, to_addr, replyto, mailmap, st.st_size, listdir,NULL , hdrs, hdrslen, body, bodylen);
@@ -999,7 +1003,7 @@ }if (verp) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (write_mail_from (sockfd, verpfrom, verp)) {log_error (LOG_ARGS ,"Could not write MAIL FROM\n" );
@@ -1034,7 +1038,7 @@ res =getaddrsfromfd (&stl, subfd, maxverprecips);if (stl.count = maxverprecips) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (verp) { sendres = send_mail_verp( sockfd, &stl,
@@ -1072,7 +1076,7 @@ }if (stl.count) { -initsmtp (&sockfd, relay); +initsmtp (&sockfd, relay, smtpport);if (verp) { sendres = send_mail_verp(sockfd, &stl, mailmap, st.st_size, verpfrom, listdir,
Signature · 4 lines
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.Hi Wolf,
Quoted 5 lines · Wolf Bergenheim
ahem.. it is a production server... I'd rather not put untested code there... I hope you understand... /:
But thanks for jumping up and doing it. It's not that much of a rush.. the new domains are going live 1.3 (:
If you want to support two addresses for the same list, you could create two lists with symlinks for the common files. Eg.:
$ ls -l /var/spool/mlmmj/list-386596/ drwxr-xr-x 2 nobody wheel 240 Dec 3 12:49 archive drwxr-xr-x 2 nobody wheel 632 Aug 26 19:59 bounce drwxr-xr-x 2 nobody wheel 288 Aug 3 2004 control drwxr-xr-x 2 nobody wheel 2224 Dec 3 13:51 incoming -rw-r--r-- 1 nobody wheel 2 Dec 3 12:48 index drwxr-xr-x 2 nobody wheel 368 Dec 3 12:48 log drwxr-xr-x 2 nobody wheel 48 Aug 3 2004 moderation drwxr-xr-x 3 nobody wheel 80 Aug 26 19:59 queue drwxr-xr-x 6 nobody wheel 144 Sep 3 15:20 requeue drwxr-xr-x 2 nobody wheel 48 May 5 2004 subconf drwxr-xr-x 2 nobody wheel 72 Dec 3 12:48 subscribers.d drwxr-xr-x 2 nobody wheel 216 May 12 2004 text drwxr-xr-x 2 nobody wheel 48 May 6 2004 unsubconf
$ ls -l /var/spool/mlmmj/list-386596-alias lrwxrwxrwx 1 nobody wheel 23 Feb 8 18:52 archive -> ../list-386596/archive/ lrwxrwxrwx 1 nobody wheel 22 Feb 8 18:52 bounce -> ../list-386596/bounce/ drwxr-xr-x 2 nobody wheel 48 Feb 8 18:53 control lrwxrwxrwx 1 nobody wheel 24 Feb 8 18:53 incoming -> ../list-386596/incoming/ lrwxrwxrwx 1 nobody wheel 20 Feb 8 18:53 index -> ../list-386596/index lrwxrwxrwx 1 nobody wheel 19 Feb 8 18:53 log -> ../list-386596/log/ lrwxrwxrwx 1 nobody wheel 26 Feb 8 18:53 moderation -> ../list-386596/moderation/ lrwxrwxrwx 1 nobody wheel 21 Feb 8 18:53 queue -> ../list-386596/queue/ lrwxrwxrwx 1 nobody wheel 23 Feb 8 18:53 requeue -> ../list-386596/requeue/ lrwxrwxrwx 1 nobody wheel 23 Feb 8 18:53 subconf -> ../list-386596/subconf/ lrwxrwxrwx 1 nobody wheel 29 Feb 8 18:53 subscribers.d -> ../list-386596/subscribers.d/ lrwxrwxrwx 1 nobody wheel 20 Feb 8 18:53 text -> ../list-386596/text/ lrwxrwxrwx 1 nobody wheel 25 Feb 8 18:53 unsubconf -> ../list-386596/unsubconf/
OBS! This is not tested, but it should "solve" your problem without any change to the code.
Morten
Signature · 2 lines
Morten K. Poulsen <[email protected]> http://www.afdelingp.dk/
Quoted 4 lines · Mads Martin Joergensen
Quoted 3 lines
Quoted 2 lines
Allan, could you try this patch. It'll make the port configurable with LISTDIR/control/smtpport.
No, wait, there's a bit missing.
Now it also defaults to 25 ;-))
It's workings, thanks :)
mvh
Signature · 3 lines
Allan Joergensen "Even you couldn't give that much blood, Spock" McCoy
Quoted 2 lines · Mads Martin Joergensen
This is completely untested, I only made sure it compiles. So try it out and let me know if it works, then I'll commit it to CVS.
It works, except for a missing closing parenthesis.
Review
Quoted 2 lines
(quoted diff) +2
-0+ for(i = 0; i < alternates->count; i++) + myfree(alternates->strs[i];
This should be.
myfree(alternates->strs[i]);
I've committed it to CVS.
Signature · 4 lines
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.