#!/usr/bin/env python
#
# A GUI configurator for generating fetchmail configuration files.
-# by Eric S. Raymond, <esr@snark.thyrsus.com>.
+# by Eric S. Raymond, <esr@snark.thyrsus.com>,
+# Matthias Andree <matthias.andree@gmx.de>
# Requires Python with Tkinter, and the following OS-dependent services:
-# posix, posixpath, socket
-version = "1.43"
+# posix, posixpath, socket
+version = "1.44"
from Tkinter import *
from Dialog import *
self.syslog = FALSE # Use syslogd for logging?
self.servers = [] # List of included sites
Configuration.typemap = (
- ('poll_interval', 'Int'),
+ ('poll_interval', 'Int'),
('logfile', 'String'),
('idfile', 'String'),
- ('postmaster', 'String'),
- ('bouncemail', 'Boolean'),
- ('spambounce', 'Boolean'),
- ('properties', 'String'),
+ ('postmaster', 'String'),
+ ('bouncemail', 'Boolean'),
+ ('spambounce', 'Boolean'),
+ ('properties', 'String'),
('syslog', 'Boolean'),
- ('invisible', 'Boolean'))
+ ('invisible', 'Boolean'))
def __repr__(self):
str = "";
class Server:
def __init__(self):
- self.pollname = None # Poll label
- self.via = None # True name of host
- self.active = TRUE # Poll status
- self.interval = 0 # Skip interval
- self.protocol = 'auto' # Default to auto protocol
- self.port = 0 # Port number to use
- self.uidl = FALSE # Don't use RFC1725 UIDLs by default
- self.auth = 'any' # Default to password authentication
- self.timeout = 300 # 5-minute timeout
- self.envelope = 'Received' # Envelope-address header
- self.envskip = 0 # Number of envelope headers to skip
- self.qvirtual = None # Name prefix to strip
- self.aka = [] # List of DNS aka names
- self.dns = TRUE # Enable DNS lookup on multidrop
- self.localdomains = [] # Domains to be considered local
- self.interface = None # IP address and range
- self.monitor = None # IP address and range
- self.plugin = None # Plugin command for going to server
- self.plugout = None # Plugin command for going to listener
- self.netsec = None # IPV6 security options
- self.principal = None # Kerberos principal
- self.esmtpname = None # ESMTP 2554 name
- self.esmtppassword = None # ESMTP 2554 password
- self.tracepolls = FALSE # Add trace-poll info to headers
- self.users = [] # List of user entries for site
+ self.pollname = None # Poll label
+ self.via = None # True name of host
+ self.active = TRUE # Poll status
+ self.interval = 0 # Skip interval
+ self.protocol = 'auto' # Default to auto protocol
+ self.port = 0 # Port number to use
+ self.uidl = FALSE # Don't use RFC1725 UIDLs by default
+ self.auth = 'any' # Default to password authentication
+ self.timeout = 300 # 5-minute timeout
+ self.envelope = 'Received' # Envelope-address header
+ self.envskip = 0 # Number of envelope headers to skip
+ self.qvirtual = None # Name prefix to strip
+ self.aka = [] # List of DNS aka names
+ self.dns = TRUE # Enable DNS lookup on multidrop
+ self.localdomains = [] # Domains to be considered local
+ self.interface = None # IP address and range
+ self.monitor = None # IP address and range
+ self.plugin = None # Plugin command for going to server
+ self.plugout = None # Plugin command for going to listener
+ self.principal = None # Kerberos principal
+ self.esmtpname = None # ESMTP 2554 name
+ self.esmtppassword = None # ESMTP 2554 password
+ self.tracepolls = FALSE # Add trace-poll info to headers
+ self.users = [] # List of user entries for site
Server.typemap = (
('pollname', 'String'),
- ('via', 'String'),
- ('active', 'Boolean'),
+ ('via', 'String'),
+ ('active', 'Boolean'),
('interval', 'Int'),
('protocol', 'String'),
- ('port', 'Int'),
- ('uidl', 'Boolean'),
- ('auth', 'String'),
+ ('port', 'Int'),
+ ('uidl', 'Boolean'),
+ ('auth', 'String'),
('timeout', 'Int'),
('envelope', 'String'),
('envskip', 'Int'),
('qvirtual', 'String'),
# leave aka out
- ('dns', 'Boolean'),
+ ('dns', 'Boolean'),
# leave localdomains out
('interface', 'String'),
('monitor', 'String'),
- ('plugin', 'String'),
+ ('plugin', 'String'),
('plugout', 'String'),
- ('esmtpname', 'String'),
- ('esmtppassword', 'String'),
- ('netsec', 'String'),
+ ('esmtpname', 'String'),
+ ('esmtppassword', 'String'),
('principal', 'String'),
('tracepolls','Boolean'))
if self.via:
res = res + (" via " + str(self.via) + "\n");
if self.protocol != ServerDefaults.protocol:
- res = res + " with proto " + self.protocol
+ res = res + " with proto " + self.protocol
if self.port != defaultports[self.protocol] and self.port:
res = res + " port " + `self.port`
if self.timeout != ServerDefaults.timeout:
res = res + " timeout " + `self.timeout`
- if self.interval != ServerDefaults.interval:
+ if self.interval != ServerDefaults.interval:
res = res + " interval " + `self.interval`
if self.envelope != ServerDefaults.envelope or self.envskip != ServerDefaults.envskip:
if self.envskip:
res = res + " plugin " + `self.plugin`
if self.plugout:
res = res + " plugout " + `self.plugout`
- if self.netsec:
- res = res + " netsec " + str(self.netsec)
if self.principal:
res = res + " principal " + `self.principal`
if self.esmtpname:
res = res + " esmtpname " + `self.esmtpname`
if self.esmtppassword:
res = res + " esmtppassword " + `self.esmtppassword`
- if self.interface or self.monitor or self.netsec or self.principal or self.plugin or self.plugout:
+ if self.interface or self.monitor or self.principal or self.plugin or self.plugout:
if folded:
res = res + "\n"
class User:
def __init__(self):
if os.environ.has_key("USER"):
- self.remote = os.environ["USER"] # Remote username
+ self.remote = os.environ["USER"] # Remote username
elif os.environ.has_key("LOGNAME"):
self.remote = os.environ["LOGNAME"]
else:
self.keep = FALSE # Keep messages
self.flush = FALSE # Flush messages
self.fetchall = FALSE # Fetch old messages
- self.rewrite = TRUE # Rewrite message headers
+ self.rewrite = TRUE # Rewrite message headers
self.forcecr = FALSE # Force LF -> CR/LF
self.stripcr = FALSE # Strip CR
self.pass8bits = FALSE # Force BODY=7BIT
self.sslproto = None # Force SSL?
self.sslcertck = 0 # Enable strict SSL cert checking
self.sslcertpath = None # Path to trusted certificates
- self.sslfingerprint = None # SSL key fingerprint to check
+ self.sslfingerprint = None # SSL key fingerprint to check
self.properties = None # Extension properties
User.typemap = (
- ('remote', 'String'),
+ ('remote', 'String'),
# leave out mailboxes and localnames
('password', 'String'),
# Leave out smtphunt, fetchdomains
('preconnect', 'String'),
('postconnect', 'String'),
('mda', 'String'),
- ('bsmtp', 'String'),
+ ('bsmtp', 'String'),
('lmtp', 'Boolean'),
('antispam', 'String'),
('keep', 'Boolean'),
- ('flush', 'Boolean'),
+ ('flush', 'Boolean'),
('fetchall', 'Boolean'),
('rewrite', 'Boolean'),
('forcecr', 'Boolean'),
('dropstatus', 'Boolean'),
('dropdelivered', 'Boolean'),
('idle', 'Boolean'),
- ('limit', 'Int'),
+ ('limit', 'Int'),
('warnings', 'Int'),
('fetchlimit', 'Int'),
- ('fetchsizelimit', 'Int'),
+ ('fetchsizelimit', 'Int'),
('fastuidl', 'Int'),
('batchlimit', 'Int'),
('expunge', 'Int'),
('ssl', 'Boolean'),
- ('sslkey', 'String'),
+ ('sslkey', 'String'),
('sslcert', 'String'),
('sslcertck', 'Boolean'),
('sslcertpath', 'String'),
if (self.keep != UserDefaults.keep
or self.flush != UserDefaults.flush
or self.fetchall != UserDefaults.fetchall
- or self.rewrite != UserDefaults.rewrite
- or self.forcecr != UserDefaults.forcecr
- or self.stripcr != UserDefaults.stripcr
+ or self.rewrite != UserDefaults.rewrite
+ or self.forcecr != UserDefaults.forcecr
+ or self.stripcr != UserDefaults.stripcr
or self.pass8bits != UserDefaults.pass8bits
or self.mimedecode != UserDefaults.mimedecode
or self.dropstatus != UserDefaults.dropstatus
#
defaultports = {"auto":0,
- "POP2":109,
+ "POP2":109,
"POP3":110,
"APOP":110,
"KPOP":1109,
'title' : 'List Selection Help',
'banner': 'List Selection',
'text' : """
-You must select an item in the list box (by clicking on it).
+You must select an item in the list box (by clicking on it).
"""}
def flag2str(value, string):
ind = width * row + column
if ind < len(alternatives):
Radiobutton(subframe,
- {'text':alternatives[ind],
+ {'text':alternatives[ind],
'variable':ref,
'value':alternatives[ind],
'command':command}).pack(side=TOP, anchor=W)
def helpwin(helpdict):
# help message window with a self-destruct button
helpwin = Toplevel()
- helpwin.title(helpdict['title'])
+ helpwin.title(helpdict['title'])
helpwin.iconname(helpdict['title'])
Label(helpwin, text=helpdict['banner']).pack()
textframe = Frame(helpwin)
scroll.config(command=helpwin.textwidget.yview)
scroll.pack(side=RIGHT, fill=BOTH)
helpwin.textwidget.insert(END, helpdict['text']);
- Button(helpwin, text='Done',
+ Button(helpwin, text='Done',
command=lambda x=helpwin: x.destroy(), bd=2).pack()
textframe.pack(side=TOP)
pass
class ListEdit(Frame):
-# edit a list of values (duplicates not allowed) with a supplied editor hook
+# edit a list of values (duplicates not allowed) with a supplied editor hook
def __init__(self, newlegend, list, editor, deletor, master, helptxt):
self.editor = editor
self.deletor = deletor
apply(self.deletor, (label,))
def ConfirmQuit(frame, context):
- ans = Dialog(frame,
+ ans = Dialog(frame,
title = 'Quit?',
text = 'Really quit ' + context + ' without saving?',
bitmap = 'question',
self.master.title('fetchmail ' + self.mode + ' configurator');
self.master.iconname('fetchmail ' + self.mode + ' configurator');
self.master.protocol('WM_DELETE_WINDOW', self.nosave)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
Pack.config(self)
self.post(Configuration, 'configuration')
gf = Frame(self, relief=RAISED, bd = 5)
Label(gf,
- text='Fetchmail Run Controls',
+ text='Fetchmail Run Controls',
bd=2).pack(side=TOP, pady=10)
df = Frame(gf)
ff = Frame(df)
if self.mode != 'novice':
# Set the postmaster
- log = LabeledEntry(ff, ' Postmaster:', self.postmaster, '14')
+ log = LabeledEntry(ff, ' Postmaster:', self.postmaster, '14')
log.pack(side=RIGHT, anchor=E)
# Set the poll interval
{'text':'Log to syslog?',
'variable':self.syslog,
'relief':GROOVE}).pack(side=LEFT, anchor=W)
- log = LabeledEntry(sf, ' Logfile:', self.logfile, '14')
+ log = LabeledEntry(sf, ' Logfile:', self.logfile, '14')
log.pack(side=RIGHT, anchor=E)
sf.pack(fill=X)
'variable':self.invisible,
'relief':GROOVE}).pack(side=LEFT, anchor=W)
# Set the idfile
- log = LabeledEntry(gf, ' Idfile:', self.idfile, '14')
+ log = LabeledEntry(gf, ' Idfile:', self.idfile, '14')
log.pack(side=RIGHT, anchor=E)
gf.pack(fill=X)
# Expert mode allows us to edit multiple sites
lf = Frame(self, relief=RAISED, bd=5)
Label(lf,
- text='Remote Mail Server Configurations',
+ text='Remote Mail Server Configurations',
bd=2).pack(side=TOP, pady=10)
- ListEdit('New Server:',
+ ListEdit('New Server:',
map(lambda x: x.pollname, self.configuration.servers),
lambda site, self=self: self.server_edit(site),
lambda site, self=self: self.server_delete(site),
def destruct(self):
for sitename in self.subwidgets.keys():
- self.subwidgets[sitename].destruct()
+ self.subwidgets[sitename].destruct()
self.master.destroy()
self.onexit()
fm = None
if not self.outfile:
fm = sys.stdout
- elif not os.path.isfile(self.outfile) or Dialog(self,
+ elif not os.path.isfile(self.outfile) or Dialog(self,
title = 'Overwrite existing run control file?',
text = 'Really overwrite existing run control file?',
bitmap = 'question',
'title' : 'Remote site help',
'banner': 'Remote sites',
'text' : """
-When you add a site name to the list here,
+When you add a site name to the list here,
you initialize an entry telling fetchmail
how to poll a new site.
'title' : 'Server options help',
'banner': 'Server Options',
'text' : """
-The server options screen controls fetchmail
+The server options screen controls fetchmail
options that apply to one of your mailservers.
Once you have a mailserver configuration set
store it in the server list maintained in
the main configuration window.
-If you wish to discard changes to a server
+If you wish to discard changes to a server
configuration, select `Quit'.
"""}
The `True name of server' box should specify the actual DNS name
to query. By default this is the same as the poll name.
-Normally each host described in the file is queried once each
+Normally each host described in the file is queried once each
poll cycle. If `Cycles to skip between polls' is greater than 0,
that's the number of poll cycles that are skipped between the
times this post is actually polled.
frequently supported.
The `Protocol' button bar offers you a choice of
-all the different protocols available. The `auto'
+all the different protocols available. The `auto'
protocol is the default mode; it probes the host
ports for POP3 and IMAP to see if either is
available.
-Normally the TCP/IP service port to use is
+Normally the TCP/IP service port to use is
dictated by the protocol choice. The `Port'
field (only present in expert mode) lets you
set a non-standard port.
certificates (and sslcertpath gives trusted certificate
directory). With sslfingerprint, you can specify a finger-
print the server's key is checked against.
-
-The `netsec' option will be configurable only if fetchmail
-was compiled with IPV6 support. If you need to use it,
-you probably know what to do.
"""}
multihelp = {
'title' : 'User list help',
'banner': 'User list',
'text' : """
-When you add a user name to the list here,
+When you add a user name to the list here,
you initialize an entry telling fetchmail
to poll the site on behalf of the new user.
self.master.iconname('Fetchmail host ' + self.server.pollname);
self.post(Server, 'server')
self.makeWidgets(self.server.pollname, mode)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
-# self.grab_set()
-# self.focus_set()
-# self.wait_window()
+# self.grab_set()
+# self.focus_set()
+# self.wait_window()
return self
def destruct(self):
for username in self.subwidgets.keys():
- self.subwidgets[username].destruct()
+ self.subwidgets[username].destruct()
del self.parent.subwidgets[self.server.pollname]
self.master.destroy()
def save(self):
self.fetch(Server, 'server')
for username in self.subwidgets.keys():
- self.subwidgets[username].save()
+ self.subwidgets[username].save()
self.destruct()
def defaultPort(self):
# a custom port number you should be in expert mode and playing
# close enough attention to notice this...
self.port.set(defaultports[proto])
- if not proto in ("POP3", "APOP", "KPOP"): self.uidl.state = DISABLED
+ if not proto in ("POP3", "APOP", "KPOP"): self.uidl.state = DISABLED
def user_edit(self, username, mode):
self.subwidgets[username] = UserEdit(username, self).edit(mode, Toplevel())
Label(protwin, text="Protocol").pack(side=TOP)
ButtonBar(protwin, '',
self.protocol, protolist, 2,
- self.defaultPort)
+ self.defaultPort)
if mode != 'novice':
LabeledEntry(protwin, 'On server TCP/IP port:',
self.port, leftwidth).pack(side=TOP, fill=X)
self.defaultPort()
Checkbutton(protwin,
text="POP3: track `seen' with client-side UIDLs?",
- variable=self.uidl).pack(side=TOP)
+ variable=self.uidl).pack(side=TOP)
Button(protwin, text='Probe for supported protocols', fg='blue',
command=self.autoprobe).pack(side=LEFT)
Button(protwin, text='Help', fg='blue',
self.server.localdomains, None, None, mdropwin, multihelp)
mdropwin.pack(fill=X)
- if os_type in ('linux', 'freebsd') or 'netsec' in feature_options:
+ if os_type in ('linux', 'freebsd'):
secwin = Frame(rightwin, relief=RAISED, bd=5)
Label(secwin, text="Security").pack(side=TOP)
# Don't actually let users set this. KPOP sets it implicitly
- # ButtonBar(secwin, 'Authorization mode:',
+ # ButtonBar(secwin, 'Authorization mode:',
# self.auth, authlist, 1, None).pack(side=TOP)
if os_type == 'linux' or os_type == 'freebsd' or 'interface' in dictmembers:
LabeledEntry(secwin, 'IP range to check before poll:',
if os_type == 'linux' or os_type == 'freebsd' or 'monitor' in dictmembers:
LabeledEntry(secwin, 'Interface to monitor:',
self.monitor, leftwidth).pack(side=TOP, fill=X)
- if 'netsec' in feature_options or 'netsec' in dictmembers:
- LabeledEntry(secwin, 'IPV6 security options:',
- self.netsec, leftwidth).pack(side=TOP, fill=X)
# Someday this should handle Kerberos 5 too
if 'kerberos' in feature_options:
LabeledEntry(secwin, 'Principal:',
self.principal, '12').pack(side=TOP, fill=X)
- # ESMTP authentication
- LabeledEntry(secwin, 'ESMTP name:',
- self.esmtpname, '12').pack(side=TOP, fill=X)
- LabeledEntry(secwin, 'ESMTP password:',
- self.esmtppassword, '12').pack(side=TOP, fill=X)
+ # ESMTP authentication
+ LabeledEntry(secwin, 'ESMTP name:',
+ self.esmtpname, '12').pack(side=TOP, fill=X)
+ LabeledEntry(secwin, 'ESMTP password:',
+ self.esmtppassword, '12').pack(side=TOP, fill=X)
Button(secwin, text='Help', fg='blue',
command=lambda: helpwin(sechelp)).pack(side=RIGHT)
secwin.pack(fill=X)
for (protocol, port) in (("IMAP",143), ("POP3",110), ("POP2",109)):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
- sock.connect((realhost, port))
+ sock.connect((realhost, port))
greetline = sock.recv(1024)
sock.close()
except:
dangerously unreliable (among other problems, they may drop your mailbox
on the floor if your connection is interrupted during the session).
-It is strongly recommended that you find a better POP3 server. The fetchmail
+It is strongly recommended that you find a better POP3 server. The fetchmail
FAQ includes pointers to good ones.
"""
# that internally cucipop does allocate a certain data structure in
# multiples of 16, using realloc() to bump it up to the next
# multiple if it needs more.
-#
+#
# The distinctive symptom is that when there are 16 messages in the
# inbox, you can RETR and DELE all 16 messages successfully, but on
# QUIT cucipop returns something like "-ERR Error locking your
# mailbox" and aborts without updating it.
-#
+#
# The cucipop banner looks like:
-#
+#
# +OK Cubic Circle's v1.31 1998/05/13 POP3 ready <6229000062f95036@wakko>
#
if string.find(greetline, "Cubic Circle") > 0:
"""
if string.find(greetline, " geonet.de") > 0:
warnings = warnings + """
-You appear to be using geonet. As of late 2002, the TOP command on
+You appear to be using geonet. As of late 2002, the TOP command on
geonet's POP3 is broken. Use the fetchall option.
"""
OpenMail do not process the "TOP" command correctly; the symptom is that
only the header and first line of each message is retrieved. To work
around this bug, turn on `fetchall' on all user entries associated with
-this server.
+this server.
"""
if string.find(greetline, "Escape character is") > 0:
You appear to be using a SpryNet server. In mid-1999 it was reported that
the SpryNet TOP command marks messages seen. Therefore, for proper error
recovery in the event of a line drop, it is strongly recommended that you
-turn on `fetchall' on all user entries associated with this server.
+turn on `fetchall' on all user entries associated with this server.
"""
if string.find(greetline, "TEMS POP3") > 0:
Turning on fetchall will disable the use of TOP.
Therefore, it is strongly recommended that you turn on `fetchall' on all
-user entries associated with this server.
+user entries associated with this server.
"""
if string.find(greetline, " Novonyx POP3") > 0:
Some servers issuing the greeting line 'IMS POP3' have been known to
do byte-stuffing incorrectly. This means that if a message you receive
has a . (period) at start of line, fetchmail will become confused and
-probably wedge itself. (This bug was recorded on IMS POP3 0.86.)
+probably wedge itself. (This bug was recorded on IMS POP3 0.86.)
"""
### Checks for protocol variants start here
closebrak = string.find(greetline, ">")
- if closebrak > 0 and greetline[closebrak+1] == "\r":
+ if closebrak > 0 and greetline[closebrak+1] == "\r":
warnings = warnings + """
It looks like you could use APOP on this server and avoid sending it your
password in clear. You should talk to the mailserver administrator about
if string.find(greetline, "IMAP2bis") > 0:
warnings = warnings + """
IMAP2bis servers have a minor problem; they can't peek at messages without
-marking them seen. If you take a line hit during the retrieval, the
+marking them seen. If you take a line hit during the retrieval, the
interrupted message may get left on the server, marked seen.
To work around this, it is recommended that you set the `fetchall'
"""
if string.find(greetline, "IMAP4rev1") > 0:
warnings = warnings + """
-I see an IMAP4rev1 server. Excellent. This is (a) the best kind of
-remote-mail server, and (b) the one the fetchmail author uses. Fetchmail
+I see an IMAP4rev1 server. Excellent. This is (a) the best kind of
+remote-mail server, and (b) the one the fetchmail author uses. Fetchmail
has therefore been extremely well tested with this class of server.
"""
title = "Autoprobe of " + realhost + " succeeded"
confirm = "The " + protocol + " server said:\n\n" + greetline + warnings
self.protocol.set(protocol)
- confwin.title(title)
+ confwin.title(title)
confwin.iconname(title)
Label(confwin, text=title).pack()
Message(confwin, text=confirm, width=600).pack()
- Button(confwin, text='Done',
+ Button(confwin, text='Done',
command=lambda x=confwin: x.destroy(), bd=2).pack()
-
+
#
# User editing stuff
#
self.master.iconname('Fetchmail user ' + self.user.remote);
self.post(User, 'user')
self.makeWidgets(mode, self.parent.server.pollname)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
-# self.grab_set()
-# self.focus_set()
-# self.wait_window()
+# self.grab_set()
+# self.focus_set()
+# self.wait_window()
return self
def destruct(self):
def save(self):
ok = 0
for x in self.user.localnames: ok = ok + (string.find(x, '@') != -1)
- if ok == 0 or Dialog(self,
+ if ok == 0 or Dialog(self,
title = "Really accept an embedded '@' ?",
- text = "Local names with an embedded '@', such as in foo@bar "
+ text = "Local names with an embedded '@', such as in foo@bar "
"might result in your mail being sent to foo@bar.com "
"instead of your local system.\n Are you sure you want "
"a local user name with an '@' in it?",
Checkbutton(optwin, text="Fetch old messages as well as new",
variable=self.fetchall).pack(side=TOP, anchor=W)
if mode != 'novice':
- Checkbutton(optwin, text="Flush seen messages before retrieval",
+ Checkbutton(optwin, text="Flush seen messages before retrieval",
variable=self.flush).pack(side=TOP, anchor=W)
- Checkbutton(optwin, text="Rewrite To/Cc/Bcc messages to enable reply",
+ Checkbutton(optwin, text="Rewrite To/Cc/Bcc messages to enable reply",
variable=self.rewrite).pack(side=TOP, anchor=W)
Checkbutton(optwin, text="Force CR/LF at end of each line",
variable=self.forcecr).pack(side=TOP, anchor=W)
variable=self.pass8bits).pack(side=TOP, anchor=W)
Checkbutton(optwin, text="Undo MIME armoring on header and body",
variable=self.mimedecode).pack(side=TOP, anchor=W)
- Checkbutton(optwin, text="Drop Status lines from forwarded messages",
+ Checkbutton(optwin, text="Drop Status lines from forwarded messages",
variable=self.dropstatus).pack(side=TOP, anchor=W)
- Checkbutton(optwin, text="Drop Delivered-To lines from forwarded messages",
+ Checkbutton(optwin, text="Drop Delivered-To lines from forwarded messages",
variable=self.dropdelivered).pack(side=TOP, anchor=W)
optwin.pack(fill=X)
if self.parent.server.protocol not in ('ETRN', 'ODMR'):
LabeledEntry(limwin, 'Interval between expunges:',
self.expunge, '30').pack(side=TOP, fill=X)
- Checkbutton(limwin, text="Idle after each poll (IMAP only)",
+ Checkbutton(limwin, text="Idle after each poll (IMAP only)",
variable=self.idle).pack(side=TOP, anchor=W)
limwin.pack(fill=X)
self.master.title('fetchmail configurator');
self.master.iconname('fetchmail configurator');
Pack.config(self)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
Message(self, text="""
self.master.iconname('fetchmail run window');
Pack.config(self)
Label(self,
- text="Running "+command,
+ text="Running "+command,
bd=2).pack(side=TOP, pady=10)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
# This is a scrolling text window
Button(self, text='Quit', fg='blue', command=self.leave).pack()
- self.update() # Draw widget before executing fetchmail
+ self.update() # Draw widget before executing fetchmail
# Always look for a runnable command in the directory we're running in
- # first. This avoids some obscure version-skew errors that can occur
+ # first. This avoids some obscure version-skew errors that can occur
# if you pick up an old fetchmail from the standard system locations.
os.environ["PATH"] = os.path.dirname(sys.argv[0]) + ":" + os.environ["PATH"]
child_stdout = os.popen(command + " 2>&1", "r")
self.master.iconname('fetchmail launcher');
Pack.config(self)
Label(self,
- text='Fetchmailconf ' + version,
+ text='Fetchmailconf ' + version,
bd=2).pack(side=TOP, pady=10)
- self.keepalive = [] # Use this to anchor the PhotoImage object
+ self.keepalive = [] # Use this to anchor the PhotoImage object
make_icon_window(self, fetchmail_icon)
self.debug = 0
# conformability checking; they'll still get copied if they are
# present in the dictionary.
optional = ('interface', 'monitor',
- 'netsec', 'esmtpname', 'esmtppassword',
+ 'esmtpname', 'esmtppassword',
'ssl', 'sslkey', 'sslcert', 'sslproto', 'sslcertck',
'sslcertpath', 'sslfingerprint', 'showdots')
class_sig = setdiff(toclass.__dict__.keys(), optional)
dict_keys = setdiff(fromdict.keys(), optional)
dict_keys.sort()
common = intersect(class_sig, dict_keys)
- if 'typemap' in class_sig:
+ if 'typemap' in class_sig:
class_sig.remove('typemap')
if tuple(class_sig) != tuple(dict_keys):
print "Fields don't match what fetchmailconf expected:"
-# print "Class signature: " + `class_sig`
-# print "Dictionary keys: " + `dict_keys`
+# print "Class signature: " + `class_sig`
+# print "Dictionary keys: " + `dict_keys`
diff = setdiff(class_sig, common)
if diff:
print "Not matched in class `" + toclass.__class__.__name__ + "' signature: " + `diff`
setattr(toclass, x, fromdict[x])
#
-# And this is the main sequence. How it works:
+# And this is the main sequence. How it works:
#
# First, call `fetchmail --configdump' and trap the output in a tempfile.
# This should fill it with a Python initializer for a variable `fetchmailrc'.
# the edited result to stdout as well.
# -f: specify the run control file to read.
-if __name__ == '__main__':
+if __name__ == '__main__':
if not os.environ.has_key("DISPLAY"):
print "fetchmailconf must be run under X"
cmd = "umask 077; fetchmail -f " + rcfile + " --configdump --nosyslog >" + tmpfile
else:
cmd = "umask 077; fetchmail --configdump --nosyslog >" + tmpfile
-
+
try:
s = os.system(cmd)
if s != 0:
print "Can't read configuration output of fetchmail --configdump."
os.remove(tmpfile)
sys.exit(1)
-
+
os.remove(tmpfile)
# The tricky part -- initializing objects from the configuration global
# `Configuration' is the top level of the object tree we're going to mung.
# The dictmembers list is used to track the set of fields the dictionary
# contains; in particular, we can use it to tell whether things like the
- # monitor, interface, netsec, ssl, sslkey, or sslcert fields are present.
+ # monitor, interface, ssl, sslkey, or sslcert fields are present.
dictmembers = []
Fetchmailrc = Configuration()
copy_instance(Fetchmailrc, fetchmailrc)