changeset 58:990e1a4ae6d0

Small typo and bouncehandling now works
author mmj
date Wed, 28 Apr 2004 03:24:19 +1000
parents 6fc67cdd9570
children 0e6552948975
files src/listcontrol.c src/mlmmj-process.c src/mlmmj-recieve.c
diffstat 3 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/listcontrol.c	Wed Apr 28 03:24:04 2004 +1000
+++ b/src/listcontrol.c	Wed Apr 28 03:24:19 2004 +1000
@@ -49,7 +49,9 @@
 
 	find_email_adr(tmpstr, &fromemails);
 
-	printf("controlstr = [%s]\n", controlstr);
+#if 0
+	log_error(LOG_ARGS, "controlstr = [%s]\n", controlstr);
+#endif
 
 	if(strncasecmp(controlstr, "subscribe", 9) == 0) {
 		free(controlstr);
@@ -120,12 +122,14 @@
 			}
 		} else /* Not a confirm so silently ignore */
 			exit(EXIT_SUCCESS);
-	} else if(strncasecmp(controlstr, "bounce-", 7) == 0) {
-		controlstr += 7;
+	} else if(strncasecmp(controlstr, "bounces-", 8) == 0) {
+		controlstr += 8;
 		bouncenr = strrchr(controlstr, '-');
 		if (!bouncenr) exit(EXIT_SUCCESS);  /* malformed bounce, ignore */
 		*bouncenr++ = '\0';
+#if 0
 		log_error(LOG_ARGS, "bounce, bounce, bounce email=[%s] nr=[%s]", controlstr, bouncenr);
+#endif
 		execlp(mlmmjbounce, mlmmjbounce,
 				"-L", listdir,
 				"-a", controlstr,
--- a/src/mlmmj-process.c	Wed Apr 28 03:24:04 2004 +1000
+++ b/src/mlmmj-process.c	Wed Apr 28 03:24:19 2004 +1000
@@ -102,7 +102,8 @@
 	
 	if(fd == -1) {
 		free(donemailname);
-		log_error(LOG_ARGS, "could not create mail file in queue directory");
+		log_error(LOG_ARGS, "could not create mail file in queue"
+				    "directory");
 		exit(EXIT_FAILURE);
 	}
 
@@ -112,8 +113,9 @@
 		exit(EXIT_FAILURE);
 	}
 
-	printf("[%s]\n", donemailname);
-
+#if 0
+	log_error(LOG_ARGS, "[%s]\n", donemailname);
+#endif
 	if((rawmailfile = fopen(mailfile, "r")) == NULL) {
 		free(donemailname);
 		log_error(LOG_ARGS, "could not fopen() input mail file");
@@ -157,9 +159,9 @@
 	}
 
 	if(strchr(toemails.emaillist[0], RECIPDELIM)) {
-		printf("listcontrol(%s, %s, %s, %s, %s, %s, %s)\n", donemailname,
-				listdir, toemails.emaillist[0], mlmmjsub,
-				mlmmjunsub, mlmmjsend, mlmmjbounce);
+#if 0
+		log_error(LOG_ARGS, "listcontrol(%s, %s, %s, %s, %s, %s, %s)\n", donemailname, listdir, toemails.emaillist[0], mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce);
+#endif
 		listcontrol(donemailname, listdir, toemails.emaillist[0],
 			    mlmmjsub, mlmmjunsub, mlmmjsend, mlmmjbounce);
 		return EXIT_SUCCESS;
--- a/src/mlmmj-recieve.c	Wed Apr 28 03:24:04 2004 +1000
+++ b/src/mlmmj-recieve.c	Wed Apr 28 03:24:19 2004 +1000
@@ -77,7 +77,8 @@
 	}
 
 	if(fd < 0) {
-		log_error(LOG_ARGS, "could not create mail file in incoming directory");
+		log_error(LOG_ARGS, "could not create mail file in "
+				    "%s/incoming directory", listdir);
 		free(infilename);
 		exit(EXIT_FAILURE);
 	}
@@ -88,8 +89,9 @@
 		free(line);
 	}
 
-	printf("mlmmj-recieve: wrote %s\n", infilename);
-
+#if 0
+	log_error(LOG_ARGS, "mlmmj-recieve: wrote %s\n", infilename);
+#endif
 	close(fd);
 
 	if(noprocess) {
@@ -115,5 +117,5 @@
 				"-m", infilename, 0);
 	log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjprocess);
 
-	return EXIT_FAILURE;
+	exit(EXIT_FAILURE);
 }