changeset 347:b15e8c2dc97f

When using Delivered-To: for spotting the recipient delimiter we should also use it when calling listcontrol.
author mmj
date Wed, 20 Oct 2004 22:12:18 +1000
parents 86314c99da0a
children 3564196ec63e
files ChangeLog src/mlmmj-process.c
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 20 20:52:10 2004 +1000
+++ b/ChangeLog	Wed Oct 20 22:12:18 2004 +1000
@@ -1,3 +1,4 @@
+ o Be consistent when using To: or Delivered-To:
  o mlmmj-unsub should also change user id to the listdir owner
  o Add support for not archiving the list by touching listdir/control/noarchive
  o Add 'nomail' version of lists. Subscribers to the nomail version are
--- a/src/mlmmj-process.c	Wed Oct 20 20:52:10 2004 +1000
+++ b/src/mlmmj-process.c	Wed Oct 20 22:12:18 2004 +1000
@@ -349,6 +349,7 @@
 	struct email_container ccemails = { 0, NULL };
 	struct email_container efromemails = { 0, NULL };
 	struct email_container dtoemails = { 0, NULL };
+	struct email_container *whichto;
 	struct strlist *access_rules = NULL;
 	struct strlist *delheaders = NULL;
 	struct strlist allheaders;
@@ -536,9 +537,14 @@
 	}
 
 	if(dtoemails.emaillist)
-		recipdelim = strchr(dtoemails.emaillist[0], RECIPDELIM);
+		whichto = &dtoemails;
 	else if(toemails.emaillist)
-		recipdelim = strchr(toemails.emaillist[0], RECIPDELIM);
+		whichto = &toemails;
+	else
+		whichto = NULL;
+
+	if(whichto && whichto->emaillist && whichto->emaillist[0])
+		recipdelim = strchr(whichto->emaillist[0], RECIPDELIM);
 	else
 		recipdelim = NULL;
 
@@ -560,7 +566,7 @@
 		log_error(LOG_ARGS, "listcontrol(from, %s, %s, %s, %s, %s, %s)\n", listdir, toemails.emaillist[0], mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce);
 #endif
 		unlink(mailfile);
-		listcontrol(&fromemails, listdir, toemails.emaillist[0],
+		listcontrol(&fromemails, listdir, whichto->emaillist[0],
 			    mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce,
 			    donemailname);
 		return EXIT_SUCCESS;