diff --git a/mail/Makefile b/mail/Makefile index 56a206f9cd10..831177174393 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -519,6 +519,7 @@ SUBDIR += sympa SUBDIR += sympa-elixus SUBDIR += sympa5 + SUBDIR += synonym SUBDIR += t-prot SUBDIR += teapop SUBDIR += teapop-devel diff --git a/mail/synonym/Makefile b/mail/synonym/Makefile new file mode 100644 index 000000000000..0c311bdc0e6c --- /dev/null +++ b/mail/synonym/Makefile @@ -0,0 +1,59 @@ +# New ports collection makefile for: synonym +# Date created: 2005/11/16 +# Whom: Norikatsu Shigemura +# +# $FreeBSD$ +# + +PORTNAME= synonym +PORTVERSION= 0.4.3 +CATEGORIES= mail security +MASTER_SITES= http://www.modulo.ro/source/ +DISTNAME= ${PORTNAME}-0.4-3 + +MAINTAINER= nork@FreeBSD.org +COMMENT= Synonym, the email message archiver + +USE_GMAKE= yes +USE_GNOME= libxml2 + +WRKSRC= ${WRKDIR}/${PORTNAME}-0.4 +PORTDOCS= README license.txt +USE_RC_SUBR= synonym.sh + +MAKE_ENV+= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \ + PTHREAD_LIBS=${PTHREAD_LIBS} \ + DOCSDIR=${DOCSDIR} \ + RUNDIR=${RUNDIR} \ + SYNONYMOWN=${SYNONYMOWN} SYNONYMGRP=${SYNONYMGRP} +PLIST_SUB+= RUNDIR=${RUNDIR} +SUB_LIST+= RUNDIR=${RUNDIR} +SUB_FILES= pkg-message + +RUNDIR?= /var/run/synonym +SYNONYMOWN?= daemon +SYNONYMGRP?= daemon + +PKGMESSAGE= ${WRKDIR}/pkg-message + +post-extract: + @${RM} ${WRKSRC}/*.o + +.include + +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/synonym ${PREFIX}/sbin/ + @${INSTALL_DATA} ${WRKSRC}/synonym.conf ${PREFIX}/etc/synonym.conf-dist + @[ -f ${PREFIX}/etc/synonym.conf ] || \ + ${INSTALL_DATA} ${WRKSRC}/synonym.conf ${PREFIX}/etc/synonym.conf +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +.for f in ${PORTDOCS} + @${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/${f} +.endfor +.endif + @${MKDIR} ${RUNDIR} + @${CHOWN} ${SYNONYMOWN}:${SYNONYMGRP} ${RUNDIR} + @${CAT} ${PKGMESSAGE} + +.include diff --git a/mail/synonym/distinfo b/mail/synonym/distinfo new file mode 100644 index 000000000000..283d306e9c7c --- /dev/null +++ b/mail/synonym/distinfo @@ -0,0 +1,3 @@ +MD5 (synonym-0.4-3.tar.gz) = 10d06233988647725021862682a3d744 +SHA256 (synonym-0.4-3.tar.gz) = a94b7292612e2c46eb97559a549adf444792210303eec02cf0054b9055a43c7c +SIZE (synonym-0.4-3.tar.gz) = 473453 diff --git a/mail/synonym/files/patch-Makefile b/mail/synonym/files/patch-Makefile new file mode 100644 index 000000000000..de42e28f602b --- /dev/null +++ b/mail/synonym/files/patch-Makefile @@ -0,0 +1,78 @@ +--- Makefile.orig Mon Oct 25 22:53:12 2004 ++++ Makefile Thu Nov 17 15:03:31 2005 +@@ -3,18 +3,19 @@ + OSTYPE := $(shell uname -s) + + ifeq ($(OSTYPE), FreeBSD) +- CC=gcc -Wall -pthread +- SYNONYM_USER=daemon +- SYNONYM_GROUP=daemon +- INCLUDEPATH=-I/usr/local/include/libxml2 -I/usr/local/include +- LIBXML=-lxml2 +- +- SYNONYM_BINDIR=$(SYNONYM_BASEDIR)/usr/local/sbin +- SYNONYM_RUNDIR=$(SYNONYM_BASEDIR)/var/run/synonym +- SYNONYM_SCRIPTDIR=$(SYNONYM_BASEDIR)/usr/local/etc/rc.d ++ CFLAGS+=-Wall ${PTHREAD_CFLAGS} -DPREFIX='"${PREFIX}"' -DRUNDIR='"${RUNDIR}"' ++ CFLAGS+=-DSYNONYM_USER='"${SYNONYM_USER}"' -DSYNONYM_GROUP='"${SYNONYM_GROUP}"' ++ SYNONYM_USER=${SYNONYMOWN} ++ SYNONYM_GROUP=${SYNONYMGRP} ++ INCLUDEPATH=-I${LOCALBASE}/include/libxml2 -I${LOCALBASE}/include ++ LIBXML=-lxml2 ${PTHREAD_LIBS} ++ ++ SYNONYM_BINDIR=$(SYNONYM_BASEDIR)${PREFIX}/sbin ++ SYNONYM_RUNDIR=$(SYNONYM_BASEDIR)${RUNDIR} ++ SYNONYM_SCRIPTDIR=$(SYNONYM_BASEDIR)${PREFIX}/etc/rc.d + SYNONYM_SCRIPT_NAME=synonym.sh +- SYNONYM_CONFIGDIR=$(SYNONYM_BASEDIR)/etc +- SYNONYM_DOCDIR=$(SYNONYM_BASEDIR)/usr/local/share/doc/synonym ++ SYNONYM_CONFIGDIR=$(SYNONYM_BASEDIR)/${PREFIX}/etc ++ SYNONYM_DOCDIR=$(SYNONYM_BASEDIR)${DOCSDIR} + endif + + ifeq ($(OSTYPE), Linux) +@@ -77,35 +78,35 @@ + # This variable will be void if libsmutil.a does not exist (and hence is not needed) on the system + LIBSMUTIL := $(shell (echo "/lib" && echo "/usr/lib" && echo "/usr/local/lib" && if test -f /etc/ld.so.conf ; then cat /etc/ld.so.conf ; fi) | while read libpath && [ \( "$$FOUND" != "1" \) ]; do if [ -f $$libpath/libsmutil.a ] ; then echo "-lsmutil";FOUND=1 ; fi; done) + +-LIBPATH=-L/usr/local/lib ++LIBPATH=-L${LOCALBASE}/lib + + + + all: synonym + + synonym: synonym.o config.o filtering.o $(DISCLAIMER) +- $(CC) synonym.o $(DISCLAIMER) -lmilter config.o filtering.o $(PTHREAD) -o synonym $(LIBSMUTIL) $(LIBPATH) $(LIBXML) $(CCLIENTLIB) $(EXTRA_LIBS) ++ $(CC) ${CFLAGS} ${LDFLAGS} synonym.o $(DISCLAIMER) -lmilter config.o filtering.o $(PTHREAD) -o synonym $(LIBSMUTIL) $(LIBPATH) $(LIBXML) $(CCLIENTLIB) $(EXTRA_LIBS) + + synonym.o: synonym.c synonym.h config.h filtering.h +- $(CC) -c synonym.c $(DISCLAIMER_DEFINE) -o synonym.o $(INCLUDEPATH) ++ $(CC) $(CFLAGS) -c synonym.c $(DISCLAIMER_DEFINE) -o synonym.o $(INCLUDEPATH) + + config.o: config.c config.h synonym.h +- $(CC) -c config.c $(DISCLAIMER_DEFINE) -o config.o $(INCLUDEPATH) ++ $(CC) $(CFLAGS) -c config.c $(DISCLAIMER_DEFINE) -o config.o $(INCLUDEPATH) + + filtering.o: filtering.c filtering.h synonym.h +- $(CC) -c filtering.c $(DISCLAIMER_DEFINE) -o filtering.o $(INCLUDEPATH) ++ $(CC) $(CFLAGS) -c filtering.c $(DISCLAIMER_DEFINE) -o filtering.o $(INCLUDEPATH) + + html_parser.o: html_parser.c html_parser.h +- $(CC) -c html_parser.c -o html_parser.o $(INCLUDEPATH) ++ $(CC) $(CFLAGS) -c html_parser.c -o html_parser.o $(INCLUDEPATH) + + disclaimer.o: disclaimer.c disclaimer.h html_parser.o scan.o +- $(CC) -c disclaimer.c -o disclaimer.o $(INCLUDEPATH) $(CCLIENTINCLUDE) ++ $(CC) $(CFLAGS) -c disclaimer.c -o disclaimer.o $(INCLUDEPATH) $(CCLIENTINCLUDE) + + scan.o: scan.c +- $(CC) -c scan.c -o scan.o $(INCLUDEPATH) ++ $(CC) $(CFLAGS) -c scan.c -o scan.o $(INCLUDEPATH) + + body_parser.o: body_parser.c body_parser.h +- $(CC) -c body_parser.c -o body_parser.o $(INCLUDEPATH) $(CCLIENTINCLUDE) ++ $(CC) $(CFLAGS) -c body_parser.c -o body_parser.o $(INCLUDEPATH) $(CCLIENTINCLUDE) + + filtering.h: milter_data.h + @touch filtering.h diff --git a/mail/synonym/files/patch-synonym.c b/mail/synonym/files/patch-synonym.c new file mode 100644 index 000000000000..b91a743b45af --- /dev/null +++ b/mail/synonym/files/patch-synonym.c @@ -0,0 +1,14 @@ +--- synonym.c.orig Mon Jan 19 21:20:30 2004 ++++ synonym.c Thu Nov 17 15:27:10 2005 +@@ -512,11 +512,6 @@ + } + if(delete_email) + return SMFIS_DISCARD; +- if(add_copy) +- { +- copyto_list[strlen(copyto_list)-2]='\0'; +- smfi_addheader(ctx, "X-Synonym", copyto_list); +- } + return SMFIS_CONTINUE; + + } diff --git a/mail/synonym/files/patch-synonym.h b/mail/synonym/files/patch-synonym.h new file mode 100644 index 000000000000..8aaa42c9bc4a --- /dev/null +++ b/mail/synonym/files/patch-synonym.h @@ -0,0 +1,17 @@ +--- synonym.h.orig Mon Oct 25 22:53:09 2004 ++++ synonym.h Thu Nov 17 15:04:36 2005 +@@ -56,10 +56,10 @@ + /* + * Defaults + */ +-#define PIDFILE "/var/run/synonym/synonym.pid" +-#define DEFAULT_SOCKET "local:/var/run/synonym/synonym.sock" +-#define DEFAULT_CONFIG "/etc/synonym.conf" +-#define DEFAULT_USER "mail" ++#define PIDFILE RUNDIR "/synonym.pid" ++#define DEFAULT_SOCKET "local:" RUNDIR "/synonym.sock" ++#define DEFAULT_CONFIG PREFIX "/etc/synonym.conf" ++#define DEFAULT_USER SYNONYM_USER + #define DEFAULT_LOGLEVEL LOG_ERR + #define DEFAULT_LOGFACILITY LOG_MAIL + #define DEFAULT_LOGLEVEL_STRING "LOG_ERR" diff --git a/mail/synonym/files/pkg-message.in b/mail/synonym/files/pkg-message.in new file mode 100644 index 000000000000..0f2abc1da7d3 --- /dev/null +++ b/mail/synonym/files/pkg-message.in @@ -0,0 +1,33 @@ +================================================================ +** PLEASE SETUP YOUR /etc/rc.conf *** +If you want to use synonym, please add following line: + +synonym_enable="YES" + +If you don't want to use synonym, you can set synonym_enable="NO". + + +** PLEASE SETUP YOUR /etc/mail/sendmail.mc *** +If you want to use synonym, please add following line: + +INPUT_MAIL_FILTER(`Synonym', `S=local:%%RUNDIR%%/synonym.sock, T=C:10m;S:1s;R:1s;E:5m') + + +** PLEASE SETUP YOUR %%PREFIX%%/etc/synonym.conf *** + +If you want to archive all email message, please set following +lines: + + + + +
From
+ .* +
+ + Copy +
foo@example.com
+
+
+
+ diff --git a/mail/synonym/files/synonym.sh.in b/mail/synonym/files/synonym.sh.in new file mode 100644 index 000000000000..8e05007f094b --- /dev/null +++ b/mail/synonym/files/synonym.sh.in @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: synonym +# REQUIRE: DAEMON +# BEFORE: mail +# KEYWORD: FreeBSD shutdown +# +# Define these synonym_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/synonym +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +synonym_enable=${synonym_enable-"NO"} +synonym_pidfile=${synonym_pidfile-"%%RUNDIR%%/synonym.pid"} +synonym_conffile=${synonym_conffile-"%%PREFIX%%/etc/synonym.conf"} + +. %%RC_SUBR%% + +name=synonym +rcvar=`set_rcvar` +command=%%PREFIX%%/sbin/${name} + +load_rc_config ${name} + +case "${synonym_flags}" in +*-c\ *) + echo "Warning: \$synonym_flags includes -c option." \ + "Please use \$synonym_conffile instead." + ;; +*) + synonym_flags="-c ${synonym_conffile} ${synonym_flags:--d}" ;; +esac + +pidfile=${synonym_pidfile} +required_files=${synonym_conffile} + +run_rc_command "$1" diff --git a/mail/synonym/pkg-descr b/mail/synonym/pkg-descr new file mode 100644 index 000000000000..c66ededfd4e8 --- /dev/null +++ b/mail/synonym/pkg-descr @@ -0,0 +1,7 @@ +Synonym is a product that allows a company to easily +archive all email messages going in and out. It can +copy mail messages, delete, reject or add a text +and/or html signature based on a XML based configuration +file listing regular expression rules. + +WWW: http://www.modulo.ro/synonym/ diff --git a/mail/synonym/pkg-plist b/mail/synonym/pkg-plist new file mode 100644 index 000000000000..62b2b3526b74 --- /dev/null +++ b/mail/synonym/pkg-plist @@ -0,0 +1,6 @@ +sbin/synonym +@unexec if cmp -s %D/etc/synonym.conf %D/etc/synonym.conf-dist; then rm -f %D/etc/synonym.conf; fi +etc/synonym.conf-dist +@exec [ ! -f %B/synonym.conf ] && cp -p %B/%f %B/synonym.conf +@exec mkdir -p %%RUNDIR%% +@unexec rmdir %%RUNDIR%% 2> /dev/null || true