Index: ossp-pkg/petidomo/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Makefile.in,v rcsdiff -q -kk '-r1.21' '-r1.22' -u '/v/ossp/cvs/ossp-pkg/petidomo/Makefile.in,v' 2>/dev/null --- Makefile.in 2001/01/11 14:11:33 1.21 +++ Makefile.in 2001/01/15 16:29:11 1.22 @@ -9,14 +9,6 @@ datadir = @datadir@/petidomo sysconfdir = @sysconfdir@ localstatedir = @localstatedir@/petidomo -# delete me -#sharedstatedir = @sharedstatedir@ -#sbindir = @sbindir@ -#libdir = @libdir@/petidomo -#infodir = @infodir@ -#mandir = @mandir@ -#includedir = @includedir@ -# delete me CC = @CC@ AR = ar @@ -27,13 +19,15 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" -DLIBEXECDIR=\"$(libexecdir)\" \ - -DDATADIR=\"$(datadir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" + -DDATADIR=\"$(datadir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DBINDIR=\"$(bindir)\" LDFLAGS = @LDFLAGS@ OBJS = acl.o archive.o authen.o config.o generate_cookie.o \ filter.o handleacl.o help.o hermes.o index.o io.o listserv.o \ mailer.o members.o parsearray.o password.o rfcparse.o \ - subscribe.o tool.o unsubscribe.o main.o + subscribe.o tool.o unsubscribe.o main.o queue_command.o \ + queue_posting.o LIBS = librfc822/librfc822.a libmpools/libmpools.a liblists/liblists.a libargv/libargv.a \ libconfigfile/libconfigfile.a libtext/libtext.a @@ -67,7 +61,8 @@ install: petidomo @if [ ! -d $(bindir) ]; then $(INSTALL) -d $(bindir); fi @if [ ! -d $(sysconfdir) ]; then $(INSTALL) -d $(sysconfdir); fi - @if [ ! -d $(localstatedir) ]; then $(INSTALL) -d $(localstatedir); fi + @if [ ! -d $(localstatedir)/lists ]; then $(INSTALL) -d $(localstatedir)/lists; fi + @if [ ! -d $(localstatedir)/ack_queue ]; then $(INSTALL) -d $(localstatedir)/ack_queue; fi @if [ ! -d $(datadir) ]; then $(INSTALL) -d $(datadir); fi @if [ ! -d $(libexecdir) ]; then $(INSTALL) -d $(libexecdir); fi $(INSTALL) -s -m 555 petidomo $(bindir) Index: ossp-pkg/petidomo/config.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v' 2>/dev/null --- config.c 2001/01/11 14:17:53 1.11 +++ config.c 2001/01/15 16:29:11 1.12 @@ -40,7 +40,8 @@ static char* help_file = DATADIR "/petidomo.conf"; static char* acl_file = SYSCONFDIR "/petidomo.acl"; static char* index_file = LOCALSTATEDIR "/index"; -static char* list_dir = LOCALSTATEDIR; +static char* list_dir = LOCALSTATEDIR "/lists"; +static char* ack_queue_dir = LOCALSTATEDIR "/ack_queue"; int InitPetidomo(const char* masterconfig_path) { @@ -58,6 +59,7 @@ { "Acl_File", CF_STRING, &acl_file }, { "Index_File", CF_STRING, &index_file }, { "List_Directory", CF_STRING, &list_dir }, + { "Ack_Queue_Directory", CF_STRING, &ack_queue_dir }, { NULL, 0, NULL} }; @@ -116,6 +118,7 @@ MasterConfig->acl_file = acl_file; MasterConfig->index_file = index_file; MasterConfig->list_dir = list_dir; + MasterConfig->ack_queue_dir = ack_queue_dir; return 0; } Index: ossp-pkg/petidomo/petidomo.h RCS File: /v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v' 2>/dev/null --- petidomo.h 2001/01/11 14:17:53 1.7 +++ petidomo.h 2001/01/15 16:29:11 1.8 @@ -57,6 +57,7 @@ char * mta; char * mta_options; char * list_dir; + char * ack_queue_dir; char * help_file; char * acl_file; char * index_file; @@ -176,7 +177,7 @@ /********** listserv.c **********/ -int listserv_main(char *incoming_mail, char *default_list); +int listserv_main(char *incoming_mail, char *default_list, char); /********** mailer.c **********/ @@ -206,7 +207,7 @@ /********** hermes.c **********/ -int hermes_main(char *incoming_mail, const char *listname); +int hermes_main(char *incoming_mail, const char *listname, char); /********** subscribe.c **********/ @@ -225,4 +226,12 @@ char* generate_cookie(const char*); +/********** queue_posting.c **********/ + +void queue_posting(const struct Mail* mail, const char* listname); + +/********** queue_command.c **********/ + +void queue_command(const struct Mail* mail, const char* command); + #endif /* !defined(__PETIDOMO_H__) */ Index: ossp-pkg/petidomo/queue_command.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Attic/queue_command.c,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/petidomo/Attic/queue_command.c,v' | diff -u /dev/null - -L'ossp-pkg/petidomo/queue_command.c' 2>/dev/null --- ossp-pkg/petidomo/queue_command.c +++ - 2024-05-14 10:11:40.403908120 +0200 @@ -0,0 +1,57 @@ +/* + $Source$ + $Revision$ + + Copyright (C) 2000 by Peter Simons . + + This file is part of OpenPetidomo. + + OpenPetidomo is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + OpenPetidomo is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. +*/ + +#include +#include +#include "libtext/text.h" +#include "petidomo.h" + +void queue_command(const struct Mail* mail, const char* command) + { + const struct PD_Config * MasterConfig = getMasterConfig(); + char* buffer; + char* cookie; + FILE* fh; + + cookie = generate_cookie(mail->Header); + buffer = text_easy_sprintf("%s/%s", MasterConfig->ack_queue_dir, cookie); + fh = fopen(buffer, "w"); + if (fh == NULL) + { + syslog(LOG_ERR, "Opening ack spool file \"%s\" failed: %m", buffer); + exit(1); + } + fprintf(fh, "#! /bin/sh\n"); + fprintf(fh, "\n"); + fprintf(fh, BINDIR "/petidomo --mode=listserv --approved <<[end-of-mail-marker]\n"); + fprintf(fh, "Sender: %s\n", mail->Envelope); + fprintf(fh, "From: %s\n", mail->From); + if (mail->Reply_To) + fprintf(fh, "Reply-To: %s\n", mail->Reply_To); + if (mail->Message_Id) + fprintf(fh, "Message-Id: %s\n", mail->Message_Id); + if (mail->Approve) + fprintf(fh, "Approve: %s\n", mail->Approve); + fprintf(fh, "\n"); + fprintf(fh, "%s\n", command); + fprintf(fh, "[end-of-mail-marker]\n"); + fclose(fh); + chmod(buffer, 0755); + free(buffer); + } Index: ossp-pkg/petidomo/queue_posting.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Attic/queue_posting.c,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/petidomo/Attic/queue_posting.c,v' | diff -u /dev/null - -L'ossp-pkg/petidomo/queue_posting.c' 2>/dev/null --- ossp-pkg/petidomo/queue_posting.c +++ - 2024-05-14 10:11:40.406471145 +0200 @@ -0,0 +1,49 @@ +/* + $Source$ + $Revision$ + + Copyright (C) 2000 by Peter Simons . + + This file is part of OpenPetidomo. + + OpenPetidomo is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + OpenPetidomo is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. +*/ + +#include +#include +#include "libtext/text.h" +#include "petidomo.h" + +void queue_posting(const struct Mail* mail, const char* listname) + { + const struct PD_Config * MasterConfig = getMasterConfig(); + char* buffer; + char* cookie; + FILE* fh; + + cookie = generate_cookie(mail->Header); + buffer = text_easy_sprintf("%s/%s", MasterConfig->ack_queue_dir, cookie); + fh = fopen(buffer, "w"); + if (fh == NULL) + { + syslog(LOG_ERR, "Opening ack spool file \"%s\" failed: %m", buffer); + exit(1); + } + fprintf(fh, "#! /bin/sh\n"); + fprintf(fh, "\n"); + fprintf(fh, BINDIR "/petidomo --mode=deliver --listname=%s --approved <<[end-of-mail-marker]\n", listname); + fprintf(fh, "%s\n", mail->Header); + fprintf(fh, "%s", mail->Body); + fprintf(fh, "[end-of-mail-marker]\n"); + fclose(fh); + chmod(buffer, 0755); + free(buffer); + }