fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]6.0.0 release is imminent

2002-06-21 05:50:14
Eric,

This is my patch against 5.9.12. It reduces the amount of information sent
to the syslog by suppressing the message that tells a mail was skipped
because it was fetched before and the keep option is in effect.

Thanks,
Jan.

--- driver.c.5.9.12     Fri Jun 21 14:27:16 2002
+++ driver.c    Fri Jun 21 14:27:22 2002
@@ -420,7 +420,17 @@
        {
            if ((msgcodes[num-1] == MSGLEN_TOOLARGE) && !check_only)
                mark_oversized(ctl, num, msgsizes[num-1]);
-           if (outlevel > O_SILENT)
+               /* To avoid flooding the syslog when using --keep,
+                * report "Skipped message" only when:
+                *  1) --verbose is on, or
+                *  2) fetchmail runs in foreground
+                *  3) fetchmail does not use syslog and
+                *  4) the message was not skipped for some other reason
than just being old.
+                *  (jan(_at_)klaverstijn(_dot_)nl)
+                */
+           if (   (outlevel >= O_VERBOSE) || !run.poll_interval ||
+                  (outlevel > O_SILENT && (!run.use_syslog ||
msgcodes[num-1] != MSGLEN_OLD))
+              )
            {
                report_build(stdout,
                             GT_("skipping message %s(_at_)%s:%d (%d octets)"),
@@ -684,8 +694,18 @@
            delete_str(&ctl->newsaved, num);
 #endif /* POP3_ENABLE */
        }
-       else if (outlevel > O_SILENT)
-           report_complete(stdout, GT_(" not flushed\n"));
+       else if (
+               /* To avoid flooding the syslog when using --keep,
+                * report "Skipped message" only when:
+                *  1) --verbose is on, or
+                *  2) fetchmail runs in foreground
+                *  3) fetchmail does not use syslog and
+                *  4) the message was not skipped for some other reason
than just being old.
+                *  (jan(_at_)klaverstijn(_dot_)nl)
+                */
+         (outlevel >= O_VERBOSE) || !run.poll_interval ||
+                  (outlevel > O_SILENT && (!run.use_syslog ||
msgcodes[num-1] != MSGLEN_OLD))
+              )            report_complete(stdout, GT_(" not flushed\n"));

        /* perhaps this as many as we're ready to handle */
        if (maxfetch && maxfetch <= *fetches && *fetches < count)


----- Original Message -----
From: "Eric S. Raymond" <esr(_at_)thyrsus(_dot_)com>
To: "Jan Klaverstijn" <jan(_at_)klaverstijn(_dot_)nl>
Cc: <fetchmail-friends(_at_)lists(_dot_)ccil(_dot_)org>
Sent: Friday, June 21, 2002 5:44 AM
Subject: Re: [fetchmail]6.0.0 release is imminent


Jan Klaverstijn <jan(_at_)klaverstijn(_dot_)nl>:
Will my patch to reduce the amount of data sent related to skipped
messages
in the syslog be incorporated?

If it's noy in 5.9.12, please resend.
--
<a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>