]> Pileus Git - ~andy/fetchmail/commitdiff
Added Retrieve Error Policy configuration to fetchmailconf.
authorCraig Brown <j.craig.brown@gmail.com>
Sun, 29 Aug 2010 06:01:11 +0000 (23:01 -0700)
committerCraig Brown <j.craig.brown@gmail.com>
Sun, 29 Aug 2010 06:01:11 +0000 (23:01 -0700)
conf.c
fetchmailconf.py

diff --git a/conf.c b/conf.c
index 6d629e7e6fc4d2caae2a5c6ce9d4bcd4ad44ac4d..5df700788a43bf703e4f9fcd4896074e8da1ca40 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -321,9 +321,9 @@ void dump_config(struct runctl *runp, struct query *querylist)
            }
 
            switch (ctl->server.retrieveerror) {
-               case RE_ABORT: stringdump("retrieve-error", "abort"); break;
-               case RE_CONTINUE: stringdump("retrieve-error", "continue"); break;
-               case RE_MARKSEEN: stringdump("retrieve-error", "markseen"); break;
+               case RE_ABORT: stringdump("retrieveerror", "abort"); break;
+               case RE_CONTINUE: stringdump("retrieveerror", "continue"); break;
+               case RE_MARKSEEN: stringdump("retrieveerror", "markseen"); break;
            }
 
            indent(0);
index 2dc02d875995b088dd49e2e84a89ae434e085074..aa224226257e18090438186c6dd79c0b848dd828 100755 (executable)
@@ -5,7 +5,7 @@
 # Matthias Andree <matthias.andree@gmx.de>
 # Requires Python with Tkinter, and the following OS-dependent services:
 #      posix, posixpath, socket
-version = "1.57"
+version = "1.58"
 
 from Tkinter import *
 from Dialog import *
@@ -106,6 +106,7 @@ class Server:
        self.esmtppassword = None       # ESMTP 2554 password
        self.tracepolls = FALSE         # Add trace-poll info to headers
        self.badheader = FALSE          # Pass messages with bad headers on?
+       self.retrieveerror = 'abort'    # Policy when message retrieval errors encountered
        self.users = []                 # List of user entries for site
        Server.typemap = (
            ('pollname',  'String'),
@@ -131,7 +132,8 @@ class Server:
            ('esmtppassword', 'String'),
            ('principal', 'String'),
            ('tracepolls','Boolean'),
-           ('badheader', 'Boolean'))
+           ('badheader', 'Boolean'),
+           ('retrieveerror', 'String'))
 
     def dump(self, folded):
        res = ""
@@ -203,6 +205,10 @@ class Server:
                res = res + "\n"
        if self.badheader:
                res = res + "bad-header accept "
+       if self.retrieveerror == 'continue':
+               res = res + "retrieve-error continue "
+       if self.retrieveerror == 'markseen':
+               res = res + "retrieve-error markseen "
 
        if res[-1] == " ": res = res[0:-1]
 
@@ -960,6 +966,13 @@ the normal operation of fetchmail when it is run with no arguments.
 If it is off, fetchmail will only query this host when it is given as
 a command-line argument.
 
+The `Retrieve Error Policy' specifies how server errors during
+message retrieval are handled.  The default behaviour is to abort the
+current session.  Both the continue and markseen options will skip
+the message with the error, but continue the session allowing for 
+downloading of subsequent messages.  Additionally, the markseen
+option will mark the skipped message as seen.
 The `True name of server' box should specify the actual DNS name
 to query. By default this is the same as the poll name.
 
@@ -1137,6 +1150,9 @@ class ServerEdit(Frame, MyWidget):
            Checkbutton(ctlwin, text='Poll ' + host + ' normally?', variable=self.active).pack(side=TOP)
            Checkbutton(ctlwin, text='Pass messages with bad headers?',
                    variable=self.badheader).pack(side=TOP)
+            retrieveerrorlist = ['abort', 'continue', 'markseen']
+            Label(ctlwin, text="Retrieve Error Policy").pack(side=TOP)
+            ButtonBar(ctlwin, '', self.retrieveerror, retrieveerrorlist, 1, None)
            LabeledEntry(ctlwin, 'True name of ' + host + ':',
                      self.via, leftwidth).pack(side=TOP, fill=X)
            LabeledEntry(ctlwin, 'Cycles to skip between polls:',