+++ /dev/null
-/* Copyright (C) 2002, 2003 Mads Martin Joergensen <mmj at mmj.dk>
- *
- * $Id$
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef GETLISTADDR_H
-#define GETLISTADDR_H
-
-char *getlistaddr(const char *listdir);
-
-#endif /* GETLISTADDR_H */
EXTRA_DIST = mlmmj-make-ml
mlmmj_send_SOURCES = mlmmj.c mlmmj-send.c writen.c mail-functions.c itoa.c chomp.c \
- incindexfile.c checkwait_smtpreply.c getlistaddr.c \
+ incindexfile.c checkwait_smtpreply.c \
mylocking.c init_sockfd.c strgen.c random-int.c \
print-version.c log_error.c mygetline.c memory.c \
controls.c getaddrsfromfd.c readn.c \
log_oper.c mylocking.c readn.c
mlmmj_process_SOURCES = mlmmj.c mlmmj-process.c writen.c find_email_adr.c \
- incindexfile.c itoa.c getlistaddr.c chomp.c \
+ incindexfile.c itoa.c chomp.c \
mylocking.c listcontrol.c random-int.c strgen.c \
print-version.c send_help.c prepstdreply.c \
do_all_the_voodoo_here.c mygetline.c gethdrline.c \
send_list.c readn.c getlistdelim.c unistr.c
mlmmj_sub_SOURCES = mlmmj.c mlmmj-sub.c writen.c mylocking.c \
- getlistaddr.c chomp.c random-int.c strgen.c \
+ chomp.c random-int.c strgen.c \
subscriberfuncs.c print-version.c \
log_error.c mygetline.c prepstdreply.c memory.c \
controls.c readn.c getlistdelim.c \
unistr.c
mlmmj_unsub_SOURCES = mlmmj.c mlmmj-unsub.c writen.c mylocking.c \
- getlistaddr.c chomp.c subscriberfuncs.c random-int.c \
+ chomp.c subscriberfuncs.c random-int.c \
strgen.c print-version.c log_error.c mygetline.c \
prepstdreply.c memory.c controls.c readn.c \
getlistdelim.c unistr.c
mlmmj_bounce_SOURCES = mlmmj.c mlmmj-bounce.c print-version.c log_error.c \
subscriberfuncs.c strgen.c random-int.c writen.c \
- prepstdreply.c mygetline.c chomp.c getlistaddr.c \
+ prepstdreply.c mygetline.c chomp.c \
memory.c find_email_adr.c gethdrline.c readn.c \
getlistdelim.c unistr.c controls.c
mlmmj_maintd_SOURCES = mlmmj.c mlmmj-maintd.c print-version.c log_error.c mygetline.c \
strgen.c random-int.c chomp.c writen.c memory.c \
- send_digest.c getlistaddr.c dumpfd2fd.c \
+ send_digest.c dumpfd2fd.c \
mylocking.c log_oper.c readn.c getlistdelim.c \
prepstdreply.c gethdrline.c unistr.c controls.c
+++ /dev/null
-/* Copyright (C) 2002, 2003 Mads Martin Joergensen <mmj at mmj.dk>
- *
- * $Id$
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include "getlistaddr.h"
-#include "chomp.h"
-#include "log_error.h"
-#include "mygetline.h"
-#include "strgen.h"
-#include "memory.h"
-
-char *getlistaddr(const char *listdir)
-{
- char *tmpstr;
- int listnamefd;
-
- tmpstr = concatstr(2, listdir, "/control/listaddress");;
- if((listnamefd = open(tmpstr, O_RDONLY)) < 0) {
- log_error(LOG_ARGS, "Could not open '%s'", tmpstr);
- exit(EXIT_FAILURE);
- }
- myfree(tmpstr);
-
- tmpstr = mygetline(listnamefd);
-
- if(tmpstr == NULL){
- log_error(LOG_ARGS, "FATAL. Could not get listaddress "
- "in %s/control/listaddress", listdir);
- exit(EXIT_FAILURE);
- }
-
- if(strchr(tmpstr, '@') == NULL) {
- log_error(LOG_ARGS, "FATAL. No @ sign in listaddress");
- exit(EXIT_FAILURE);
- }
-
- chomp(tmpstr);
- close(listnamefd);
-
- return tmpstr;
-}
#include <err.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <string.h>
#include "memory.h"
#include "strgen.h"
#include "mlmmj.h"
-#include "getlistaddr.h"
#include "getlistdelim.h"
+#include "controls.h"
void
mlmmj_list_init(struct mlmmj_list *list)
return (false);
}
- list->addr = getlistaddr(list->dir);
+ list->addr = ctrlvalue(list, "listaddress");
+ if (list->addr == NULL || strchr(list->addr, '@') == NULL)
+ errx(EXIT_FAILURE, "Invalid list address");
list->delim = getlistdelim(list->dir);
if (!splitlistaddr(list->addr, &list->name, &list->fqdn)) {
errx(EXIT_FAILURE, "%s: is not a valid mailing list address,"