<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>213709</bug_id>
          
          <creation_ts>2008-03-17 15:30 0000</creation_ts>
          <short_desc>postgrey: init.d script &quot;${POSTGREY_TEXT_ARG}&quot; breaks the remaining command line options</short_desc>
          <delta_ts>2008-04-06 15:43:27 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>falco@gentoo.org</reporter>
          <assigned_to>net-mail@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2008-03-17 15:30:40 0000</bug_when>
            <thetext>mail-filter/postgrey 1.31

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

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

$ 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, &quot;&quot;)

I get:
rcpt to:&lt;schmurtz&gt;
450 4.2.0 &lt;schmurtz&gt;: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/schmurtz.html

and nothing verbose.

If i add something in POSTGREY_TEXT, it&apos;s OK:

POSTGREY_TEXT=&quot;azeertyuipmqlfkjlkhgaaa bbb&quot; 
(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:&lt;schmurtz&gt;
421 4.2.0 &lt;schmurtz&gt;: Recipient address rejected: Greylisted
Connection closed by foreign host.

and it&apos;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 &quot;&quot; as argument to start-stop-daemon

                 ${POSTGREY_DELAY_ARG} \ 
-                &quot;${POSTGREY_TEXT_ARG}&quot; \ 
+                ${POSTGREY_TEXT_ARG} \ 
                 ${POSTGREY_OPTS}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2008-03-18 12:10:36 0000</bug_when>
            <thetext>hum, that fails if POSTGREY_TEXT contains more that one word. (i tried with &quot;Greylisted.&quot;)

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

                 ${POSTGREY_DELAY_ARG} \ 
-                &quot;${POSTGREY_TEXT_ARG}&quot; \ 
-                ${POSTGREY_OPTS}
+                ${POSTGREY_OPTS} \
+                &quot;${POSTGREY_TEXT_ARG}&quot;

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*.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-03-18 16:47:24 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; hum, that fails if POSTGREY_TEXT contains more that one word. (i tried with
&gt; &quot;Greylisted.&quot;)

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

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

I&apos;ll do some further testing on that during the weekend and get this committet then. Thanks for providing the fix :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2008-04-01 13:35:27 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; 
&gt; I&apos;ll do some further testing on that during the weekend and get this committet
&gt; then. Thanks for providing the fix :)
&gt; 

ping
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-04-06 15:43:27 0000</bug_when>
            <thetext>pong - and fixed in CVS.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>