? download.php?file_id=20020 Index: Makefile =================================================================== RCS file: /home/pcvs/ports/mail/spamass-milter/Makefile,v retrieving revision 1.41 diff -u -r1.41 Makefile --- Makefile 12 May 2010 14:11:40 -0000 1.41 +++ Makefile 13 May 2010 11:05:12 -0000 @@ -7,7 +7,7 @@ PORTNAME= spamass-milter PORTVERSION= 0.3.1 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SAVANNAH} MASTER_SITE_SUBDIR= spamass-milt Index: files/patch-spamass-milter.cpp =================================================================== RCS file: /home/pcvs/ports/mail/spamass-milter/files/patch-spamass-milter.cpp,v retrieving revision 1.12 diff -u -r1.12 patch-spamass-milter.cpp --- files/patch-spamass-milter.cpp 12 May 2010 14:11:41 -0000 1.12 +++ files/patch-spamass-milter.cpp 13 May 2010 11:05:12 -0000 @@ -1,6 +1,52 @@ ---- spamass-milter.cpp.orig 2006-03-23 22:41:36.000000000 +0100 -+++ spamass-milter.cpp 2010-05-12 12:05:02.000000000 +0200 -@@ -465,26 +465,11 @@ +--- 1_spamass-milter.cpp.orig 2010-05-13 13:03:40.000000000 +0200 ++++ spamass-milter.cpp 2010-05-13 13:03:57.000000000 +0200 +@@ -129,9 +129,11 @@ + + static const char Id[] = "$Id: spamass-milter.cpp,v 1.90 2006/03/23 21:41:36 dnelson Exp $"; + ++static char FilterName[] = "SpamAssassin"; ++ + struct smfiDesc smfilter = + { +- "SpamAssassin", // filter name ++ FilterName, // filter name + SMFI_VERSION, // version code -- leave untouched + SMFIF_ADDHDRS|SMFIF_CHGHDRS|SMFIF_CHGBODY, // flags + mlfi_connect, // info filter callback +@@ -361,7 +363,7 @@ + // }}} + + /* 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,12 +389,12 @@ + if (oldsize > 0) + { + debug(D_UORI, "u_or_i: changing"); +- smfi_chgheader(ctx, header, 1, newstring.size() > 0 ? ++ smfi_chgheader(ctx, const_cast(header), 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, const_cast(header), cstr); + } + } else + { +@@ -452,7 +454,7 @@ + if (do_reject) + { + debug(D_MISC, "Rejecting"); +- smfi_setreply(ctx, "550", "5.7.1", "Blocked by SpamAssassin"); ++ smfi_setreply(ctx, const_cast("550"), const_cast("5.7.1"), const_cast("Blocked by SpamAssassin")); + + + if (flag_bucket) +@@ -465,26 +467,11 @@ int rv; #endif @@ -30,7 +76,7 @@ #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ rv = pthread_mutex_lock(&popen_mutex); if (rv) -@@ -493,15 +478,17 @@ +@@ -493,15 +480,17 @@ abort(); } #endif @@ -51,7 +97,7 @@ } #if defined(__FreeBSD__) rv = pthread_mutex_unlock(&popen_mutex); -@@ -511,9 +498,6 @@ +@@ -511,9 +500,6 @@ abort(); } #endif @@ -61,7 +107,34 @@ } return SMFIS_REJECT; } -@@ -842,16 +826,12 @@ +@@ -531,7 +517,7 @@ + // time. Note, this may generate multiple X-Spam-Orig-To + // headers, but that's okay. + while( !assassin->recipients.empty()) { +- if ( smfi_addheader( ctx, "X-Spam-Orig-To", (char *)assassin->recipients.front().c_str()) != MI_SUCCESS ) { ++ if ( smfi_addheader( ctx, const_cast("X-Spam-Orig-To"), (char *)assassin->recipients.front().c_str()) != MI_SUCCESS ) { + throw string( "Failed to save recipient" ); + } + +@@ -774,7 +760,7 @@ + { + SpamAssassin* assassin; + struct context *sctx = (struct context *)smfi_getpriv(ctx); +- char *queueid; ++ const char *queueid; + + if (sctx == NULL) + { +@@ -801,7 +787,7 @@ + // remember the MAIL FROM address + assassin->set_from(string(envfrom[0])); + +- queueid=smfi_getsymval(ctx,"i"); ++ queueid=smfi_getsymval(ctx, const_cast("i")); + if (!queueid) + { + queueid="unknown"; +@@ -842,16 +828,12 @@ /* open a pipe to sendmail so we can do address expansion */ char buf[1024]; @@ -83,7 +156,7 @@ #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ rv = pthread_mutex_lock(&popen_mutex); -@@ -862,10 +842,10 @@ +@@ -862,10 +844,10 @@ } #endif @@ -96,7 +169,7 @@ assassin->expandedrcpt.push_back(envrcpt[0]); } else { -@@ -890,7 +870,8 @@ +@@ -890,7 +872,8 @@ assassin->expandedrcpt.push_back(p+7); } } @@ -106,7 +179,78 @@ } #if defined(__FreeBSD__) rv = pthread_mutex_unlock(&popen_mutex); -@@ -1002,9 +983,9 @@ +@@ -928,7 +911,7 @@ + char date[32]; + + /* RFC 822 date. */ +- macro_b = smfi_getsymval(ctx, "b"); ++ macro_b = smfi_getsymval(ctx, const_cast("b")); + if (!macro_b) + { + time_t tval; +@@ -939,7 +922,7 @@ + } + + /* queue ID */ +- macro_i = smfi_getsymval(ctx, "i"); ++ macro_i = smfi_getsymval(ctx, const_cast("i")); + if (!macro_i) + { + macro_i = "unknown"; +@@ -947,7 +930,7 @@ + } + + /* FQDN of this site */ +- macro_j = smfi_getsymval(ctx, "j"); ++ macro_j = smfi_getsymval(ctx, const_cast("j")); + if (!macro_j) + { + macro_j = "localhost"; +@@ -955,7 +938,7 @@ + } + + /* Protocol used to receive the message */ +- macro_r = smfi_getsymval(ctx, "r"); ++ macro_r = smfi_getsymval(ctx, const_cast("r")); + if (!macro_r) + { + macro_r = "SMTP"; +@@ -967,14 +950,14 @@ + fixed. Until that day, use the value remembered by + mlfi_helo() + */ +- macro_s = smfi_getsymval(ctx, "s"); ++ macro_s = smfi_getsymval(ctx, const_cast("s")); + if (!macro_s) + macro_s = sctx->helo; + if (!macro_s) + macro_s = "nohelo"; + + /* Sendmail binary version */ +- macro_v = smfi_getsymval(ctx, "v"); ++ macro_v = smfi_getsymval(ctx, const_cast("v")); + if (!macro_v) + { + macro_v = "8.13.0"; +@@ -982,7 +965,7 @@ + } + + /* Sendmail .cf version */ +- macro_Z = smfi_getsymval(ctx, "Z"); ++ macro_Z = smfi_getsymval(ctx, const_cast("Z")); + if (!macro_Z) + { + macro_Z = "8.13.0"; +@@ -990,7 +973,7 @@ + } + + /* Validated sending site's address */ +- macro__ = smfi_getsymval(ctx, "_"); ++ macro__ = smfi_getsymval(ctx, const_cast("_")); + if (!macro__) + { + macro__ = "unknown"; +@@ -1002,9 +985,9 @@ assassin->output((string) "Received: from "+macro_s+" ("+macro__+")\r\n\t"+ @@ -118,7 +262,38 @@ } else assassin->output((string)"X-Envelope-To: "+envrcpt[0]+"\r\n"); -@@ -2157,5 +2138,72 @@ +@@ -1378,10 +1361,10 @@ + // XXX arbitrary 100-argument max + int argc = 0; + char** argv = (char**) malloc(100*sizeof(char*)); +- argv[argc++] = SPAMC; ++ argv[argc++] = strdup(SPAMC); + if (flag_sniffuser) + { +- argv[argc++] = "-u"; ++ argv[argc++] = strdup("-u"); + if ( expandedrcpt.size() != 1 ) + { + // More (or less?) than one recipient, so we pass the default +@@ -1406,7 +1389,7 @@ + } + if (spamdhost) + { +- argv[argc++] = "-d"; ++ argv[argc++] = strdup("-d"); + argv[argc++] = spamdhost; + } + if (spamc_argc) +@@ -2148,7 +2131,7 @@ + } + + /* Log a message about missing milter macros, but only the first time */ +-void warnmacro(char *macro, char *scope) ++void warnmacro(const char *macro, const char *scope) + { + if (warnedmacro) + return; +@@ -2157,5 +2140,72 @@ warnedmacro = true; } Index: files/patch-spamass-milter.h =================================================================== RCS file: /home/pcvs/ports/mail/spamass-milter/files/patch-spamass-milter.h,v retrieving revision 1.2 diff -u -r1.2 patch-spamass-milter.h --- files/patch-spamass-milter.h 12 May 2010 14:11:41 -0000 1.2 +++ files/patch-spamass-milter.h 13 May 2010 11:05:12 -0000 @@ -1,9 +1,11 @@ ---- spamass-milter.h.orig 2010-05-12 11:58:14.000000000 +0200 -+++ spamass-milter.h 2010-05-12 12:05:27.000000000 +0200 -@@ -186,5 +186,6 @@ +--- 1_spamass-milter.h.orig 2010-05-13 13:03:46.000000000 +0200 ++++ spamass-milter.h 2010-05-13 13:03:57.000000000 +0200 +@@ -185,6 +185,7 @@ + int ip_in_networklist(struct in_addr ip, struct networklist *list); void parse_debuglevel(char* string); char *strlwr(char *str); - void warnmacro(char *macro, char *scope); +-void warnmacro(char *macro, char *scope); ++void warnmacro(const char *macro, const char *scope); +FILE *popenv(char *const argv[], const char *type, pid_t *pid); #endif