fetchmail-friends
[Top] [All Lists]

[fetchmail] [PATCH] flush oversized mail?

2002-12-18 15:24:44
fetchmail deletes oversized mail with the flush option!

$ fetchmail -l 10000 -F
...
IMAP> A0006 FETCH 1 RFC822.SIZE 
IMAP< * 1 FETCH (RFC822.SIZE 5750279) 
IMAP< A0006 OK FETCH completed. 
skipping message user(_at_)server:1 (5750279 octets) (oversized) flushed 
IMAP> A0007 STORE 1 +FLAGS (\Seen \Deleted) 
IMAP< * 1 FETCH (FLAGS (\Seen \Deleted)) 
IMAP< A0007 OK STORE completed. 

On top of that, fetchmail sends the oversized-messages warning saying
that that mail was skipped!

This patch should fix this:

=============================================================
diff -Naur fetchmail-6.2.0.orig/driver.c fetchmail-6.2.0/driver.c
--- fetchmail-6.2.0.orig/driver.c       Fri Dec 13 10:39:03 2002
+++ fetchmail-6.2.0/driver.c    Thu Dec 19 03:34:59 2002
@@ -416,7 +416,10 @@
        if (msgcodes[num-1] < 0)
        {
            if ((msgcodes[num-1] == MSGLEN_TOOLARGE) && !check_only)
+           {
                mark_oversized(ctl, num, msgsizes[num-1]);
+               suppress_delete = TRUE;
+           }
                /* To avoid flooding the syslog when using --keep,
                 * report "Skipped message" only when:
                 *  1) --verbose is on, or
@@ -682,7 +685,8 @@
        }
        else if (ctl->server.base_protocol->delete
                 && !suppress_delete
-                && ((msgcodes[num-1] >= 0) ? !ctl->keep : ctl->flush))
+                && ((msgcodes[num-1] >= 0 && !ctl->keep)
+                    || (msgcodes[num-1] == MSGLEN_OLD && ctl->flush)))
        {
            (*deletions)++;
            if (outlevel > O_SILENT) 
=============================================================

Sunil Shetye.

<Prev in Thread] Current Thread [Next in Thread>