From: Baptiste Daroussin Date: Fri, 14 Apr 2023 08:57:36 +0000 (+0200) Subject: listcontrol: cleanup omit files on reject X-Git-Tag: RELEASE_1_4_0b1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90e9701838dfaf109ae309bf00e352b5819231de;p=thirdparty%2Fmlmmj.git listcontrol: cleanup omit files on reject When rejecting a mail in moderation on a mailing list with "notmetoo" activated, there .omit files were leftovers, now we clean them up --- diff --git a/ChangeLog b/ChangeLog index 7bce8b4a..9a4c0b22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ o mlmmj-send: -l 6 has been removed o mlmmj-send: accept file descriptor number as -s argument o mlmmj-send: accept file descriptor number as -m argument + o cleanup .omit files leftover if moderated emails are rejected and notmetoo + is set. 1.4.0-a2 o Fix a crash with forged probe emails o mlmmj-send does not need anymore absolute path diff --git a/src/listcontrol.c b/src/listcontrol.c index 61e3b028..8cf9fe7b 100644 --- a/src/listcontrol.c +++ b/src/listcontrol.c @@ -496,7 +496,6 @@ int listcontrol(strlist *fromemails, struct ml *ml, } log_oper(ml->fd, OPLOGFNAME, "%s rejected %s", tll_front(*fromemails), param); - free(param); if (unlinkat(ml->fd, moderatefilename, 0) != 0) { log_error(LOG_ARGS, "Could not unlink %s", moderatefilename); @@ -504,6 +503,10 @@ int listcontrol(strlist *fromemails, struct ml *ml, exit(EXIT_FAILURE); } free(moderatefilename); + xasprintf(&moderatefilename, "moderation/%s.omit", param); + unlinkat(ml->fd, moderatefilename, 0); + free(moderatefilename); + free(param); break; /* listname+permit-COOKIE@domain.tld */