From f4a48de30e62eec0899802d7f96e2789f3d45c79 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 28 May 2007 19:51:32 +0000 Subject: [PATCH] citmail: completed the '-t' option (extract recipients from headers) in the sendmail compatibility interface --- citadel/Makefile.in | 4 ++-- citadel/citmail.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 328526401..78052251c 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -152,8 +152,8 @@ citserver: $(SERV_OBJS) aidepost: aidepost.o config.o $(CC) aidepost.o config.o citadel_dirs.o $(LDFLAGS) -o aidepost $(LIBS) -citmail: citmail.o citadel_dirs.o - $(CC) citmail.o citadel_dirs.o $(LDFLAGS) -o citmail $(LIBS) +citmail: citmail.o citadel_dirs.o tools.o + $(CC) citmail.o citadel_dirs.o tools.o $(LDFLAGS) -o citmail $(LIBS) # setup does need LIBS defined, because it uses network functions which are in -lsocket -lnsl on Solaris. setup: setup.o tools.o citadel_dirs.o diff --git a/citadel/citmail.c b/citadel/citmail.c index 63f75bd3d..5a2fd94d3 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -23,6 +23,7 @@ #include #include #include "citadel.h" +#include "tools.h" #ifndef HAVE_SNPRINTF #include "snprintf.h" #endif @@ -254,7 +255,21 @@ int main(int argc, char **argv) { } if (add_these_recipients) { - /* FIXME do something with them */ + int num_recp_on_this_line; + char this_recp[256]; + + num_recp_on_this_line = num_tokens(add_these_recipients, ','); + for (i=0; i 0) { + ++num_recipients; + recipients = realloc(recipients, + (num_recipients * sizeof (char *))); + recipients[num_recipients - 1] = strdup(this_recp); + } + } } } -- 2.39.2