]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
"Resolving" the conflict by committing my version anyway (it has a nice comment)...
authormortenp <none@none>
Wed, 2 Jun 2004 21:57:30 +0000 (07:57 +1000)
committermortenp <none@none>
Wed, 2 Jun 2004 21:57:30 +0000 (07:57 +1000)
src/mlmmj-send.c

index 70c4c5bcf83f56f26be391113e03a55edfce4878..8c25d47f739d32190704b38d2fce29be424e339a 100644 (file)
@@ -572,12 +572,18 @@ int main(int argc, char **argv)
                        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);