head 1.2; access; symbols PETIDOMO_4_0b6:1.2 PETIDOMO_4_0b5:1.2 PETIDOMO_4_0b4:1.2 PETIDOMO_4_0b3:1.2 BEFORETHL:1.2; locks; strict; comment @ * @; 1.2 date 2001.01.20.13.52.41; author rse; state Exp; branches; next 1.1; 1.1 date 2001.01.20.13.42.01; author simons; state Exp; branches; next ; desc @@ 1.2 log @First bunch of cosmetic adjustments to text messages. Additionally --masterconf=FILE is also passed through to files created in acknowledge directory. @ text @/* $Source: /e/ossp/cvs/ossp-pkg/petidomo/queue-command.c,v $ $Revision: 1.1 $ Copyright (C) 2000 by Peter Simons . This file is part of Petidomo. Petidomo 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. Petidomo 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 #include #include "libtext/text.h" #include "petidomo.h" char* 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: %s", buffer, strerror(errno)); exit(1); } fprintf(fh, "#!/bin/sh\n"); fprintf(fh, "%s \\\n--masterconf=%s \\\n--mode=listserv --approved \\\n<<[end-of-%s-marker]\n", who_am_i, masterconfig_path, cookie); 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-%s-marker]\n", cookie); fclose(fh); chmod(buffer, 0755); free(buffer); return cookie; } @ 1.1 log @Underscores in file names suck, because you need an extra key-press to type them compared to the hyphen. For this reason (and for consistency) I corrected this horrible, horrible mistake of the past and renamed those files. @ text @d2 2 a3 2 $Source: /e/ossp/cvs/ossp-pkg/petidomo/queue_command.c,v $ $Revision: 1.6 $ d42 2 a43 3 fprintf(fh, "#! /bin/sh\n"); fprintf(fh, "\n"); fprintf(fh, "%s --mode=listserv --approved <<[end-of-%s-marker]\n", who_am_i, cookie); @