diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /mail-filter/spamass-milter | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'mail-filter/spamass-milter')
-rw-r--r-- | mail-filter/spamass-milter/Manifest | 1 | ||||
-rw-r--r-- | mail-filter/spamass-milter/files/README.gentoo | 52 | ||||
-rw-r--r-- | mail-filter/spamass-milter/files/spamass-milter-auth_users.patch | 92 | ||||
-rw-r--r-- | mail-filter/spamass-milter/files/spamass-milter.conf3 | 30 | ||||
-rw-r--r-- | mail-filter/spamass-milter/files/spamass-milter.rc4 | 55 | ||||
-rw-r--r-- | mail-filter/spamass-milter/metadata.xml | 5 | ||||
-rw-r--r-- | mail-filter/spamass-milter/spamass-milter-0.3.2.ebuild | 42 |
7 files changed, 277 insertions, 0 deletions
diff --git a/mail-filter/spamass-milter/Manifest b/mail-filter/spamass-milter/Manifest new file mode 100644 index 000000000000..8472bbd8a3e1 --- /dev/null +++ b/mail-filter/spamass-milter/Manifest @@ -0,0 +1 @@ +DIST spamass-milter-0.3.2.tar.bz2 125350 SHA256 ba2eb8c9e4c50307ffae38bb06444b9830695e742e9fd8c9da40953e7e1d830b SHA512 19279c53c8af738fbdd796e3aa382754474fc8c2ed17a3f857906d61740aefbd30f4759952fc1aaeff31af492fa8782363cbaac8ea1f389b4e2c1237226086d8 WHIRLPOOL e7e9df528b12a1b9b29f1ace8c2d0e7398806aac0ca148ee74f68fa0c2a86240578e36e8d20a21279159ccbef3f651ec27eb2286351f0396014ad4fce5fb6c87 diff --git a/mail-filter/spamass-milter/files/README.gentoo b/mail-filter/spamass-milter/files/README.gentoo new file mode 100644 index 000000000000..49035c0ac5a5 --- /dev/null +++ b/mail-filter/spamass-milter/files/README.gentoo @@ -0,0 +1,52 @@ +Simple install instructions by raker @ g.o +updates by gustavoz +updates by SteveB +--------------------------------------------------------------- + +For Sendmail: +------------- +Add these lines in /etc/mail/sendmail.mc before MAILER(local): +INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m')dnl +define(`confMILTER_MACROS_CONNECT',`b, j, _, {daemon_name}, {if_name}, {if_addr}')dnl +define(`confMILTER_MACROS_ENVRCPT',`r, v, Z') + +When that's done run this command: + m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf + +Restart associated services: + /etc/init.d/sendmail stop + /etc/init.d/spamass-milter start + /etc/init.d/sendmail start + +OPTIONAL: To run it automatically after booting: + rc-update add spamass-milter default + rc-update add sendmail default + + +For Postfix >= 2.3.0 and < 2.4.0: +--------------------------------- +Add those lines to /etc/postfix/main.cf: +smtpd_milters = unix:/var/run/milter/spamass-milter.sock +milter_end_of_data_macros = b i j _ {daemon_name} {if_name} {if_addr} {mail_addr} +milter_default_action = accept + +Change in /etc/conf.d/spamass-milter the socket group owner to mail: +SOCKET_GROUP="mail" + +Change in /etc/conf.d/spamass-milter the options for spamass-milter to include "-m": +OPTIONS="${OPTIONS} -m" + +Restart associated services: + /etc/init.d/postfix stop + /etc/init.d/spamass-milter start + /etc/init.d/postfix start + +OPTIONAL: To run it automatically after booting: + rc-update add spamass-milter default + rc-update add postfix default + + +For Postfix >= 2.4.0: +--------------------- +Same settings as for Postfix >= 2.3.0 (see above) but you can now use the option "-m" +in /etc/conf.d/spamass-milter. diff --git a/mail-filter/spamass-milter/files/spamass-milter-auth_users.patch b/mail-filter/spamass-milter/files/spamass-milter-auth_users.patch new file mode 100644 index 000000000000..8bfc24e4306f --- /dev/null +++ b/mail-filter/spamass-milter/files/spamass-milter-auth_users.patch @@ -0,0 +1,92 @@ +Based on the debian patch: +http://patch-tracker.debian.org/patch/series/view/spamass-milter/0.3.1-10/10_dont_handle_authenticated_users.diff + +--- spamass-milter.cpp 2011-06-08 11:56:33.000000000 +0000 ++++ spamass-milter.cpp 2011-06-08 12:04:41.000000000 +0000 +@@ -170,6 +170,7 @@ + bool flag_full_email = false; /* pass full email address to spamc */ + bool flag_expand = false; /* alias/virtusertable expansion */ + bool warnedmacro = false; /* have we logged that we couldn't fetch a macro? */ ++bool ignore_authenticated_senders = false; + + #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ + static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; +@@ -181,7 +182,7 @@ + main(int argc, char* argv[]) + { + int c, err = 0; +- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; ++ const char *args = "fd:mMp:P:r:u:D:i:Ib:B:e:x"; + char *sock = NULL; + bool dofork = false; + char *pidfilename = NULL; +@@ -213,6 +214,10 @@ + debug(D_MISC, "Parsing ignore list"); + parse_networklist(optarg, &ignorenets); + break; ++ case 'I': ++ debug(D_MISC, "Ignore authenticated senders"); ++ ignore_authenticated_senders = true; ++ break; + case 'm': + dontmodifyspam = true; + smfilter.xxfi_flags &= ~SMFIF_CHGBODY; +@@ -280,7 +285,7 @@ + cout << PACKAGE_NAME << " - Version " << PACKAGE_VERSION << endl; + cout << "SpamAssassin Sendmail Milter Plugin" << endl; + cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl; +- cout << " [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl; ++ cout << " [-e defaultdomain] [-f] [-i networks] [-I] [-m] [-M]" << endl; + cout << " [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl; + cout << " [-- spamc args ]" << endl; + cout << " -p socket: path to create socket" << endl; +@@ -294,6 +299,7 @@ + cout << " -f: fork into background" << endl; + cout << " -i: skip (ignore) checks from these IPs or netblocks" << endl; + cout << " example: -i 192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0" << endl; ++ cout << " -I: skip (ignore) checks if sender is authenticated" << endl; + cout << " -m: don't modify body, Content-type: or Subject:" << endl; + cout << " -M: don't modify the message at all" << endl; + cout << " -P pidfile: Put processid in pidfile" << endl; +@@ -783,6 +789,22 @@ + } + /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */ + ++ if (ignore_authenticated_senders) ++ { ++ char *auth_authen; ++ ++ auth_authen = smfi_getsymval(ctx, "{auth_authen}"); ++ debug(D_MISC, "auth_authen=%s", auth_authen ?: "<unauthenticated>"); ++ ++ if (auth_authen) ++ { ++ debug(D_MISC, "sender authenticated (%s) - accepting message", ++ auth_authen); ++ debug(D_FUNC, "mlfi_envfrom: exit ignore"); ++ return SMFIS_ACCEPT; ++ } ++ } ++ + debug(D_FUNC, "mlfi_envfrom: enter"); + try { + // launch new SpamAssassin +--- spamass-milter.1.in 2011-06-08 12:05:35.000000000 +0000 ++++ spamass-milter.1.in 2011-06-08 12:06:57.000000000 +0000 +@@ -14,6 +14,7 @@ + .Op Fl e Ar defaultdomain + .Op Fl f + .Op Fl i Ar networks ++.Op Fl I + .Op Fl m + .Op Fl M + .Op Fl P Ar pidfile +@@ -119,6 +120,8 @@ + flags will append to the list. + For example, if you list all your internal networks, no outgoing emails + will be filtered. ++.It Fl I ++Ignores messages if the sender has authenticated via SMTP AUTH. + .It Fl m + Disables modification of the + .Ql Subject: diff --git a/mail-filter/spamass-milter/files/spamass-milter.conf3 b/mail-filter/spamass-milter/files/spamass-milter.conf3 new file mode 100644 index 000000000000..33ff5932a61b --- /dev/null +++ b/mail-filter/spamass-milter/files/spamass-milter.conf3 @@ -0,0 +1,30 @@ +# Copyright 1999-2006 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +DAEMON=/usr/sbin/spamass-milter +SOCKET=/var/run/milter/spamass-milter.sock +PIDFILE=/var/run/milter/spamass-milter.pid + +# User owning the socket +SOCKET_USER="milter" + +# Group owning the socket +# Note: Change this to mail if you run Postfix +SOCKET_GROUP="milter" + +# Permission for the socket +SOCKET_MODE="664" + +# spamass-milter options +OPTIONS="" + +# Example: Reject mails above score 20 +#OPTIONS="${OPTIONS} -r 20" + +# Example: Do not modify mail body +# NOTE: This needs to be enabled if you use Postfix >= 2.3.0 and < 2.4.0 +#OPTIONS="${OPTIONS} -m" + +# Example: Pass the remaining flags to spamc +#OPTIONS="${OPTIONS} -- --headers --username spamc" diff --git a/mail-filter/spamass-milter/files/spamass-milter.rc4 b/mail-filter/spamass-milter/files/spamass-milter.rc4 new file mode 100644 index 000000000000..a2c33d849802 --- /dev/null +++ b/mail-filter/spamass-milter/files/spamass-milter.rc4 @@ -0,0 +1,55 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + need net spamd + use logger + before mta +} + +piddir=${PIDFILE%/*} +socketdir=${SOCKET%/*} + +checkconfig() { + if [ ! -d ${piddir:=/var/run/milter} ]; then + checkpath -q -d -o milter:milter -m 0755 ${piddir} || return 1 + fi + if [ ! -d ${socketdir:=/var/run/milter} ]; then + checkpath -q -d -o ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} \ + -m 0755 ${socketdir} || return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting spamass-milter" + start-stop-daemon --start --quiet --pidfile ${PIDFILE} -u ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} \ + --exec ${DAEMON} -- -P ${PIDFILE} -p ${SOCKET} -f ${OPTIONS} + eend $? "Failed to start ${DAEMON}" + spamass_timeout=0 + while [ $spamass_timeout -le 20 ] + do + if [ ! -S "${SOCKET}" -o ! -r "${SOCKET}" ] + then + sleep 1 + spamass_timeout=$(( $spamass_timeout+1 )) + else + break + fi + done + echo $spamass_timeout + chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${SOCKET} 1>/dev/null 2>&1 + chmod ${SOCKET_MODE:-664} ${SOCKET} 1>/dev/null 2>&1 +} + +stop() { + ebegin "Stopping spamass-milter" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} && + { + sleep 5 + rm -f ${SOCKET} + } + eend $? "Failed to stop ${DAEMON}" +} diff --git a/mail-filter/spamass-milter/metadata.xml b/mail-filter/spamass-milter/metadata.xml new file mode 100644 index 000000000000..940fde8f70ce --- /dev/null +++ b/mail-filter/spamass-milter/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>net-mail</herd> +</pkgmetadata> diff --git a/mail-filter/spamass-milter/spamass-milter-0.3.2.ebuild b/mail-filter/spamass-milter/spamass-milter-0.3.2.ebuild new file mode 100644 index 000000000000..c3dad572e0dd --- /dev/null +++ b/mail-filter/spamass-milter/spamass-milter-0.3.2.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=4 + +inherit eutils user + +IUSE="" + +DESCRIPTION="A milter for SpamAssassin" +HOMEPAGE="http://savannah.nongnu.org/projects/spamass-milt/" +SRC_URI="http://savannah.nongnu.org/download/spamass-milt/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~ppc x86" + +DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) + >=mail-filter/spamassassin-3.1.0" +RDEPEND="${DEPEND}" + +pkg_setup() { + enewgroup milter + enewuser milter -1 -1 /var/lib/milter milter +} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-auth_users.patch +} + +src_install() { + emake DESTDIR="${D}" install + + newinitd "${FILESDIR}"/spamass-milter.rc4 spamass-milter + newconfd "${FILESDIR}"/spamass-milter.conf3 spamass-milter + dodir /var/lib/milter + keepdir /var/lib/milter + fowners milter:milter /var/lib/milter + + dodoc AUTHORS NEWS README ChangeLog "${FILESDIR}/README.gentoo" +} |