If this is set, the LISTNAME+list@ functionality for requesting an
email with the subscribers for owner is disabled.
- · staticbounceaddr (normal)
+ · staticbounceaddr (normal)
If this is set to something@example.org, the bounce address (Return-Path:)
will be fixed to something+listname-bounces-and-so-on@example.org
in case you need to disable automatic bounce handling.
+
+ · ifmodsendonlymodmoderate (boolean)
+
+ If this file is present, then mlmmj in case of moderation checks the
+ envelope from, to see if the sender is a moderator, and in that case
+ only send the moderation mails to that address. In practice this means that
+ a moderator sending mail to the list wont bother all the other moderators
+ with his mail.
void newmoderated(const char *listdir, const char *mailfilename,
- const char *mlmmjsend)
+ const char *mlmmjsend, const char *efromsender)
{
char *from, *listfqdn, *listname, *moderators = NULL;
char *buf, *replyto, *listaddr = getlistaddr(listdir), *listdelim;
- char *queuefilename = NULL, *moderatorsfilename;
+ char *queuefilename = NULL, *moderatorsfilename, *efromismod = NULL;
char *mailbasename = mybasename(mailfilename), *tmp, *to;
- int moderatorsfd;
+ int moderatorsfd, foundaddr = 0;
char *maildata[4] = { "moderateaddr", NULL, "moderators", NULL };
#if 0
printf("mailfilename = [%s], mailbasename = [%s]\n", mailfilename,
}
myfree(moderatorsfilename);
+ if(statctrl(listdir, "ifmodsendonlymodmoderate"))
+ efromismod = concatstr(2, efromsender, "\n");
+
while((buf = mygetline(moderatorsfd))) {
+ if(efromismod && strcmp(buf, efromismod) == 0)
+ foundaddr = 1;
tmp = moderators;
moderators = concatstr(2, moderators, buf);
myfree(buf);
myfree(tmp);
}
+ if(!foundaddr) {
+ myfree(efromismod);
+ efromismod = NULL;
+ }
+
close(moderatorsfd);
listdelim = getlistdelim(listdir);
"@", listfqdn);
maildata[1] = replyto;
- maildata[3] = moderators;
+ if(efromismod) {
+ myfree(moderators);
+ maildata[3] = efromismod;
+ } else
+ maildata[3] = moderators;
from = concatstr(4, listname, listdelim, "owner@", listfqdn);
to = concatstr(3, listname, "-moderators@", listfqdn); /* FIXME JFA: Should this be converted? Why, why not? */
queuefilename = prepstdreply(listdir, "moderation", "$listowner$",
to, replyto, 2, maildata, NULL, mailfilename);
- execlp(mlmmjsend, mlmmjsend,
+ if(efromismod)
+ execlp(mlmmjsend, mlmmjsend,
+ "-l", "1",
+ "-L", listdir,
+ "-F", from,
+ "-m", queuefilename,
+ "-T", efromsender, (char *)NULL);
+ else
+ execlp(mlmmjsend, mlmmjsend,
"-l", "2",
"-L", listdir,
"-F", from,
/* Don't send a mail about denial to the list, but silently
* discard and exit. Also do this in case it's turned off */
accret = do_access(access_rules, &allheaders,
- fromemails.emaillist[0], listdir);
+ fromemails.emaillist[0], listdir);
if (accret == DENY) {
if ((strcasecmp(listaddr, fromemails.emaillist[0]) ==
0) || noaccessdenymails) {
exit(EXIT_FAILURE);
}
myfree(donemailname);
- newmoderated(listdir, mqueuename, mlmmjsend);
+ newmoderated(listdir, mqueuename, mlmmjsend, efrom);
return EXIT_SUCCESS;
}