diff --git a/mail/raysfilter/Makefile b/mail/raysfilter/Makefile index 320462e9a7e9..f3b5de82425f 100644 --- a/mail/raysfilter/Makefile +++ b/mail/raysfilter/Makefile @@ -1,58 +1,58 @@ PORTNAME= raysfilter PORTVERSION= 1.14 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES= LOCAL/dinoex DISTNAME= rays-filter-${PORTVERSION} MAINTAINER= dinoex@FreeBSD.org COMMENT= Configurable filter for Sendmail Milter LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/GNU-public-licence.txt USES= shebangfix CTARGETS+= rays-filter -CFLAGS+= -Wall +CFLAGS+= -Wall -Wno-pointer-sign LIBS+= -lpthread -lmilter SHEBANG_FILES= mf-analyze ETCFILES= header-list.conf mail-filter.conf string-list.conf BINFILES= mf-reset mf-start mf-stop mf-archive mf-analyze mf-memory DOCSFILES= rays-filter.html install.html configure.html operate.html \ utilities.html GNU-public-licence.txt copyright.txt README OPTIONS_DEFINE= DOCS .include .include "${PORTSDIR}/mail/sendmail/bsd.milter.mk" .for i in ${CTARGETS} ${i}: cd ${WRKSRC} && \ ${CC} ${CFLAGS} ${LDFLAGS} -o ${i} ${i}.c ${LIBS} ${FLAGS} .endfor do-build: ${CTARGETS} do-install: ${INSTALL_PROGRAM} ${WRKSRC}/rays-filter \ ${STAGEDIR}${PREFIX}/libexec/rays-filter ${INSTALL_SCRIPT} ${WRKSRC}/mail-filter \ ${STAGEDIR}${PREFIX}/etc/rc.d/raysfilter.sh.sample .for i in ${BINFILES} ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/bin/ .endfor ${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail-filter .for i in ${ETCFILES} ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/etc/mail-filter/${i}-dist .endfor do-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} .for i in ${DOCSFILES} ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/ .endfor .include diff --git a/mail/raysfilter/files/patch-rays-filter.c b/mail/raysfilter/files/patch-rays-filter.c index 5cb780c442c3..b8ee7f3bf8b2 100644 --- a/mail/raysfilter/files/patch-rays-filter.c +++ b/mail/raysfilter/files/patch-rays-filter.c @@ -1,43 +1,115 @@ ---- rays-filter.c.orig Thu Mar 8 13:41:20 2001 -+++ rays-filter.c Wed Oct 27 15:38:15 2004 +--- rays-filter.c.orig 2001-03-08 12:41:20 UTC ++++ rays-filter.c @@ -65,8 +65,8 @@ #include #include #include +#include #include "libmilter/mfapi.h" -#include "libmilter/milter.h" #include "rays-filter.h" @@ -219,8 +219,10 @@ #ifndef TRUE #define FALSE 0 #define TRUE 1 +#ifndef __bool_true_false_are_defined typedef int bool; #endif +#endif /* Data Structures ** -@@ -326,6 +328,7 @@ +@@ -326,6 +328,7 @@ static int open_log_file(struct mlfiPriv *priv) syslog(LOG_INFO, "Cannot allocate memory for log file name\n"); else { +#if 0 if (mktemp(priv->mlfi_fname) == NULL) syslog(LOG_INFO, "Cannot make name for log file\n"); else -@@ -334,6 +337,11 @@ +@@ -334,6 +337,18 @@ static int open_log_file(struct mlfiPriv *priv) if (priv->mlfi_fname == NULL) syslog(LOG_INFO, "Cannot open log file\n"); } +#else -+ priv->mlfi_fp = mkstemp(priv->mlfi_fname); -+ if ( priv->mlfi_fp < 0 ) -+ syslog(LOG_INFO, "Cannot open new log file\n"); ++ int handle; ++ handle = mkstemp(priv->mlfi_fname); ++ if (handle < 0) ++ syslog(LOG_INFO, "Cannot make name for log file\n"); ++ else ++ { ++ priv->mlfi_fp = fdopen(handle, "w"); ++ if ( priv->mlfi_fp == NULL ) ++ syslog(LOG_INFO, "Cannot open log file\n"); ++ } +#endif } return 0; +@@ -489,7 +504,6 @@ sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char + */ + + char *headerf_uc = NULL; +- int i = 0; + + if (MLFIPRIV->mlfi_fp != NULL) + fprintf(MLFIPRIV->mlfi_fp, "%s: %s\r\n", headerf, headerv); +@@ -683,7 +697,7 @@ static int scan_header_block(SMFICTX *ctx, u_char *sta + ** found, checks the header contents against the 'bad_string_list' + */ + +- char *header, *end_of_header, *header_body; ++ char *header, *header_body; + char header_name[HEADER_NAME_SIZE] = "\0"; + size_t header_length = 0, name_length = 0, copy_length = 0; + int status = 0, is_end_of_headers = 0; +@@ -732,8 +746,6 @@ static int scan_buffer(SMFICTX *ctx) + u_char *header_block; + u_char *buffer = MLFIPRIV->buffer; + char *boundary = MLFIPRIV->boundary; +- size_t i = 0; +- size_t used_buffer_length; + int status = 0; + + /* used_buffer_length = strlen(buffer); +@@ -742,7 +754,7 @@ static int scan_buffer(SMFICTX *ctx) + */ + + header_block = buffer; +- while (header_block = (u_char *)strstr(header_block, boundary)) ++ while ((header_block = (u_char *)strstr(header_block, boundary))) + { + status |= scan_header_block(ctx, header_block); + header_block++; +@@ -776,9 +788,9 @@ static int overlap_chunk(SMFICTX *ctx, u_char *bodyp, + } + if (MLFIPRIV->mlfi_fp != NULL) + { +- fprintf(MLFIPRIV->mlfi_fp, "Overlap from previous: %7d\n", ++ fprintf(MLFIPRIV->mlfi_fp, "Overlap from previous: %7zu\n", + overlap_size); +- fprintf(MLFIPRIV->mlfi_fp, "Buffer contains: %7d\n", ++ fprintf(MLFIPRIV->mlfi_fp, "Buffer contains: %7zu\n", + strlen(MLFIPRIV->buffer)); + } + +@@ -802,7 +814,7 @@ static int store_overlap(SMFICTX *ctx, u_char *bodyp, + if (MLFIPRIV->mlfi_fp != NULL) + { + fprintf(MLFIPRIV->mlfi_fp, +- "Overlap to next chunk: %7d\n" ++ "Overlap to next chunk: %7zu\n" + "=====================================================\n", + strlen(MLFIPRIV->overlap)); + } +@@ -831,7 +843,7 @@ sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t + "\n=====================================================\n" + "Note inserted by " FILTER_SIGNATURE + "\n-----------------------------------------------------\n" +- "This chunk (bodylen): %7d\n", bodylen); ++ "This chunk (bodylen): %7zu\n", bodylen); + } + } +