Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] GeoIP failed to lookup ip 'PRIVATE_IP'

2013-01-26 by Frantisek Hanzlik

Emmanuel Dreyfus wrote:
> Frantisek Hanzlik <franta@...> wrote:
> 
>> I just remember other cosmetical, but filling logs problem: when I
>> specify "maxpeek=nn", then when message exceed this size, I got in
>> log message as:
>> "DATE pc milter-greylist: ignoring message beyond maxpeek = nn"
>> but not one line, but many - the longer message, the more lines in
>> log. 
> 
> Would you try this patch? (not tested, I just checked it builds)
> 
> Index: milter-greylist.c
> ===================================================================
> RCS file: /cvsroot/milter-greylist/milter-greylist.c,v
> retrieving revision 1.253
> diff -U 4 -r1.253 milter-greylist.c
> --- milter-greylist.c   19 Oct 2012 03:57:39 -0000      1.253
> +++ milter-greylist.c   26 Jan 2013 06:21:02 -0000
> @@ -823,13 +823,18 @@
>  
>         len = strlen(name) + strlen(sep) + strlen(value) + strlen(crlf);
>         priv->priv_msgcount += len;
>  
> -       if (priv->priv_msgcount > priv->priv_maxpeek) {
> +       if (priv->priv_maxpeek == 0)
> +               return SMFIS_CONTINUE;
> +
> +       if ((priv->priv_msgcount > priv->priv_maxpeek) || 
> +           (priv->priv_buflen > priv->priv_maxpeek)) {
>                 if (conf.c_debug)
>                         mg_log(LOG_DEBUG, 
>                             "ignoring message beyond maxpeek = %d", 
>                             priv->priv_maxpeek);
> +               priv->priv_maxpeek = 0;
>                 return SMFIS_CONTINUE;
>         }
>  
>         if ((l = malloc(sizeof(*l))) == NULL) {
> @@ -904,12 +909,16 @@
>  
>         priv->priv_msgcount += size;
>  
>         /* Avoid copying the whole message to save CPU */
> +       if (priv->priv_maxpeek == 0)
> +               return SMFIS_CONTINUE;
> +
>         if ((priv->priv_msgcount > priv->priv_maxpeek) || 
>             (priv->priv_buflen > priv->priv_maxpeek)) {
>                 mg_log(LOG_DEBUG, "ignoring message beyond maxpeek = %d", 
>                     priv->priv_maxpeek);
> +               priv->priv_maxpeek = 0;
>                 return SMFIS_CONTINUE;
>         }
>  
>         /* First time: add \r\n between headers and body */
> 

After some troubles (given by my programming unexperience) I finally
build milter-greylist-4.4.1 Fedora 16 RPM package with your patch
(my distro /even latest Fedora 18/ still contains only older v4.2.7)
and run it. As until now
- milter seems work correctly
- mails bigger than maxpeek (even several times) now dives only one
  line in milter log

I have one question to default greylist.conf: stat directives at lines
17 and 20 offers format like:

"%T{%Y/%m/%d %T} %d [%i] %r -> %f %S (ACL %A) %Xc %Xe %Xm %Xh"

if "->" is arrow represent mail direction from sender to recipient,
should be it rather

"%T{%Y/%m/%d %T} %d [%i] %f -> %r %S (ACL %A) %Xc %Xe %Xm %Xh"

?

Thanks, Franta

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.