List's "AllowPublicSubscripiton" does not exist anymore. Now we have

"SubscriptionType" with valid values "public", "admin" or
"acknowledged".
This commit is contained in:
Peter Simons 2001-01-15 16:55:45 +00:00
parent 6168ea3bec
commit fd3bf06a8a
5 changed files with 44 additions and 16 deletions

View File

@ -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;

View File

@ -2,28 +2,36 @@
# $Header$
#
# TAG: ListType <open|closed|moderated>
# The following types of mailing lists exists and one of them
# should be specified here:
# TAG: ListType <open|closed|moderated|acknowledged|acknowledged-once>
# 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|no>
# yes -- Everybody can subscribe and unsubscribe.
# no -- Un-/subscription can only be done by the admin.
# TAG: SubscriptionType <public|admin|acknowledged>
# 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 <yes|no>
# Does the 'members' or 'who' command work for this mailing list, or

View File

@ -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;

View File

@ -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. */

View File

@ -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. */