]> Pileus Git - ~andy/fetchmail/blobdiff - fetchmailconf.py
Avoid compiling empty files, to avoid diagnostics from strict compilers.
[~andy/fetchmail] / fetchmailconf.py
index 571e18fbbc8ba26a9bb25c0765906c9f20e8c8b2..41c4d398ac3ced4b055799f7208aaba7b15fb5e0 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.49"
+version = "1.52 $Revision$"
 
 from Tkinter import *
 from Dialog import *
@@ -249,7 +249,7 @@ class User:
        self.warnings = 3600    # Size warning interval (see tunable.h)
        self.fetchlimit = 0     # Max messages fetched per batch
        self.fetchsizelimit = 100       # Max message sizes fetched per transaction
-       self.fastuidl = 10      # Do fast uidl 9 out of 10 times
+       self.fastuidl = 4       # Do fast uidl 3 out of 4 times
        self.batchlimit = 0     # Max message forwarded per batch
        self.expunge = 0        # Interval between expunges (IMAP)
        self.ssl = 0            # Enable Seccure Socket Layer
@@ -666,9 +666,12 @@ needed to create a simple fetchmail setup.  These include:
 
 4. A protocol to use (POP, IMAP, ETRN, etc.)
 
-5. A polling interval.
+5. A poll interval in seconds.
+   If 0, fetchmail will run in the foreground once when started.
+   If > 0, fetchmail will run in the background and start a new poll
+   cycle after the interval has elapsed.
 
-6. Options to fetch old messages as well as new, uor to suppress
+6. Options to fetch old messages as well as new, or to suppress
    deletion of fetched message.
 
 The novice-configuration code will assume that you want to forward mail
@@ -1436,13 +1439,6 @@ with your dollars for a server that isn't brain-dead.  If you stick
 with code as shoddy as GroupWise seems to be, you will probably pay
 for it with other problems.<p>
 
-"""
-           if string.find(greetline, "Netscape IMAP4rev1 Service 3.6") > 0:
-               warnings = warnings + """
-This server violates the RFC2060 requirement that a BODY[TEXT] fetch should
-set the messages's Seen flag.  As a result, if you use the keep option the
-same messages will be downloaded over and over.
-
 """
            if string.find(greetline, "InterChange") > 0:
                warnings = warnings + """
@@ -1515,6 +1511,7 @@ Fetchmail doesn't know anything special about this server type.
            title = "Autoprobe of " + realhost + " succeeded"
            confirm = "The " + protocol + " server said:\n\n" + greetline + warnings
            self.protocol.set(protocol)
+           self.service.set(defaultports[protocol])
        confwin.title(title)
        confwin.iconname(title)
        Label(confwin, text=title).pack()
@@ -2038,20 +2035,32 @@ gUSiYASJpMEHhilJTEnhAlGoQqYAZQ1AiqEMZ0jDGtqQImhwwA13yMMevoQAGvGhEAWHGMOAAAA7
 #
 
     # Process options
-    (options, arguments) = getopt.getopt(sys.argv[1:], "df:h")
+    (options, arguments) = getopt.getopt(sys.argv[1:], "df:hV", ["help",
+           "version"])
     dump = rcfile = None;
     for (switch, val) in options:
        if (switch == '-d'):
            dump = TRUE
        elif (switch == '-f'):
            rcfile = val
-       elif (switch == '-h'):
+       elif (switch == '-h' or switch == '--help'):
            print """
-Usage: fetchmailconf [-d] [-f fetchmailrc]
--d       - dump configuration (for debugging)
--f fmrc  - read alternate fetchmailrc file
+Usage: fetchmailconf {[-d] [-f fetchmailrc]|-h|--help|-V|--version}
+           -d      - dump configuration (for debugging)
+           -f fmrc - read alternate fetchmailrc file
+--help,    -h      - print this help text and quit
+--version, -V      - print fetchmailconf version and quit
 """
            sys.exit(0)
+       elif (switch == '-V' or switch == '--version'):
+           print "fetchmailconf %s" % version
+           print """
+Copyright (C) 1997 - 2003 Eric S. Raymond
+Copyright (C) 2005 - 2006 Matthias Andree
+fetchmailconf comes with ABSOLUTELY NO WARRANTY.  This is free software, you are
+welcome to redistribute it under certain conditions.  Please see the file
+COPYING in the source or documentation directory for details.  """
+           sys.exit(0)
 
     # Get client host's FQDN
     hostname = socket.gethostbyaddr(socket.gethostname())[0]