List's "AllowPublicSubscripiton" does not exist anymore. Now we have
"SubscriptionType" with valid values "public", "admin" or "acknowledged".
This commit is contained in:
parent
6168ea3bec
commit
fd3bf06a8a
19
config.c
19
config.c
@ -136,7 +136,7 @@ static char* listtype;
|
|||||||
static char* reply_to;
|
static char* reply_to;
|
||||||
static char* postingfilter;
|
static char* postingfilter;
|
||||||
static char* archivepath;
|
static char* archivepath;
|
||||||
static bool allowpubsub;
|
static char* subtype;
|
||||||
static bool allowmembers;
|
static bool allowmembers;
|
||||||
static char* intro_file;
|
static char* intro_file;
|
||||||
static char* sig_file;
|
static char* sig_file;
|
||||||
@ -161,7 +161,7 @@ const struct List_Config* getListConfig(const char * listname)
|
|||||||
struct ConfigFile ListCF[] =
|
struct ConfigFile ListCF[] =
|
||||||
{
|
{
|
||||||
{ "ListType", CF_STRING, &listtype },
|
{ "ListType", CF_STRING, &listtype },
|
||||||
{ "AllowPublicSubscription", CF_YES_NO, &allowpubsub },
|
{ "SubscriptionType", CF_STRING, &subtype },
|
||||||
{ "AllowMembersCommand", CF_YES_NO, &allowmembers },
|
{ "AllowMembersCommand", CF_YES_NO, &allowmembers },
|
||||||
{ "ReplyTo", CF_STRING, &reply_to },
|
{ "ReplyTo", CF_STRING, &reply_to },
|
||||||
{ "Hostname", CF_STRING, &list_fqdn },
|
{ "Hostname", CF_STRING, &list_fqdn },
|
||||||
@ -188,7 +188,7 @@ const struct List_Config* getListConfig(const char * listname)
|
|||||||
reply_to = NULL;
|
reply_to = NULL;
|
||||||
postingfilter = NULL;
|
postingfilter = NULL;
|
||||||
archivepath = NULL;
|
archivepath = NULL;
|
||||||
allowpubsub = TRUE;
|
subtype = NULL;
|
||||||
allowmembers = FALSE;
|
allowmembers = FALSE;
|
||||||
intro_file = "introduction";
|
intro_file = "introduction";
|
||||||
sig_file = "signature";
|
sig_file = "signature";
|
||||||
@ -252,12 +252,23 @@ const struct List_Config* getListConfig(const char * listname)
|
|||||||
ListConfig->listtype = LIST_CLOSED;
|
ListConfig->listtype = LIST_CLOSED;
|
||||||
else if (!strcasecmp(listtype, "moderated"))
|
else if (!strcasecmp(listtype, "moderated"))
|
||||||
ListConfig->listtype = LIST_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
|
else
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "List \"%s\" doesn't have a valid type in config file.", listname);
|
syslog(LOG_ERR, "List \"%s\" doesn't have a valid type in config file.", listname);
|
||||||
exit(1);
|
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->allowmembers = allowmembers;
|
||||||
ListConfig->fqdn = (list_fqdn) ? list_fqdn : MasterConfig->fqdn;
|
ListConfig->fqdn = (list_fqdn) ? list_fqdn : MasterConfig->fqdn;
|
||||||
ListConfig->reply_to = reply_to;
|
ListConfig->reply_to = reply_to;
|
||||||
|
|||||||
@ -2,28 +2,36 @@
|
|||||||
# $Header$
|
# $Header$
|
||||||
#
|
#
|
||||||
|
|
||||||
# TAG: ListType <open|closed|moderated>
|
# TAG: ListType <open|closed|moderated|acknowledged|acknowledged-once>
|
||||||
# The following types of mailing lists exists and one of them
|
# The following types of mailing lists exists:
|
||||||
# should be specified here:
|
|
||||||
#
|
#
|
||||||
# open -- The list is open for all postings which are not rejected
|
# open -- The list is open for all postings which are not rejected
|
||||||
# due to the access control mechanism.
|
# due to the access control mechanism.
|
||||||
# closed -- Only subscribers are allowed to post.
|
# closed -- Only subscribers are allowed to post.
|
||||||
# moderated -- Only postings which contain the correct posting
|
# moderated -- Only postings which contain the correct posting
|
||||||
# password are allowed.
|
# 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
|
# This option is REQUIRED. Petidomo will abort with an error, if it is
|
||||||
# unset.
|
# unset.
|
||||||
ListType open
|
ListType open
|
||||||
|
|
||||||
# TAG: AllowPublicSubscription <yes|no>
|
# TAG: SubscriptionType <public|admin|acknowledged>
|
||||||
# yes -- Everybody can subscribe and unsubscribe.
|
# public -- Everybody can subscribe and unsubscribe.
|
||||||
# no -- Un-/subscription can only be done by the admin.
|
# admin -- Un-/subscription can only be done by the admin.
|
||||||
# Authenticiation is done via password mechanism.
|
# 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
|
# The default, if this option is unset, is to allow public
|
||||||
# subscription and unsubscription.
|
# subscription and unsubscription.
|
||||||
AllowPublicSubscription yes
|
SubscriptionType public
|
||||||
|
|
||||||
# TAG: AllowMembersCommand <yes|no>
|
# TAG: AllowMembersCommand <yes|no>
|
||||||
# Does the 'members' or 'who' command work for this mailing list, or
|
# Does the 'members' or 'who' command work for this mailing list, or
|
||||||
|
|||||||
15
petidomo.h
15
petidomo.h
@ -63,17 +63,26 @@ struct PD_Config
|
|||||||
char * index_file;
|
char * index_file;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum list_type_t
|
||||||
{
|
{
|
||||||
LIST_OPEN,
|
LIST_OPEN,
|
||||||
LIST_CLOSED,
|
LIST_CLOSED,
|
||||||
LIST_MODERATED
|
LIST_MODERATED,
|
||||||
|
LIST_ACKED,
|
||||||
|
LIST_ACKED_ONCE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum subscription_type_t
|
||||||
|
{
|
||||||
|
SUBSCRIPTION_PUBLIC,
|
||||||
|
SUBSCRIPTION_ADMIN,
|
||||||
|
SUBSCRIPTION_ACKED
|
||||||
};
|
};
|
||||||
|
|
||||||
struct List_Config
|
struct List_Config
|
||||||
{
|
{
|
||||||
unsigned int listtype;
|
unsigned int listtype;
|
||||||
int allowpubsub;
|
unsigned int subtype;
|
||||||
int allowmembers;
|
int allowmembers;
|
||||||
char * fqdn;
|
char * fqdn;
|
||||||
char * admin_password;
|
char * admin_password;
|
||||||
|
|||||||
@ -113,7 +113,7 @@ AddAddress(struct Mail * MailStruct,
|
|||||||
{
|
{
|
||||||
/* No valid password, check further. */
|
/* No valid password, check further. */
|
||||||
|
|
||||||
if (ListConfig->allowpubsub == FALSE)
|
if (ListConfig->subtype == SUBSCRIPTION_ADMIN)
|
||||||
{
|
{
|
||||||
/* Access was unauthorized, notify the originator. */
|
/* Access was unauthorized, notify the originator. */
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ DeleteAddress(struct Mail * MailStruct,
|
|||||||
{
|
{
|
||||||
/* No valid password, check further. */
|
/* No valid password, check further. */
|
||||||
|
|
||||||
if (ListConfig->allowpubsub == FALSE)
|
if (ListConfig->subtype == SUBSCRIPTION_ADMIN)
|
||||||
{
|
{
|
||||||
/* Access was unauthorized, notify the originator. */
|
/* Access was unauthorized, notify the originator. */
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user