From fd3bf06a8a48a82b851fbef60fba49135474a1dc Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 15 Jan 2001 16:55:45 +0000 Subject: [PATCH] List's "AllowPublicSubscripiton" does not exist anymore. Now we have "SubscriptionType" with valid values "public", "admin" or "acknowledged". --- config.c | 19 +++++++++++++++---- config/list-config | 22 +++++++++++++++------- petidomo.h | 15 ++++++++++++--- subscribe.c | 2 +- unsubscribe.c | 2 +- 5 files changed, 44 insertions(+), 16 deletions(-) diff --git a/config.c b/config.c index 0fe2c2c..f1ffc16 100644 --- a/config.c +++ b/config.c @@ -136,7 +136,7 @@ static char* listtype; static char* reply_to; static char* postingfilter; static char* archivepath; -static bool allowpubsub; +static char* subtype; static bool allowmembers; static char* intro_file; static char* sig_file; @@ -161,7 +161,7 @@ const struct List_Config* getListConfig(const char * listname) struct ConfigFile ListCF[] = { { "ListType", CF_STRING, &listtype }, - { "AllowPublicSubscription", CF_YES_NO, &allowpubsub }, + { "SubscriptionType", CF_STRING, &subtype }, { "AllowMembersCommand", CF_YES_NO, &allowmembers }, { "ReplyTo", CF_STRING, &reply_to }, { "Hostname", CF_STRING, &list_fqdn }, @@ -188,7 +188,7 @@ const struct List_Config* getListConfig(const char * listname) reply_to = NULL; postingfilter = NULL; archivepath = NULL; - allowpubsub = TRUE; + subtype = NULL; allowmembers = FALSE; intro_file = "introduction"; sig_file = "signature"; @@ -252,12 +252,23 @@ const struct List_Config* getListConfig(const char * listname) ListConfig->listtype = LIST_CLOSED; else if (!strcasecmp(listtype, "moderated")) ListConfig->listtype = LIST_MODERATED; + else if (!strcasecmp(listtype, "acknowledged") || !strcasecmp(listtype, "acked")) + ListConfig->listtype = LIST_ACKED; + else if (!strcasecmp(listtype, "acknowledged-once") || !strcasecmp(listtype, "acked-once")) + ListConfig->listtype = LIST_ACKED_ONCE; else { syslog(LOG_ERR, "List \"%s\" doesn't have a valid type in config file.", listname); exit(1); } - ListConfig->allowpubsub = allowpubsub; + + if (!strcasecmp(subtype, "public")) + ListConfig->listtype = SUBSCRIPTION_PUBLIC; + else if (!strcasecmp(subtype, "admin")) + ListConfig->listtype = SUBSCRIPTION_ADMIN; + else if (!strcasecmp(subtype, "acknowledged") || !strcasecmp(subtype, "acked")) + ListConfig->listtype = SUBSCRIPTION_ACKED; + ListConfig->allowmembers = allowmembers; ListConfig->fqdn = (list_fqdn) ? list_fqdn : MasterConfig->fqdn; ListConfig->reply_to = reply_to; diff --git a/config/list-config b/config/list-config index c22142e..b091cdc 100644 --- a/config/list-config +++ b/config/list-config @@ -2,28 +2,36 @@ # $Header$ # -# TAG: ListType -# The following types of mailing lists exists and one of them -# should be specified here: +# TAG: ListType +# The following types of mailing lists exists: # # open -- The list is open for all postings which are not rejected # due to the access control mechanism. # closed -- Only subscribers are allowed to post. # moderated -- Only postings which contain the correct posting # password are allowed. +# acknowledged -- Every attempt to post will be answered with +# a request for acknowledgment, asking the poster to +# confirm. This prevents abuse and forgery. +# acknowledged-once -- A fist-time poster will have to +# acknowledge his posting once, after that, he can post +# as he wishes. # # This option is REQUIRED. Petidomo will abort with an error, if it is # unset. ListType open -# TAG: AllowPublicSubscription -# yes -- Everybody can subscribe and unsubscribe. -# no -- Un-/subscription can only be done by the admin. +# TAG: SubscriptionType +# public -- Everybody can subscribe and unsubscribe. +# admin -- Un-/subscription can only be done by the admin. # Authenticiation is done via password mechanism. +# acknowledged -- Anybody can un-/subscribe, but he has to +# acknowledge the request sent to the address add to or +# deleted from the list. # # The default, if this option is unset, is to allow public # subscription and unsubscription. -AllowPublicSubscription yes +SubscriptionType public # TAG: AllowMembersCommand # Does the 'members' or 'who' command work for this mailing list, or diff --git a/petidomo.h b/petidomo.h index 06a41f8..9f7e542 100644 --- a/petidomo.h +++ b/petidomo.h @@ -63,17 +63,26 @@ struct PD_Config char * index_file; }; -enum +enum list_type_t { LIST_OPEN, LIST_CLOSED, - LIST_MODERATED + LIST_MODERATED, + LIST_ACKED, + LIST_ACKED_ONCE + }; + +enum subscription_type_t + { + SUBSCRIPTION_PUBLIC, + SUBSCRIPTION_ADMIN, + SUBSCRIPTION_ACKED }; struct List_Config { unsigned int listtype; - int allowpubsub; + unsigned int subtype; int allowmembers; char * fqdn; char * admin_password; diff --git a/subscribe.c b/subscribe.c index 39360e3..21957a0 100644 --- a/subscribe.c +++ b/subscribe.c @@ -113,7 +113,7 @@ AddAddress(struct Mail * MailStruct, { /* No valid password, check further. */ - if (ListConfig->allowpubsub == FALSE) + if (ListConfig->subtype == SUBSCRIPTION_ADMIN) { /* Access was unauthorized, notify the originator. */ diff --git a/unsubscribe.c b/unsubscribe.c index 801d94b..483c8ae 100644 --- a/unsubscribe.c +++ b/unsubscribe.c @@ -114,7 +114,7 @@ DeleteAddress(struct Mail * MailStruct, { /* No valid password, check further. */ - if (ListConfig->allowpubsub == FALSE) + if (ListConfig->subtype == SUBSCRIPTION_ADMIN) { /* Access was unauthorized, notify the originator. */