]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Fix nasty bug with "bla,bla" <bla@bla>
authormmj <none@none>
Tue, 17 Jan 2006 11:47:06 +0000 (22:47 +1100)
committermmj <none@none>
Tue, 17 Jan 2006 11:47:06 +0000 (22:47 +1100)
ChangeLog
VERSION
src/find_email_adr.c
src/mlmmj-bounce.c

index ca149873583c1defb81958f64b094dbe582a115a..440699f976327bea89e26645247bd64e3322f825 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1.2.10
+ o Fix nasty bug in the new 1.2.9 find_email_adr() making comma in
+   quoted text in From: being discarded as invalid
+ o Simply make all addresses lowercase before doing anything else
+   wrt. sub/unsub and bounce
  o Add czech listtexts (Lukas Hluze)
  o Make non list emails (subconf, moderation etc.) also honor relayhost
    and smtpport
diff --git a/VERSION b/VERSION
index 4880ce73c93404af531ffcb93cd980ca212fa186..963ed7cf3714d8edd6b4c2956526079af0bc9065 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.10-pre1
+1.2.10
index f9c11700148113237823bd3d1eb21c09aadfc43c..5f1fb40b994ec67cb10272c24004189f7e6de0f6 100644 (file)
@@ -184,6 +184,7 @@ static char *skin(char *name)
 struct email_container *find_email_adr(const char *str,
                struct email_container *retstruct)
 {
+       char *c1 = NULL, *c2 = NULL;
        char *p;
        char *s;
 
@@ -196,12 +197,30 @@ struct email_container *find_email_adr(const char *str,
                char *cur;
 
                cur = p;
+oncemore:
                p = strchr(p, ',');
                if (p) {
                        /* If there's a comma, replace it with a NUL, so
-                        * cur will only have one address in it. */
-                       *p = '\0';
-                       p += 1;
+                        * cur will only have one address in it. Except
+                        * it's not in ""s */
+                       c1 = strchr(cur, '"');
+                       if(c1) {
+                               c2 = strchr(c1+1, '"');
+                       }
+                       if(c2) {
+                               if(*(c2-1) == '\\') {
+                                       *c2 = ' ';
+                                       c2 = NULL;
+                                       goto oncemore;
+                               }
+                       }
+                       if(c2 && c2 < p) {
+                               *p = '\0';
+                               p += 1;
+                       } else {
+                               *p = ' ';
+                               goto oncemore;
+                       }
                }
 
                while(cur && ((' ' == *cur) ||
index c4a2bf2e1f317bbe75d060c235257899e8e56e15..09b18ead7198989d0a473235a3083806b8d3cd24 100644 (file)
@@ -229,10 +229,10 @@ static void print_help(const char *prg)
 
 int main(int argc, char **argv)
 {
-       int opt, fd, dsnbounce = 0;
+       int opt, fd, dsnbounce = 0, i = 0;
        char *listdir = NULL, *address = NULL, *number = NULL;
        char *bindir, *mlmmjsend, *savename;
-       char *mailname = NULL, *bfilename, *a, *buf;
+       char *mailname = NULL, *bfilename, *a, *buf, *lowcaseaddr;
        size_t len;
        time_t t;
        int probe = 0;
@@ -316,6 +316,15 @@ int main(int argc, char **argv)
                a = strrchr(address, '@');
                *a = '=';
        }
+
+       /* Make the address lowercase */
+       lowcaseaddr = mystrdup(address);
+       i = 0;
+       while(lowcaseaddr[i]) {
+               lowcaseaddr[i] = tolower(lowcaseaddr[i]);
+               i++;
+       }
+       address = lowcaseaddr;
                        
        if(number != NULL && probe != 0) {
                fprintf(stderr, "You can only specify one of -n or -p\n");