]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
bounce: only cleanup the probe file if sending the probe failed
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 20 Dec 2023 10:36:41 +0000 (11:36 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 20 Dec 2023 10:36:41 +0000 (11:36 +0100)
src/mlmmj-bounce.c

index c5b0a2bef4cc67a4590aa194879a2d26d53eaced..aa5be75339a94e3a0c95326c2ee69d302ce20c82 100644 (file)
@@ -115,8 +115,10 @@ void do_probe(struct ml *ml, const char *addr)
        mail.to = myaddr;
        mail.from = from;
        mail.fp = fopen(queuefilename, "r");
-       send_single_mail(&mail, ml, false);
-       unlink_bounce(ml, myaddr);
+       if (!send_single_mail(&mail, ml, false)) {
+               unlink_bounce(ml, myaddr);
+               exit(EXIT_FAILURE);
+       }
        fclose(mail.fp);
        exit(EXIT_SUCCESS);
 }