X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=spamass-milter.cpp;h=36988923e4b806d932193703a3a4670ef7487a63;hb=1a13de003b1a90d0058ed32d639617a232c769d5;hp=581829358bd8cdeb1f053e0a6ad14a3c30f757d5;hpb=b9df85a994d2be845dc3f7c76920fae684c1b606;p=deb_pkgs%2Fspamass-milter.git diff --git a/spamass-milter.cpp b/spamass-milter.cpp index 5818293..3698892 100644 --- a/spamass-milter.cpp +++ b/spamass-milter.cpp @@ -1,6 +1,6 @@ // // -// $Id: spamass-milter.cpp,v 1.90 2006/03/23 21:41:36 dnelson Exp $ +// $Id: spamass-milter.cpp,v 1.94 2011/02/14 21:50:53 dnelson Exp $ // // SpamAss-Milter // - a rather trivial SpamAssassin Sendmail Milter plugin @@ -127,7 +127,7 @@ int daemon(int nochdir, int noclose); // }}} -static const char Id[] = "$Id: spamass-milter.cpp,v 1.90 2006/03/23 21:41:36 dnelson Exp $"; +static const char Id[] = "$Id: spamass-milter.cpp,v 1.94 2011/02/14 21:50:53 dnelson Exp $"; struct smfiDesc smfilter = { @@ -183,7 +183,6 @@ main(int argc, char* argv[]) bool dofork = false; char *pidfilename = NULL; FILE *pidfile = NULL; - struct sigaction children_sigaction; #ifdef HAVE_VERBOSE_TERMINATE_HANDLER std::set_terminate (__gnu_cxx::__verbose_terminate_handler); @@ -364,7 +363,7 @@ main(int argc, char* argv[]) // }}} /* Update a header if SA changes it, or add it if it is new. */ -void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, char *header ) +void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, const char *header ) { string::size_type eoh1 = assassin->d().find("\n\n"); string::size_type eoh2 = assassin->d().find("\n\r\n"); @@ -387,15 +386,16 @@ void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_ { /* change if old one was present, append if non-null */ char* cstr = const_cast(newstring.c_str()); + char* hstr = const_cast(header); if (oldsize > 0) { debug(D_UORI, "u_or_i: changing"); - smfi_chgheader(ctx, header, 1, newstring.size() > 0 ? + smfi_chgheader(ctx, hstr, 1, newstring.size() > 0 ? cstr : NULL ); } else if (newstring.size() > 0) { debug(D_UORI, "u_or_i: inserting"); - smfi_addheader(ctx, header, cstr); + smfi_addheader(ctx, hstr, cstr); } } else { @@ -817,9 +817,6 @@ mlfi_envrcpt(SMFICTX* ctx, char** envrcpt) struct context *sctx = (struct context*)smfi_getpriv(ctx); SpamAssassin* assassin = sctx->assassin; FILE *p; -#if defined(__FreeBSD__) - int rv; -#endif debug(D_FUNC, "mlfi_envrcpt: enter");