]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Added list FAQ feature (Henne Vogelsang)
authormortenp <none@none>
Wed, 6 Dec 2006 21:53:30 +0000 (08:53 +1100)
committermortenp <none@none>
Wed, 6 Dec 2006 21:53:30 +0000 (08:53 +1100)
ChangeLog
listtexts/Makefile.am
listtexts/cz/listfaq [new file with mode: 0644]
listtexts/da/listfaq [new file with mode: 0644]
listtexts/de/listfaq [new file with mode: 0644]
listtexts/es/listfaq [new file with mode: 0644]
listtexts/fr/listfaq [new file with mode: 0644]
listtexts/it/listfaq [new file with mode: 0644]
listtexts/listfaq [new file with mode: 0644]
src/listcontrol.c
src/prepstdreply.c

index c47104f352fcdc7a27a3e791c210624745aea57b..122569bc5ee3012c24e4232c0cbd2217756d98e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+ o Added list FAQ feature (Henne Vogelsang)
  o Added support for default list text directory (Henne Vogelsang)
  o Fixed a Bourne Shell issue in mlmmj-make-ml.sh (Magnus Naeslund)
  o Fixed hostnamestr() for hosts that can't find themselves using
index f21236f75f2f1458043f8475851ac4cf5ac41c1a..0024c5231879400c30dc71085b11d41c8220d77b 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-dist_textlib_DATA = access bounce-probe listhelp moderation notifysub \
+dist_textlib_DATA = access bounce-probe listhelp listfaq moderation notifysub \
        notifysub-digest notifysub-nomail notifyunsub notifyunsub-digest \
        notifyunsub-nomail notintocc sub-confirm sub-confirm-digest \
        sub-confirm-nomail sub-ok sub-ok-digest sub-ok-nomail subonlypost \
diff --git a/listtexts/cz/listfaq b/listtexts/cz/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/da/listfaq b/listtexts/da/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/de/listfaq b/listtexts/de/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/es/listfaq b/listtexts/es/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/fr/listfaq b/listtexts/fr/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/it/listfaq b/listtexts/it/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
diff --git a/listtexts/listfaq b/listtexts/listfaq
new file mode 100644 (file)
index 0000000..350ba36
--- /dev/null
@@ -0,0 +1,4 @@
+Subject: FAQ - Frequently asked questions of the $listaddr$ list.
+
+Sorry no FAQ available yet.
+
index 3fe1184d5347c0071c2259a07471ffb94f55200b..5be1f0622005b2801de40e01be5faedf3c214824 100644 (file)
@@ -63,6 +63,7 @@ enum ctrl_e {
        CTRL_BOUNCES,
        CTRL_MODERATE,
        CTRL_HELP,
+       CTRL_FAQ,
        CTRL_GET,
        CTRL_LIST,
        CTRL_END  /* end marker, must be last */
@@ -92,6 +93,7 @@ static struct ctrl_command ctrl_commands[] = {
        { "bounces",            1 },
        { "moderate",           1 },
        { "help",               0 },
+       { "faq",                0 },
        { "get",                1 },
        { "list",               0 }
 };
@@ -628,6 +630,21 @@ int listcontrol(struct email_container *fromemails, const char *listdir,
                send_help(listdir, fromemails->emaillist[0], mlmmjsend, "help", "listhelp");
                break;
 
+       /* listname+faq@domain.tld */
+        case CTRL_FAQ:
+               if(!strchr(fromemails->emaillist[0], '@')) {
+                       /* Not a valid From: address */
+                       errno = 0;
+                       log_error(LOG_ARGS, "A faq request was"
+                               " sent with an invalid From: header."
+                               " Ignoring mail");
+                       return -1;
+               }
+               log_oper(listdir, OPLOGFNAME, "%s requested faq",
+                               fromemails->emaillist[0]);
+               send_help(listdir, fromemails->emaillist[0], mlmmjsend, "faq", "listfaq");
+               break;
+
        /* listname+get-INDEX@domain.tld */
        case CTRL_GET:
                noget = statctrl(listdir, "noget");
index 03fc9920b1aee16139e4f22533e0bb67ff923e93..a70744596b4739ec49cf2dca11a92e68afcd5500 100644 (file)
@@ -102,6 +102,9 @@ char *substitute_one(const char *line, const char *listaddr,
        } else if(strcmp(token, "helpaddr") == 0) {
                value = concatstr(4, listname, listdelim, "help@", fqdn);
                goto concatandreturn;
+       } else if(strcmp(token, "faqaddr") == 0) {
+               value = concatstr(4, listname, listdelim, "faq@", fqdn);
+               goto concatandreturn;
        } else if(strcmp(token, "listgetN") == 0) {
                value = concatstr(4, listname, listdelim, "get-N@", fqdn);
                goto concatandreturn;