]> Pileus Git - ~andy/fetchmail/commitdiff
Do not print "skipping message" for old messages even in verbose mode.
authorSunil Shetye <sunilshetye@rocketmail.com>
Wed, 4 May 2011 17:51:11 +0000 (23:21 +0530)
committerMatthias Andree <matthias.andree@gmx.de>
Wed, 11 May 2011 11:42:30 +0000 (13:42 +0200)
NEWS
driver.c

diff --git a/NEWS b/NEWS
index 86657c135caab49797bce462d553528f7e56c6ea..f6060ab1088debb064c0d13ffebd1ab0c8e3229b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,9 @@ fetchmail-6.3.20 (not yet released):
   messages and most of the range searches result in nothing. Instead, split the
   long response to make the IMAP driver think that there are multiple lines of
   response. (Sunil Shetye)
+* Do not print "skipping message" for old messages even in verbose mode. If
+  there are too many old messages, the logs just get filled without any real
+  activity. (Sunil Shetye) (suggested by Yunfan Jiang)
 
 # TRANSLATION UPDATES
   [ja]    Japanese (Takeshi Hamasaki)
index 5c073d65a4a0183dec222cd63f3d3a5abbba8be3..cfc4af0f0eeb0d9caa14a26df0c12ac3783b085c 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -511,14 +511,11 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
         }
        if (msgcode == MSGLEN_OLD)
        {
-               /* To avoid flooding the syslog when using --keep,
-                * report "Skipped message" only when:
-                *  1) --verbose is on, or
-                *  2) fetchmail does not use syslog
-                */
-           if (   (outlevel >= O_VERBOSE) ||
-                  (outlevel > O_SILENT && !run.use_syslog)
-              )
+           /*
+            * To avoid flooding the logs when using --keep, report
+            * skipping for old messages only when --flush is on.
+            */
+           if (outlevel > O_SILENT && ctl->flush)
            {
                report_build(stdout, 
                             GT_("skipping message %s@%s:%d"),
@@ -810,16 +807,11 @@ flagthemail:
        }
        else
        {
-           if (   (outlevel >= O_VERBOSE) ||
-                       /* To avoid flooding the syslog when using --keep,
-                        * report "Skipped message" only when:
-                        *  1) --verbose is on, or
-                        *  2) fetchmail does not use syslog, or
-                        *  3) the message was skipped for some other
-                        *     reason than just being old.
-                        */
-                  (outlevel > O_SILENT && (!run.use_syslog || msgcode != MSGLEN_OLD))
-              )
+           /*
+            * To avoid flooding the logs when using --keep, report
+            * skipping of new messages only.
+            */
+           if (outlevel > O_SILENT && msgcode != MSGLEN_OLD)
            report_complete(stdout, GT_(" not flushed\n"));
 
            /* maybe we mark this message as seen now? */