Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] Image SPAM embedded in PDF

2007-07-20 by manu@netbsd.org

Nerijus Baliunas <nerijus@...> wrote:

> The computed message size increases monotonously with each delivery,
> which is obviously wrong.  Apparently, milter-greylist does not
> RESET its message size count between mail deliveries. This explains
> why the count keeps going up.

Would reseting everything about DATA stage when entering the
mlfi_envfrom function help?

Index: milter-greylist.c
===================================================================
RCS file: /milter-greylist/milter-greylist/milter-greylist.c,v
retrieving revision 1.191
diff -U2 -r1.191 milter-greylist.c
--- milter-greylist.c   14 Jul 2007 03:45:00 -0000      1.191
+++ milter-greylist.c   20 Jul 2007 03:25:52 -0000
@@ -355,4 +355,30 @@
        priv = (struct mlfi_priv *) smfi_getpriv(ctx);
 
+       /* 
+        * First cleanup anything we still know about a previous
+        * message we received in the same SMTP session.
+        */
+       reset_acl_values(priv);
+
+       while ((r = LIST_FIRST(&priv->priv_rcpt)) != NULL) {
+               LIST_REMOVE(r, r_list);
+               free(r);
+       }
+       while ((h = TAILQ_FIRST(&priv->priv_header)) != NULL) {
+               free(h->h_line);
+               TAILQ_REMOVE(&priv->priv_header, h,  h_list);
+               free(h);
+       }
+       while ((b = TAILQ_FIRST(&priv->priv_body)) != NULL) {
+               free(b->b_lines);
+               TAILQ_REMOVE(&priv->priv_body, b, b_list);
+               free(b);
+       }
+       if (priv->priv_buf)
+               free(priv->priv_buf);
+
+       /* 
+        * Now let's handle this new message...
+        */
        if ((priv->priv_queueid = smfi_getsymval(ctx, "{i}")) == NULL) {
 #ifndef USE_POSTFIX

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