From: Ben Schmidt Date: Sun, 19 Sep 2010 16:25:54 +0000 (+1000) Subject: Add a $subject$ substitution for list texts X-Git-Tag: RELEASE_1_2_18a1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ececbc95d18a46da958764ce40ce8f853d6e0d6c;p=thirdparty%2Fmlmmj.git Add a $subject$ substitution for list texts --- diff --git a/ChangeLog b/ChangeLog index 47c931bf..3f9e60ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + o Add a $subject$ substitution for list texts o Changes to how $originalmail$ works -- existing installations will change behaviour due to this; prepending a space to the lines currently containing $originalmail$ in the listtexts will generally retain current behaviour diff --git a/README.listtexts b/README.listtexts index ba63b7e9..3f1725ea 100644 --- a/README.listtexts +++ b/README.listtexts @@ -237,13 +237,19 @@ multi-line substitutions and would not work in a header): number like 1000000000. - $posteraddr$ - (available only in subonlypost) + (available only in access, notintocc, moderation, moderation-poster and + subonlypost) the from address of the message that was received as determined by Mlmmj - $subaddr$ (available only in submod-moderator and [un]sub-confirm[-digest|-nomail]) the address requested to be (un-)subscribed +- $subject$ + (available only in access, notintocc, moderation, moderation-poster and + subonlypost) + the subject line of the message in question + - \uNNNN (NNNN are hex digits) a Unicode character diff --git a/src/mlmmj-process.c b/src/mlmmj-process.c index ecc54beb..07d33657 100644 --- a/src/mlmmj-process.c +++ b/src/mlmmj-process.c @@ -52,6 +52,7 @@ #include "memory.h" #include "log_oper.h" #include "chomp.h" +#include "unistr.h" enum action { ALLOW, @@ -71,14 +72,16 @@ static char *action_strs[] = { void newmoderated(const char *listdir, const char *mailfilename, - const char *mlmmjsend, const char *efromsender) + const char *mlmmjsend, const char *efromsender, + size_t tokencount, char **data) { + size_t i; char *from, *listfqdn, *listname, *moderators = NULL; char *buf, *replyto, *listaddr = getlistaddr(listdir), *listdelim; char *queuefilename = NULL, *moderatorsfilename, *efromismod = NULL; char *mailbasename = mybasename(mailfilename), *tmp, *to; int moderatorsfd, foundaddr = 0, notifymod = 0, status; - char *maildata[4] = { "moderateaddr", NULL, "moderators", NULL }; + char *maildata[10] = { "moderateaddr", NULL, "moderators", NULL }; pid_t childpid, pid; #if 0 printf("mailfilename = [%s], mailbasename = [%s]\n", mailfilename, @@ -87,6 +90,13 @@ void newmoderated(const char *listdir, const char *mailfilename, listfqdn = genlistfqdn(listaddr); listname = genlistname(listaddr); + MY_ASSERT(tokencount<=3) + for (i=0; i