From: Baptiste Daroussin Date: Wed, 20 Dec 2023 10:36:41 +0000 (+0100) Subject: bounce: only cleanup the probe file if sending the probe failed X-Git-Tag: RELEASE_1_4_3~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d26182b1fe25a98cdbc3b90814e76708a6c2b864;p=thirdparty%2Fmlmmj.git bounce: only cleanup the probe file if sending the probe failed --- diff --git a/src/mlmmj-bounce.c b/src/mlmmj-bounce.c index c5b0a2be..aa5be753 100644 --- a/src/mlmmj-bounce.c +++ b/src/mlmmj-bounce.c @@ -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); }