Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213709 - postgrey: init.d script "${POSTGREY_TEXT_ARG}" breaks the remaining command line options
Summary: postgrey: init.d script "${POSTGREY_TEXT_ARG}" breaks the remaining command l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 15:30 UTC by Raphael Marichez (Falco) (RETIRED)
Modified: 2008-04-06 15:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Marichez (Falco) (RETIRED) gentoo-dev 2008-03-17 15:30:40 UTC
mail-filter/postgrey 1.31

/etc/conf.d/postgrey:
  POSTGREY_TEXT is commented (so it's not assigned in the init.d script)

And i have in conf.d/postgrey:
POSTGREY_OPTS="--verbose --greylist-text=Greylisted --greylist-action=421"

$ cat /proc/xxx/cmdline
/usr/sbin/postgrey --inet=127.0.0.1:10030 --daemonize --pidfile=/var/run/postgrey.pid --delay=1010  --verbose --greylist-text=Greylisted --greylist-action=REJECT#      

(note the 2 spaces between delay and verbose, which is, in fact, "")

I get:
rcpt to:<schmurtz>
450 4.2.0 <schmurtz>: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/schmurtz.html

and nothing verbose.

If i add something in POSTGREY_TEXT, it's OK:

POSTGREY_TEXT="azeertyuipmqlfkjlkhgaaa bbb" 
(what a nice example config file :) )

$ cat cmdline
/usr/sbin/postgrey --inet=127.0.0.1:10030 --daemonize --pidfile=/var/run/postgrey.pid --delay=1010 --verbose --greylist-text=Greylisted --greylist-action=REJECT#       

rcpt to:<schmurtz>
421 4.2.0 <schmurtz>: Recipient address rejected: Greylisted
Connection closed by foreign host.

and it's now verbose (TCP connections in syslog)

I added debug code in /usr/sbin/postgrey line 501, and it confirmed that GetOptions() does not take into account --verbose, --greylist-text, nor --greylist-action.


Fix: the init.d script should NOT add "" as argument to start-stop-daemon

                 ${POSTGREY_DELAY_ARG} \ 
-                "${POSTGREY_TEXT_ARG}" \ 
+                ${POSTGREY_TEXT_ARG} \ 
                 ${POSTGREY_OPTS}
Comment 1 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2008-03-18 12:10:36 UTC
hum, that fails if POSTGREY_TEXT contains more that one word. (i tried with "Greylisted.")

Then here is another fix: invert the two args, exactly as in bug 119109

                 ${POSTGREY_DELAY_ARG} \ 
-                "${POSTGREY_TEXT_ARG}" \ 
-                ${POSTGREY_OPTS}
+                ${POSTGREY_OPTS} \
+                "${POSTGREY_TEXT_ARG}"

And warn users to not put options with spaces in $POSTGREY_OPTS in /etc/conf.d/postgrey. Instead, put your text in ${POSTGREY_TEXT_ARG} *only*.
Comment 2 Tobias Scherbaum (RETIRED) gentoo-dev 2008-03-18 16:47:24 UTC
(In reply to comment #1)
> hum, that fails if POSTGREY_TEXT contains more that one word. (i tried with
> "Greylisted.")

yeah, that was a fix from #119109, too. 

> Then here is another fix: invert the two args, exactly as in bug 119109
> 
>                  ${POSTGREY_DELAY_ARG} \ 
> -                "${POSTGREY_TEXT_ARG}" \ 
> -                ${POSTGREY_OPTS}
> +                ${POSTGREY_OPTS} \
> +                "${POSTGREY_TEXT_ARG}"
> 
> And warn users to not put options with spaces in $POSTGREY_OPTS in
> /etc/conf.d/postgrey. Instead, put your text in ${POSTGREY_TEXT_ARG} *only*.

I'll do some further testing on that during the weekend and get this committet then. Thanks for providing the fix :)
Comment 3 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2008-04-01 13:35:27 UTC
(In reply to comment #2)
> 
> I'll do some further testing on that during the weekend and get this committet
> then. Thanks for providing the fix :)
> 

ping
Comment 4 Tobias Scherbaum (RETIRED) gentoo-dev 2008-04-06 15:43:27 UTC
pong - and fixed in CVS.