mylocking.c log_oper.c readn.c \
prepstdreply.c gethdrline.c unistr.c controls.c \
send_mails.c checkwait_smtpreply.c \
- mail-functions.c init_sockfd.c
+ mail-functions.c init_sockfd.c subscriberfuncs.c
mlmmj_list_SOURCES = mlmmj-list.c strgen.c print-version.c memory.c \
log_error.c random-int.c readn.c subscriberfuncs.c
#include "log_oper.h"
#include "utils.h"
#include "send_mails.h"
+#include "subscriberfuncs.h"
static void print_help(const char *prg)
{
char *probefile, *address, *a, *firstbounce, *bouncedata;
struct dirent *dp;
struct stat st;
- pid_t pid, childpid;
- int status, fd;
+ int fd;
time_t bouncetime, t, bouncelife = 0;
const char *errstr;
}
*a = '@';
- childpid = fork();
-
- if(childpid < 0) {
- log_error(LOG_ARGS, "Could not fork");
- myfree(address);
- myfree(bouncedata);
- continue;
- }
-
- if(childpid > 0) {
- log_oper(list->dir, OPLOGFNAME, "mlmmj-maintd: %s"
- " unsubscribed due to bouncing since"
- " %s", address, bouncedata);
- myfree(address);
- myfree(bouncedata);
- do /* Parent waits for the child */
- pid = waitpid(childpid, &status, 0);
- while(pid == -1 && errno == EINTR);
- unlink(dp->d_name);
- a = concatstr(2, dp->d_name, ".lastmsg");
- unlink(a);
- myfree(a);
- } else {
- execlp(mlmmjunsub, mlmmjunsub,
- "-L", list->dir,
- "-b", "-a", address, (char *)NULL);
- log_error(LOG_ARGS, "Could not execlp %s",
- mlmmjunsub);
- /* This is the child. Exit on failure. */
- exit(EXIT_FAILURE);
- }
+ unsubscribe(list, address, SUB_ALL, SUB_BOUNCING);
+ log_oper(list->dir, OPLOGFNAME, "mlmmj-maintd: %s"
+ " unsubscribed due to bouncing since"
+ " %s", address, bouncedata);
+ myfree(address);
+ myfree(bouncedata);
+ unlink(dp->d_name);
+ a = concatstr(2, dp->d_name, ".lastmsg");
+ unlink(a);
+ myfree(a);
}
closedir(bouncedir);