Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

garbled envelope-from in milter-greylist 4.0.1

garbled envelope-from in milter-greylist 4.0.1

2008-09-11 by Petar Bogdanovic

Hi,

I saw this already in 4.0, but since it did no harm I forgot about it
pretty soon.

Envelope from seen/logged by postfix:

	postfix/qmgr[241]: (...) from=<bounces-netbsd-users-owner-petar=smokva.net@...> (...)

Envelope from seen/logged by milter-greylist:

	milter-greylist: (unknown id):
		skipping greylist because recipient <petar@...> is whitelisted,
		(from==smokva.net@...>, rcpt=<petar@...>, addr=mail.netbsd.org[204.152.190.11]) ACL 25
		     ^^^


Like I said, it seems to do no harm but since 4.0.1 didn't fix it, I
assumed no one noticed and therefore wanted to let you know.


Thanks,

Petar

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-11 by manu@netbsd.org

Petar Bogdanovic <petar@...> wrote:

> addr=mail.netbsd.org[204.152.190.11]) ACL 25

Does it happens randomly, or is it on each message?
I have never seen such a problem. Perhaps it's Postfix specific?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-11 by Petar Bogdanovic

On Thu, Sep 11, 2008 at 08:08:01PM +0200, manu@... wrote:
> Petar Bogdanovic <petar@...> wrote:
> 
> > addr=mail.netbsd.org[204.152.190.11]) ACL 25
> 
> Does it happens randomly, or is it on each message?

It only happens when the envelope from contains a `=':

   (...) from==smokva.net@...>, rcpt=<petar@...>               (...)
   (...) from==smokva.net@...>, rcpt=<list+2007@...>   (...)
   (...) from==smokva.net@...>, rcpt=<petar@...> (...)

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-11 by Benoit Branciard

Petar Bogdanovic a \ufffdcrit :
> On Thu, Sep 11, 2008 at 08:08:01PM +0200, manu@... wrote:
>> Petar Bogdanovic <petar@...> wrote:
>>
>>> addr=mail.netbsd.org[204.152.190.11]) ACL 25
>> Does it happens randomly, or is it on each message?
> 
> It only happens when the envelope from contains a `=':
> 

I noticed this for a very long time (also in older versions of 
milter-greylist), but I never suspected it was a bug, I thought it was a 
feature intended to decode an SRS-written sender adress... :-)

-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-12 by manu@netbsd.org

Petar Bogdanovic <petar@...> wrote:

> It only happens when the envelope from contains a `=':

That chunk of code could be the culprit, in milter-greylist.c. However,
I have trouble to see where it could be wrong.

        /*
         * Strip anything before the last '=' in the
         * source address. This avoid problems with
         * mailing lists using a unique sender address
         * for each retry.
         */
        if ((idx = rindex(tmpfrom, '=')) == NULL)
                idx = tmpfrom; 
        
        strncpy(priv->priv_from, idx, ADDRLEN);
        priv->priv_from[ADDRLEN] = '\0';

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-12 by Petar Bogdanovic

On Fri, Sep 12, 2008 at 05:32:35AM +0200, manu@... wrote:
> Petar Bogdanovic <petar@...> wrote:
> 
> > It only happens when the envelope from contains a `=':
> 
> That chunk of code could be the culprit, in milter-greylist.c. However,
> I have trouble to see where it could be wrong.
> 
>         /*
>          * Strip anything before the last '=' in the
>          * source address. This avoid problems with
>          * mailing lists using a unique sender address
>          * for each retry.
>          */
>         if ((idx = rindex(tmpfrom, '=')) == NULL)
>                 idx = tmpfrom; 

Erm, maybe it's too early and I don't see what you see, but this
actually is the problem.

I did a quick test with:

	- if ((idx = rindex(tmpfrom, '=')) == NULL)
	+ /* if ((idx = rindex(tmpfrom, '=')) == NULL) */
		idx = tmpfrom;

and it worked:

	milter-greylist: (unknown id): skipping greylist because recipient <petar@...> is whitelisted,
	(from=<listname+user=domain.tld@...>, rcpt=<petar@...>, addr=localhost[127.0.0.1])
	      ^^^^^^^Y^^^^^^
	      (missing part)


It's obvious however that this will cause troubles when -- as the
comment block states -- ``mailing lists use a unique sender address
for each retry''.


Thanks,

Petar

Re: [milter-greylist] garbled envelope-from in milter-greylist 4.0.1

2008-09-12 by manu@netbsd.org

Petar Bogdanovic <petar@...> wrote:

> Erm, maybe it's too early and I don't see what you see, but this
> actually is the problem.
> 
> I did a quick test with:
> 
>       - if ((idx = rindex(tmpfrom, '=')) == NULL)
>       + /* if ((idx = rindex(tmpfrom, '=')) == NULL) */
>               idx = tmpfrom;
> 
> and it worked:

So what about this?

         if ((idx = rindex(tmpfrom, '=')) != NULL)
                         idx++;
        else
                idx = tmpfrom;


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: garbled envelope-from in milter-greylist 4.0.1

2008-09-12 by szalkai2

--- In milter-greylist@yahoogroups.com, Petar Bogdanovic <petar@...>
wrote:
> I did a quick test with:
> 
> 	- if ((idx = rindex(tmpfrom, '=')) == NULL)
> 	+ /* if ((idx = rindex(tmpfrom, '=')) == NULL) */
> 		idx = tmpfrom;
> 
> and it worked:

Please don't remove this, it is a very useful feature.  Without this,
many mailing lists will never get auto-whitelisted, because they use
VERP.  With this, they get auto-whitelisted in the most intelligent way
(ie. the whitelist entry is neither too broad nor too narrow).

Besides, there is no drawback to this feature.  Or can you see any?

Akos

Re: [milter-greylist] Re: garbled envelope-from in milter-greylist 4.0.1

2008-09-12 by manu@netbsd.org

szalkai2 <szalkai@...> wrote:

> Please don't remove this, it is a very useful feature.  Without this,
> many mailing lists will never get auto-whitelisted, because they use
> VERP.  With this, they get auto-whitelisted in the most intelligent way
> (ie. the whitelist entry is neither too broad nor too narrow).
> 
> Besides, there is no drawback to this feature.  Or can you see any?

It's just an off-by-one display bug.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Re: garbled envelope-from in milter-greylist 4.0.1

2008-09-13 by Benoit Branciard

manu@... a \ufffdcrit :
> szalkai2 <szalkai@...> wrote:
> 
>> Please don't remove this, it is a very useful feature.  Without this,
>> many mailing lists will never get auto-whitelisted, because they use
>> VERP.  With this, they get auto-whitelisted in the most intelligent way
>> (ie. the whitelist entry is neither too broad nor too narrow).
>>
>> Besides, there is no drawback to this feature.  Or can you see any?
> 
> It's just an off-by-one display bug.
> 

I don't thing it's a bug: leaving the leading "=" is a handy way to 
display in the log that the address has been truncated. From my point of 
view, you should not modify anything.

Perhaps the "fix" would be to document this wonderful feature in the 
README or the man page...



-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.