Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-13 23:57 UTC

Message

Re: [milter-greylist] HELO not "%d" misfires too often

2014-12-24 by Jim Klimov

2014-12-24 4:55, manu@... [milter-greylist] \u043f\u0438\u0448\u0435\u0442:
> Jim Klimov jimklimov@... [milter-greylist]
> <milter-greylist@yahoogroups.com> wrote:
>
>  > New revision attached, without printf and with two strstr substring
>  > matches (A in B or B in A).
>
> I refactorized a bit. Tell me if it works fine and I'll commit:
> http://ftp.espci.fr/shadow/manu/helo.patch
>
> - space and comment style
> - 80 char/line
> - use sizeof(variable) instead of copying its size
> - use same size for lh_priv and priv->priv_helo
> - don't reuse a variable fortwo different usages
> - free allocated format string

Thanks for the revision, looks good - almost: the check in LOG_DEBUG
now got inverted, e.g.:

Dec 24 16:18:51 myrelay milter-greylist: [ID 238697 mail.debug]
  acl_helo_strstr: "smtp461.unisnd.com"/"smtp461.unisnd.com" (lowercase
  of "smtp461.unisnd.com"/"smtp461.unisnd.com") => MISMATCH

This is cosmetic, but still should be fixed.

I see that you've removed the explicit checks like "==0" or '\0'
which makes the result somewhat more system-dependent (i.e. things
like the definition of an end-of-string character or a NULL pointer
are not necessarily series of zero bits, and there are historic
precedents ages ago when some other numeric values were used - so
we were trained to be more explicit in coding).

Even in this case of inverted results, for C the zero return is
"false" while for shell scripts it is "success"... both ways feel
"natural" but I get confused when switching between languages.
So I'd rather write explicit result-checks ;)

With that inversion of the logged message in mind, seems good to go.

Thanks, and a merry X-Mas,
Jim Klimov

Attachments

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.