* [gentoo-commits] repo/gentoo:master commit in: mail-filter/postgrey/files/
@ 2016-12-22 15:47 Michael Palimaka
0 siblings, 0 replies; 3+ messages in thread
From: Michael Palimaka @ 2016-12-22 15:47 UTC (permalink / raw
To: gentoo-commits
commit: 041f07c1aa2f8e72413c7cce016568ad66c627e2
Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Tue Dec 13 20:28:25 2016 +0000
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 15:46:57 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=041f07c1
mail-filter/postgrey: remove unused rc file
mail-filter/postgrey/files/postgrey.rc.new | 101 -----------------------------
1 file changed, 101 deletions(-)
diff --git a/mail-filter/postgrey/files/postgrey.rc.new b/mail-filter/postgrey/files/postgrey.rc.new
deleted file mode 100644
index d3f46e9..00000000
--- a/mail-filter/postgrey/files/postgrey.rc.new
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-conf="/etc/conf.d/postgrey"
-
-extra_started_commands="reload"
-
-depend() {
- need net
- before postfix
- provide postfix_greylist
-}
-
-conf_error() {
- eerror "You need to setup ${conf} first"
- return 1
-}
-
-checkconfig() {
-if [ -z "${POSTGREY_TYPE}" ]
- then
- einfo "You need to choose the server type you want"
- einfo "by setting the POSTGREY_TYPE variable in ${conf}."
- else
- if [ "x${POSTGREY_TYPE}" = "xinet" ]
- then
- if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ]
- then
- einfo "The following entries are missing in ${conf}:"
- [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST"
- [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT"
- conf_error
- fi
- POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}"
- else
- if [ -z "${POSTGREY_SOCKET}" ]
- then
- einfo "The following entries are missing in ${conf}:"
- [ -z "${POSTGREY_SOCKET}" ] && einfo " - POSTGREY_SOCKET"
- conf_error
- fi
- POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}"
- fi
-fi
-
- if [ -z "${POSTGREY_PID}" ]
- then
- einfo "The following entries are missing in ${conf}:"
- [ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID"
- conf_error
- fi
-}
-
-start() {
- checkconfig || return 1
- ebegin "Starting Postgrey"
-
- # HACK -- start a subshell and corrects perms on the socket...
- ( if [ "x${POSTGREY_TYPE}" = "xunix" ]; then
- rm -f ${POSTGREY_SOCKET};
- while ! test -S ${POSTGREY_SOCKET}; do sleep 1; done;
- chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) &
-
- if [ -z ${POSTGREY_DELAY} ] ; then
- POSTGREY_DELAY_ARG=""
- else
- POSTGREY_DELAY_ARG="--delay=${POSTGREY_DELAY}"
- fi
-
- if [ -z "${POSTGREY_TEXT}" ] ; then
- POSTGREY_TEXT_ARG=""
- else
- POSTGREY_TEXT_ARG="--greylist-text=${POSTGREY_TEXT}"
- fi
-
- start-stop-daemon --start --quiet --background \
- --pidfile=${POSTGREY_PID} \
- --name postgrey \
- --exec /usr/sbin/postgrey -- \
- --${POSTGREY_ADDR} \
- --daemonize \
- --pidfile=${POSTGREY_PID} \
- ${POSTGREY_DELAY_ARG} \
- ${POSTGREY_OPTS} \
- "${POSTGREY_TEXT_ARG}"
- eend ${?}
-}
-
-stop() {
- ebegin "Stopping Postgrey"
- start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID}
- eend ${?}
-}
-
-reload() {
- ebegin "Reloading Postgrey"
- start-stop-daemon --stop --signal HUP --oknodo --pidfile ${POSTGREY_PID}
- eend $?
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: mail-filter/postgrey/files/
@ 2020-12-21 18:15 Sam James
0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2020-12-21 18:15 UTC (permalink / raw
To: gentoo-commits
commit: bb0c9e1db42d06a65aaf639020f4632ca7d1d01c
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Mon Dec 21 16:04:54 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 21 18:15:03 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb0c9e1d
mail-filter/postgrey: remove unused patch
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../postgrey/files/postgrey-1.34-perl-5.18.patch | 33 ----------------------
1 file changed, 33 deletions(-)
diff --git a/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch b/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch
deleted file mode 100644
index 615c6e5b77d..00000000000
--- a/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 9673b54064691a5b9c295ffea340d8a1f9ee1cb8 Mon Sep 17 00:00:00 2001
-From: Yasuhiro KIMURA <yasu@utahime.org>
-Date: Sat, 17 Aug 2013 22:05:27 +0900
-Subject: [PATCH] Make postgrey work with Perl 5.18
-
----
- postgrey | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/postgrey b/postgrey
-index 7cb0352..37f69bd 100755
---- a/postgrey
-+++ b/postgrey
-@@ -557,6 +557,16 @@ sub main()
- if($opt{dbdir}) {
- $opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1;
- }
-+ # untaint what is given on --pidfile. It is not security sensitive since
-+ # it is provided by the admin
-+ if($opt{pidfile}) {
-+ $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1;
-+ }
-+ # untaint what is given on --inet. It is not security sensitive since
-+ # it is provided by the admin
-+ if($opt{inet}) {
-+ $opt{inet} =~ /^(.*)$/; $opt{inet} = $1;
-+ }
-
- # determine proper "logsock" for Sys::Syslog
- my $syslog_logsock;
---
-2.0.3
-
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: mail-filter/postgrey/files/
@ 2020-12-26 0:53 Sam James
0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2020-12-26 0:53 UTC (permalink / raw
To: gentoo-commits
commit: 0a9241bfb4f3a6c78a570b1fec92c78bbe21ad2b
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 26 00:53:49 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 26 00:53:56 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a9241bf
mail-filter/postgrey: remove old patch
Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/targrey-0.31-postgrey-1.34.patch | 202 ---------------------
1 file changed, 202 deletions(-)
diff --git a/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch b/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch
deleted file mode 100644
index a17b6457d39..00000000000
--- a/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch
+++ /dev/null
@@ -1,202 +0,0 @@
---- postgrey.orig 2011-05-04 22:54:15.000000000 +0200
-+++ postgrey 2011-10-17 10:10:21.000000000 +0200
-@@ -309,6 +309,22 @@
- $self->mylog(1, "cleaning clients database finished. before: $nr_keys_before, after: $nr_keys_after");
- }
-
-+ if($self->{postgrey}{targrey}) {
-+ # cleanup tarpit blacklist database
-+ my $tarpit_db = $self->{postgrey}{db_tarpit};
-+ ($nr_keys_before, $nr_keys_after) = (0, 0);
-+ while (my ($key, $tarpit_last_seen) = each %$tarpit_db) {
-+ $nr_keys_before++;
-+ if($now - $tarpit_last_seen > $retry_window) {
-+ delete $tarpit_db->{$key};
-+ }
-+ else {
-+ $nr_keys_after++;
-+ }
-+ }
-+ $self->mylog(1, "cleaning tarpit blacklist database finished. before: $nr_keys_before, after: $nr_keys_after");
-+ }
-+
- $self->{postgrey}{last_maint_keys}=$now;
- }
- }
-@@ -383,7 +399,7 @@
- # whitelist if count is enough
- if(defined $cawl_count and $cawl_count >= $self->{postgrey}{awl_clients})
- {
-- if(($now >= $cawl_last+3600) or ($cawl_last > $now)) {
-+ if(($now >= $cawl_last + $self->{postgrey}{awl_delay}) or ($cawl_last > $now)) {
- $cawl_count++; # for statistics
- $cawl_db->{$cawl_key}=$cawl_count.','.$now;
- }
-@@ -392,6 +408,28 @@
- }
- }
-
-+ # check tarpit passed if targrey mode
-+ if ($self->{postgrey}{targrey} && $attr->{protocol_state} eq 'DATA') { # passed tarpit
-+ # remove tarpit blacklist
-+ my $tarpit_db = $self->{postgrey}{db_tarpit};
-+ my $tarpit_key = $attr->{client_address};
-+ delete $tarpit_db->{$tarpit_key};
-+
-+ # auto whitelist clients by tarpit
-+ if ($self->{postgrey}{awl_clients}) {
-+ # enough time has passed (record only one attempt per hour)
-+ if (! defined $cawl_last or $now >= $cawl_last + $self->{postgrey}{awl_delay}) {
-+ # ok, increase count
-+ $cawl_count++;
-+ $cawl_db->{$cawl_key}=$cawl_count.','.$now;
-+ $self->mylog(1, "tarpit whitelisted: $attr->{client_name}"."[".$attr->{client_address}."]")
-+ if $cawl_count==$self->{postgrey}{awl_clients};
-+ }
-+ }
-+
-+ return 'DUNNO';
-+ }
-+
- # lookup
- my $sender = $self->do_sender_substitutions($attr->{sender});
- my ($client_net, $client_host) =
-@@ -402,10 +440,11 @@
- }
- my $val = $db->{$key};
- my $first;
-+ my $retry_count=0;
- my $last_was_successful=0;
- if(defined $val) {
- my $last;
-- ($first, $last) = split(/,/,$val);
-+ ($first, $last, $retry_count) = split(/,/,$val);
- # find out if the last time was unsuccessful, so that we can add a header
- # to say how much had to be waited
- if($last - $first >= $self->{postgrey}{delay}) {
-@@ -426,16 +465,19 @@
- $first = $now;
- }
-
-+ my $diff = $self->{postgrey}{delay} - ($now - $first);
-+
-+ # enough waited? -> increase retry_count
-+ $retry_count++ if($diff <= 0);
-+
- # update (put as last element stripped host-part if it was stripped)
- if(defined $client_host) {
-- $db->{$key}="$first,$now,$client_host";
-+ $db->{$key}="$first,$now,$retry_count,$client_host";
- }
- else {
-- $db->{$key}="$first,$now";
-+ $db->{$key}="$first,$now,$retry_count";
- }
-
-- my $diff = $self->{postgrey}{delay} - ($now - $first);
--
- # auto whitelist clients
- # algorithm:
- # - on successful entry in the greylist db of a triplet:
-@@ -443,23 +485,41 @@
- # - client whitelisted already? -> update last-seen timestamp
- if($self->{postgrey}{awl_clients}) {
- # greylisting succeeded
-- if($diff <= 0 and !$last_was_successful) {
-+ if($retry_count >= $self->{postgrey}{retry_count} and !$last_was_successful) {
- # enough time has passed (record only one attempt per hour)
-- if(! defined $cawl_last or $now >= $cawl_last + 3600) {
-+ if(! defined $cawl_last or $now >= $cawl_last + $self->{postgrey}{awl_delay}) {
- # ok, increase count
- $cawl_count++;
- $cawl_db->{$cawl_key}=$cawl_count.','.$now;
- my $client = $attr->{client_name} ?
- $attr->{client_name}.'['.$attr->{client_address}.']' :
- $attr->{client_address};
-- $self->mylog(1, "whitelisted: $client")
-+ $self->mylog(1, "whitelisted: $attr->{client_name}"."[".$attr->{client_address}."]")
- if $cawl_count==$self->{postgrey}{awl_clients};
- }
- }
- }
-
-- # not enough waited? -> greylist
-- if ($diff > 0 ) {
-+ # not enough retry? -> greylist
-+ if ($retry_count < $self->{postgrey}{retry_count}) {
-+ if($self->{postgrey}{tarpit} && ! $self->{postgrey}{targrey}) {
-+ # do tarpit and greylist if tarpit option only
-+ # don't add message after greylist_action
-+ return "SLEEP $self->{postgrey}{tarpit}, $self->{postgrey}{greylist_action}";
-+ }
-+ if($self->{postgrey}{targrey}) {
-+ # do tarpit if targrey option
-+ # add tarpit blacklist
-+ my $tarpit_db = $self->{postgrey}{db_tarpit};
-+ my $tarpit_key = $attr->{client_address};
-+ my $tarpit_last = $tarpit_db->{$tarpit_key};
-+ $tarpit_last = 0 unless (defined $tarpit_last);
-+ $tarpit_db->{$tarpit_key} = "$now" if ($now >= $tarpit_last+300); # update if 5min ago
-+
-+ # return sleep if not tarpit blacklisted
-+ return "SLEEP $self->{postgrey}{tarpit}" if ($tarpit_last == 0);
-+ # greylist if tarpit blacklisted
-+ }
- my $msg = $self->{postgrey}{greylist_text};
- # Workaround for an Exchange bug related to Greylisting:
- # use DSN 4.2.0 instead of the default 4.7.1. This works
-@@ -517,6 +577,7 @@
- 'syslogfacility|syslog-facility|facility=s',
- 'retry-window=s', 'greylist-action=s', 'greylist-text=s', 'privacy',
- 'hostname=s', 'exim', 'listen-queue-size=i', 'x-greylist-header=s',
-+ 'tarpit:s', 'targrey', 'retry-count=i', 'auto-whitelist-delay=i',
- ) or exit(1);
- # note: lookup-by-subnet can be given for compatibility, but it is default
- # so do not do nothing with it...
-@@ -606,7 +667,9 @@
- awl_clients => defined $opt{'auto-whitelist-clients'} ?
- ($opt{'auto-whitelist-clients'} ne '' ?
- $opt{'auto-whitelist-clients'} : 5) : 5,
-+ awl_delay => $opt{'auto-whitelist-delay'} || 3600,
- retry_window => $retry_window,
-+ retry_count => $opt{'retry-count'} || 1,
- greylist_action => $opt{'greylist-action'} || 'DEFER_IF_PERMIT',
- greylist_text => $opt{'greylist-text'} || 'Greylisted, see http://postgrey.schweikert.ch/help/%r.html',
- whitelist_clients_files => $opt{'whitelist-clients'} ||
-@@ -618,6 +681,10 @@
- hostname => defined $opt{hostname} ? $opt{hostname} : hostname,
- exim => defined $opt{'exim'},
- x_greylist_header => $opt{'x-greylist-header'} || 'X-Greylist: delayed %t seconds by postgrey-%v at %h; %d',
-+ tarpit => defined $opt{'tarpit'} ?
-+ ($opt{'tarpit'} ne '' ?
-+ $opt{'tarpit'} : 65) : undef,
-+ targrey => defined $opt{'targrey'},
- },
- }, 'postgrey';
-
-@@ -633,6 +700,11 @@
- require Digest::SHA;
- }
-
-+ # --targrey needs tarpit sec
-+ if(defined $opt{'targrey'} && ! defined $opt{'tarpit'}) {
-+ $server->{postgrey}{tarpit} = 125;
-+ }
-+
- $0 = join(' ', @{$server->{server}{commandline}});
- $server->run;
-
-@@ -711,6 +783,13 @@
- -Env => $self->{postgrey}{db_env}
- ) or die "ERROR: can't create database $self->{server}{dbdir}/postgrey_clients.db: $!\n";
- }
-+ if($self->{postgrey}{targrey}) { # use targrey
-+ tie(%{$self->{postgrey}{db_tarpit}}, 'BerkeleyDB::Btree',
-+ -Filename => 'tarpit_clients.db',
-+ -Flags => DB_CREATE,
-+ -Env => $self->{postgrey}{db_env}
-+ ) or die "ERROR: can't create database $self->{server}{dbdir}/tarpit_clients.db: $!\n";
-+ }
- }
-
- sub mux_input()
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-26 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22 15:47 [gentoo-commits] repo/gentoo:master commit in: mail-filter/postgrey/files/ Michael Palimaka
-- strict thread matches above, loose matches on Subject: below --
2020-12-21 18:15 Sam James
2020-12-26 0:53 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox