First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 119109
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Net-Mail Packages <net-mail@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jeremy Clifton <j.clifton@intuiworx.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
postgrey.rc.new Updated init file text/plain Philip White 2006-08-29 21:53 0000 2.23 KB Details
postgrey.rc.new Updated init file text/plain Philip White 2006-09-09 22:05 0000 2.23 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 119109 depends on: Show dependency tree
Show dependency graph
Bug 119109 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-01-15 11:40 0000
I have postgrey 1.21 installed on my box.

I modified the init script and conf.d file such that it was possible to
configure the greylist delay period and greylist response text from the
conf.d/postgrey file.

The modified init script checks to make sure that the POSTGREY_DELAY var has
been set, and will issue an error if it has not. It also will append the value
of POSTGREY_RESPONSE (with the appropriate flag) to the options passed to
start-stop-daemon only if the POSTGREY_RESPONSE var is set or not an empty
string.

I believe that this will be of use to other Gentoo users ... especially the
addition of the info for the --greylist-text option, as simply adding this flag
and the message to the POSTGREY_OPTIONS var in the conf.d file won't work (see
the following links to information about the Debian implementation for more
details)

http://lists.ee.ethz.ch/postgrey/msg00584.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=298832
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=309515

diff for /etc/init.d/postgrey:
----------

--- postgrey.old        2006-01-15 14:23:45.000000000 -0500
+++ postgrey    2006-01-15 13:14:18.000000000 -0500
@@ -49,6 +49,15 @@
                [ -z "${POSTGREY_PID}" ] && einfo "  - POSTGREY_PID"
                conf_error
        fi
+       
+       # Make sure the greylisting delay time period is set.
+       if [ -z "${POSTGREY_DELAY}" ]
+               then
+                       einfo "The following entries are missing in ${conf}:"
+                       [ -z "${POSTGREY_DELAY}" ] && einfo "  -
POSTGREY_DELAY"
+                       conf_error
+       fi
+
 }

 start() {
@@ -61,12 +70,19 @@
        while ! test -S ${POSTGREY_SOCKET}; do sleep 1; done;
        chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) &

+       # Check for a greylist message.
+       if [ "$POSTGREY_RESPONSE" != "" ]
+               then
+                      
POSTGREY_RESPONSE_OPT="--greylist-text=$POSTGREY_RESPONSE"
+       fi
+
        start-stop-daemon --start --quiet --background \
                --exec /usr/sbin/postgrey -- \
                --${POSTGREY_ADDR} \
                --daemonize \
                --pidfile=${POSTGREY_PID} \
-               ${POSTGREY_OPTS}
+               ${POSTGREY_OPTS} \
+               "${POSTGREY_RESPONSE_OPT}"
        eend ${?}
 }

----------

diff for /etc/conf.d/postgrey:
----------

--- postgrey.old        2006-01-15 14:23:31.000000000 -0500
+++ postgrey    2006-01-15 13:15:03.000000000 -0500
@@ -1,5 +1,11 @@
 # Config file for /etc/init.d/postgrey

+# How long to delay mail that is greylisted in seconds.
+POSTGREY_DELAY=900
+
+# The response we'll send back with delayed mail.
+POSTGREY_RESPONSE='This account is temporarily disabled. Please try again in
%s seconds.'
+
 # LISTEN TYPE
 #  Set to 'inet' if you want to use a TCP socket.
 #  Set to 'unix' if you want to use an UNIX socket.
@@ -48,4 +54,4 @@
 # per default /etc/postfix/postgrey_whitelist_clients.local is also read, so
 # that you can put there local entries.
 #
-POSTGREY_OPTS=""
+POSTGREY_OPTS="--delay=$POSTGREY_DELAY"

----------

------- Comment #1 From Andrej Kacian (RETIRED) 2006-02-20 00:05:58 0000 -------
I'll have a look at this today. Looks good.

------- Comment #2 From Andrej Kacian (RETIRED) 2006-02-25 10:04:19 0000 -------
In portage now, for newly added postgrey-1.24. I added some sanity checks for
when new options are commented in the .conf file (and thus empty).

Thanks for your contribution!

------- Comment #3 From Gokdeniz Karadag 2006-04-05 07:46:06 0000 -------
I recently upgraded to this ebuild, but there is a problem with postgrey
response text. The problem is, only the first word of the POSTGREY_TEXT is sent
to the remote server.

There is a thread about this at: http://lists.ee.ethz.ch/postgrey/msg01062.html
it mentions quotes, but when I look at /etc/init.d/postgrey, quotes are all in
place. 

Here is an example log line from a spam being rejected;
Apr  5 17:32:56 thostname postfix/smtpd[2393]: NOQUEUE: reject: RCPT from
WLL-23-pppoe081.t-net.net.ve[200.31.137.81]: 450 <xxxx@tttt.yy>: Recipient
address rejected: "Temporariliy; from=<georgiy_b05@list.ru> to=<xxxx@tttt.yy>
proto=ESMTP helo=<r95di.ohuby5.comcast.net>

------- Comment #4 From Andrej Kacian (RETIRED) 2006-04-07 15:23:10 0000 -------
You're right, I can experience this too, despite it looking alright in ps:

18182 ?        Ss     0:00 /usr/sbin/postgrey
--unix=/var/spool/postfix/private/postgrey --daemonize
--pidfile=/var/run/postgrey.pid --delay=300 --greylist-text "Greylisted for %s
seconds"

------- Comment #5 From Arnaud Launay 2006-04-09 05:51:05 0000 -------
I have this problem, too -- and worse: postgrey just die after delaying the
first mail... Works fine when I comment the greylist text option in the conf
file.

------- Comment #6 From Alexander Skwar 2006-04-19 10:42:18 0000 -------
Same problem here. Another thread on the postgrey list:
http://lists.ee.ethz.ch/postgrey/msg01105.html

> 18182 ?        Ss     0:00 /usr/sbin/postgrey
> --unix=/var/spool/postfix/private/postgrey --daemonize
> --pidfile=/var/run/postgrey.pid --delay=300 --greylist-text "Greylisted for %s
> seconds"

Interestingly (?) my PS output looks a bit different:

askwar@hetzner ~ $ ps axwww|grep postgrey
26719 ?        Ss     0:00 /usr/sbin/postgrey
--unix=/var/spool/postfix/private/postgrey --daemonize
--pidfile=/var/run/postgrey.pid --delay=300 --greylist-text="Greylisted 
for %s seconds"

The difference is, that I've got a = before the "Greylisted.

------- Comment #7 From Vadim Berezniker 2006-06-20 17:13:59 0000 -------
I changed 
    start-stop-daemon --start --quiet --background \
        --exec /usr/sbin/postgrey -- \
        --${POSTGREY_ADDR} \
        --daemonize \
        --pidfile=${POSTGREY_PID} \
        ${POSTGREY_DELAY_ARG} \
        ${POSTGREY_TEXT_ARG} \
        ${POSTGREY_OPTS}
to
    start-stop-daemon --start --quiet --background \
        --exec /usr/sbin/postgrey -- \
        --${POSTGREY_ADDR} \
        --daemonize \
        --pidfile=${POSTGREY_PID} \
        ${POSTGREY_DELAY_ARG} \
        "${POSTGREY_TEXT_ARG}" \
        ${POSTGREY_OPTS}

and it magically works =)

Also, how come --background is being passed to start-stop-daemon? 

------- Comment #8 From Philip White 2006-08-29 21:38:25 0000 -------
Comment #7 fixes this problem for me as well.

------- Comment #9 From Philip White 2006-08-29 21:53:44 0000 -------
Created an attachment (id=95431) [edit]
Updated init file

As per comment #7, this updated init file puts the POSTGREY_TEXT_ARG into
double quotes to prevent the parameter from being cut off at the first
whitespace character.

------- Comment #10 From Philip White 2006-09-09 22:02:28 0000 -------
(From update of attachment 95431 [edit])
>#!/sbin/runscript
># Copyright 1999-2004 Gentoo Foundation
># Distributed under the terms of the GNU General Public License v2
># $Header: /var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey.rc.new,v 1.3 2006/02/25 17:59:13 ticho Exp $
>
>conf="/etc/conf.d/postgrey"
>
>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 \
>		--exec /usr/sbin/postgrey -- \
>		--${POSTGREY_ADDR} \
>		--daemonize \
>		--pidfile=${POSTGREY_PID} \
>		${POSTGREY_DELAY_ARG} \
>		"${POSTGREY_TEXT_ARG}" \
>		${POSTGREY_OPTS}
>	eend ${?}
>}
>
>stop() {
>	ebegin "Stopping Postgrey"
>	start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID}
>	eend ${?}
>}

------- Comment #11 From Philip White 2006-09-09 22:05:52 0000 -------
Created an attachment (id=96552) [edit]
Updated init file

The change is that it prevents nested quotes.  The previous patch would include
the quotation marks in the server reply, like so:
Recipient address rejected: "Greylisted for 60 seconds"; to=

Now it says:
Recipient address rejected: Greylisted for 60 seconds; to=

It uses direct concatenation of quoted text with a shell variable.

And apologies for the previous comment spam: I did not realize what my action
would cause.

------- Comment #12 From Marc St-Pierre 2006-11-09 17:38:16 0000 -------
I have the same issue.  This is my quick fix (without starting to edit perl
scripts):

/etc/conf.d/postgrey:
POSTGREY_TEXT="Cyberlogic_Greylisted_for_%s_seconds_(http://postmaster.cyberlogic.net/greylist.php)"


 8830 ?        Ss     0:02 /usr/sbin/postgrey --inet=127.0.0.1:10030
--daemonize --pidfile=/var/run/postgrey.pid --delay=300
--greylist-text="Cyberlogic_Greylisted_for_%s_seconds_(http://postmaster.cyberlogic.net/greylist.php)"
-v --whitelist-clients=/etc/postfix/postgrey_whitelist_clients

------- Comment #13 From Reuben Farrelly 2007-02-04 12:56:29 0000 -------
Still seeing this problem with only the word "Greylisted;" in the URL as of
04-Feb-07.

------- Comment #14 From Alexander Skwar 2007-06-21 08:23:31 0000 -------
(In reply to comment #13)
> Still seeing this problem with only the word "Greylisted;" in the URL as of
> 04-Feb-07.
> 

Still not fixed, as of 2007-06-21.

------- Comment #15 From Tobias Scherbaum 2007-06-26 18:33:36 0000 -------
*** Bug 177443 has been marked as a duplicate of this bug. ***

------- Comment #16 From Tobias Scherbaum 2007-09-08 08:53:00 0000 -------
This one is supposed to be fixed in 1.30-r2.

------- Comment #17 From Tobias Scherbaum 2007-09-08 10:03:03 0000 -------
(In reply to comment #16)
> This one is supposed to be fixed in 1.30-r2.
> 

s/1.30-r2/1.31

First Last Prev Next    No search results available      Search page      Enter new bug