From c6c21608d161399d2a60f9c99ab01478d5e0e5fa Mon Sep 17 00:00:00 2001 From: mortenp Date: Thu, 7 Dec 2006 08:53:30 +1100 Subject: [PATCH] Added list FAQ feature (Henne Vogelsang) --- ChangeLog | 1 + listtexts/Makefile.am | 2 +- listtexts/cz/listfaq | 4 ++++ listtexts/da/listfaq | 4 ++++ listtexts/de/listfaq | 4 ++++ listtexts/es/listfaq | 4 ++++ listtexts/fr/listfaq | 4 ++++ listtexts/it/listfaq | 4 ++++ listtexts/listfaq | 4 ++++ src/listcontrol.c | 17 +++++++++++++++++ src/prepstdreply.c | 3 +++ 11 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 listtexts/cz/listfaq create mode 100644 listtexts/da/listfaq create mode 100644 listtexts/de/listfaq create mode 100644 listtexts/es/listfaq create mode 100644 listtexts/fr/listfaq create mode 100644 listtexts/it/listfaq create mode 100644 listtexts/listfaq diff --git a/ChangeLog b/ChangeLog index c47104f3..122569bc 100644 --- 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 diff --git a/listtexts/Makefile.am b/listtexts/Makefile.am index f21236f7..0024c523 100644 --- a/listtexts/Makefile.am +++ b/listtexts/Makefile.am @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/cz/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/da/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/de/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/es/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/fr/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/it/listfaq @@ -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 index 00000000..350ba367 --- /dev/null +++ b/listtexts/listfaq @@ -0,0 +1,4 @@ +Subject: FAQ - Frequently asked questions of the $listaddr$ list. + +Sorry no FAQ available yet. + diff --git a/src/listcontrol.c b/src/listcontrol.c index 3fe1184d..5be1f062 100644 --- a/src/listcontrol.c +++ b/src/listcontrol.c @@ -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"); diff --git a/src/prepstdreply.c b/src/prepstdreply.c index 03fc9920..a7074459 100644 --- a/src/prepstdreply.c +++ b/src/prepstdreply.c @@ -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; -- 2.47.3