Removed the whole concept of "alien subscription". It was stupid to

begin with and now that we'll have acknowledged subscriptions, it is
useless, too.
This commit is contained in:
Peter Simons 2001-01-15 16:35:06 +00:00
parent f5a3d6dbe8
commit 3ad4ad6931
5 changed files with 0 additions and 148 deletions

View File

@ -137,7 +137,6 @@ static char* reply_to;
static char* postingfilter;
static char* archivepath;
static bool allowpubsub;
static bool allowaliensub;
static bool allowmembers;
static char* intro_file;
static char* sig_file;
@ -163,7 +162,6 @@ const struct List_Config* getListConfig(const char * listname)
{
{ "ListType", CF_STRING, &listtype },
{ "AllowPublicSubscription", CF_YES_NO, &allowpubsub },
{ "AllowAlienSubscription", CF_YES_NO, &allowaliensub },
{ "AllowMembersCommand", CF_YES_NO, &allowmembers },
{ "ReplyTo", CF_STRING, &reply_to },
{ "Hostname", CF_STRING, &list_fqdn },
@ -191,7 +189,6 @@ const struct List_Config* getListConfig(const char * listname)
postingfilter = NULL;
archivepath = NULL;
allowpubsub = TRUE;
allowaliensub = TRUE;
allowmembers = FALSE;
intro_file = "introduction";
sig_file = "signature";
@ -261,7 +258,6 @@ const struct List_Config* getListConfig(const char * listname)
exit(1);
}
ListConfig->allowpubsub = allowpubsub;
ListConfig->allowaliensub = allowaliensub;
ListConfig->allowmembers = allowmembers;
ListConfig->fqdn = (list_fqdn) ? list_fqdn : MasterConfig->fqdn;
ListConfig->reply_to = reply_to;

View File

@ -25,18 +25,6 @@ ListType open
# subscription and unsubscription.
AllowPublicSubscription yes
# TAG: AllowAlienSubscription <yes|no>
# yes -- Users are allowed to subscribe and unsubscribe addresses
# not equal to the address they're sending the mail from.
# no -- Users can only add (or remove) the address they're sending
# the mail from to the list (from the list).
# This option has no effect if public subscription has been
# disallowed.
#
# The default, if this option is unset, is to allow alien
# subscription and unsubscription.
AllowAlienSubscription yes
# TAG: AllowMembersCommand <yes|no>
# Does the 'members' or 'who' command work for this mailing list, or
# do you want to keep the addresses of the subscribers confidential?

View File

@ -74,7 +74,6 @@ struct List_Config
{
unsigned int listtype;
int allowpubsub;
int allowaliensub;
int allowmembers;
char * fqdn;
char * admin_password;

View File

@ -174,71 +174,6 @@ AddAddress(struct Mail * MailStruct,
}
return 0;
}
if (ListConfig->allowaliensub == FALSE &&
(MailStruct->From == NULL || !strcasecmp(address, MailStruct->From) == FALSE) &&
(MailStruct->Reply_To == NULL || !strcasecmp(address, MailStruct->Reply_To) == FALSE))
{
/* Trying to subscribe something different than himself. */
syslog(LOG_INFO, "\"%s\" tried to subscribe \"%s\" to list \"%s\", but the list " \
"type doesn't allow this.", originator, address, listname);
fh = vOpenMailer(envelope, originator, NULL);
if (fh != NULL)
{
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
listname, ListConfig->fqdn);
fprintf(fh, "To: %s\n", originator);
fprintf(fh, "Subject: Petidomo: Your request \"subscribe %s %s\"\n", address, listname);
if (MailStruct->Message_Id != NULL)
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
fprintf(fh, "Precedence: junk\n");
fprintf(fh, "Sender: %s\n", envelope);
fprintf(fh, "\n");
buffer = text_easy_sprintf(
"The mailing list \"%s\" does not allow to automatically subscribe or unsubscribe an " \
"address not equal to the one, you are mailing from. Your request has been forwarded " \
"to the list administrator, so please don't send any futher mail. You will be notified " \
"as soon as possible.", listname);
text_wordwrap(buffer, 70);
fprintf(fh, "%s\n", buffer);
CloseMailer(fh);
}
else
syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.",
originator);
/* Notify the owner. */
fh = vOpenMailer(envelope, owner, NULL);
if (fh != NULL)
{
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
listname, ListConfig->fqdn);
fprintf(fh, "To: %s\n", owner);
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
fprintf(fh, "Precedence: junk\n");
fprintf(fh, "Sender: %s\n", envelope);
fprintf(fh, "\n");
buffer = text_easy_sprintf(
"\"%s\" tried to subscribe the address \"%s\" to the \"%s\" mailing list. " \
"The list type does not allow subscribing addresses not equal to the From: " \
"address, though, so the request has been denied. To subscribe this person " \
"manually, send the following commands to the server:", originator, address, listname);
text_wordwrap(buffer, 70);
fprintf(fh, "%s\n\n", buffer);
fprintf(fh, "password <AdminPassword>\n");
fprintf(fh, "subscribe %s %s\n", address, listname);
CloseMailer(fh);
}
else
{
syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
return -1;
}
return 0;
}
}
/* Check whether the address is subscribed already. */

View File

@ -176,72 +176,6 @@ DeleteAddress(struct Mail * MailStruct,
}
return 0;
}
if (ListConfig->allowaliensub == FALSE &&
(MailStruct->From == NULL || !strcasecmp(address, MailStruct->From) == FALSE) &&
(MailStruct->Reply_To == NULL || !strcasecmp(address, MailStruct->Reply_To) == FALSE))
{
/* Trying to unsubscribe something different than himself. */
syslog(LOG_INFO, "\"%s\" tried to unsubscribe \"%s\" from list \"%s\", but the " \
"list type doesn't allow this.", originator, address, listname);
fh = vOpenMailer(envelope, originator, NULL);
if (fh != NULL)
{
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
listname, ListConfig->fqdn);
fprintf(fh, "To: %s\n", originator);
fprintf(fh, "Subject: Petidomo: Your request \"unsubscribe %s %s\"\n",
address, listname);
if (MailStruct->Message_Id != NULL)
fprintf(fh, "In-Reply-To: %s\n", MailStruct->Message_Id);
fprintf(fh, "Precedence: junk\n");
fprintf(fh, "Sender: %s\n", envelope);
fprintf(fh, "\n");
buffer = text_easy_sprintf(
"The mailing list \"%s\" does not allow to automatically subscribe or unsubscribe an " \
"address not equal to the one, you are mailing from. Your request has been forwarded " \
"to the list administrator, so please don't send any futher mail. You will be notified " \
"as soon as possible.", listname);
text_wordwrap(buffer, 70);
fprintf(fh, "%s\n", buffer);
CloseMailer(fh);
}
else
syslog(LOG_ERR, "Failed to send email to \"%s\" concerning his request.",
originator);
/* Notify the owner. */
fh = vOpenMailer(envelope, owner, NULL);
if (fh != NULL)
{
fprintf(fh, "From: %s-request@%s (Petidomo Mailing List Server)\n",
listname, ListConfig->fqdn);
fprintf(fh, "To: %s\n", owner);
fprintf(fh, "Subject: Petidomo: APPROVE %s@%s: Unauthorized request from \"%s\"\n", listname, ListConfig->fqdn, originator);
fprintf(fh, "Precedence: junk\n");
fprintf(fh, "Sender: %s\n", envelope);
fprintf(fh, "\n");
buffer = text_easy_sprintf(
"\"%s\" tried to unsubscribe the address \"%s\" from the \"%s\" mailing list. " \
"The list type does not allow unsubscribing addresses not equal to the From: " \
"address, though, so the request has been denied. To unsubscribe this person " \
"manually, send the following commands to the server:", originator, address, listname);
text_wordwrap(buffer, 70);
fprintf(fh, "%s\n\n", buffer);
fprintf(fh, "password <AdminPassword>\n");
fprintf(fh, "unsubscribe %s %s\n", address, listname);
CloseMailer(fh);
}
else
{
syslog(LOG_ERR, "Failed to send email to \"%s\"!", owner);
return -1;
}
return 0;
}
}
/* Okay, remove the address from the list. */