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 manu@...

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 */

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

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.