changeset 155:f844a6213c62

"Resolving" the conflict by committing my version anyway (it has a nice comment). That guy is fast.
author mortenp
date Thu, 03 Jun 2004 07:57:30 +1000
parents 58e5a553a6a0
children 81b1c9ea0b3e
files src/mlmmj-send.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-send.c	Thu Jun 03 07:52:48 2004 +1000
+++ b/src/mlmmj-send.c	Thu Jun 03 07:57:30 2004 +1000
@@ -572,12 +572,18 @@
 			free(subfilename);
 
 			initsmtp(&sockfd, relayhost);
-			if(send_mail_many(sockfd, NULL, NULL, mailfile, subfile,
-					listaddr, archivefilename, listdir,
-					mlmmjbounce))
+			sendres = send_mail_many(sockfd, NULL, NULL, mailfile,
+					subfile, listaddr, archivefilename,
+					listdir, mlmmjbounce);
+			if (sendres) {
+				/* If send_mail_many() failed we close the
+				 * connection to the mail server in a brutal
+				 * manner, because we could be in any state
+				 * (DATA for instance). */
 				close(sockfd);
-			else
+			} else {
 				endsmtp(&sockfd);
+			}
 			fclose(subfile);
 		}
 		closedir(subddir);