#!/usr/bin/python # # A GUI configurator for generating Fetchmail configuration files. from Tkinter import * from Dialog import * import sys import time import os import string # # Define the data structures the GUIs will be tossing around # class Controls: def __init__(self): self.foreground = FALSE # Run in background self.daemon = 300 # Default to 5-minute timeout self.syslog = FALSE # Use syslogd for logging? self.logfile = None # No logfile, initially self.invisible = FALSE # Suppress Received line & spoof? def __repr__(self): str = ""; if self.syslog: str = str + ("set syslog\n") elif self.logfile: str = str + ("set logfile \"%s\"\n" % (self.logfile,)); if not self.foreground and self.daemon: str = str + ("set daemon %s\n" % (self.daemon,)) return str + "\n" def __str__(self): return "[Server: " + repr(self) + "]" 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 = 'password' # Default to password authentication self.timeout = 300 # 5-minute timeout self.envelope = 'Received' # Envelope-address header self.qvirtual = '' # 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.userlist = [] # List of user entries for site self.typemap = ( ('pollname', 'String'), ('via', 'String'), ('active', 'Boolean'), ('interval', 'Int'), ('protocol', 'String'), ('interval', 'Int'), ('port', 'Int'), ('uidl', 'Boolean'), ('auth', 'String'), ('timeout', 'Int'), ('envelope', 'String'), ('qvirtual', 'String'), # leave aka out ('dns', 'Boolean'), # leave localdomains out ('interface', 'String'), ('monitor', 'String')) def dump(self, folded): str = "" if self.active: str = str + "poll" else: str = str + "skip" str = str + (" " + self.pollname) if self.via != self.pollname: str = str + " via " + self.via if self.protocol != ServerDefaults.protocol: str = str + " with proto " + self.protocol if self.port != defaultports[self.protocol]: str = str + " port " + `self.port` if self.timeout != ServerDefaults.timeout: str = str + " timeout " + `self.timeout` if self.interval != ServerDefaults.interval: str = str + " interval " + `self.interval` if self.envelope != ServerDefaults.envelope: str = str + " envelope " + self.envelope if self.qvirtual != ServerDefaults.qvirtual: str = str + " qvirtual " + self.qvirtual if self.auth != ServerDefaults.auth: str = str + " auth " + self.auth if self.dns != ServerDefaults.dns or self.uidl != ServerDefaults.uidl: str = str + " and options" if self.dns != ServerDefaults.dns: str = str + flag2str(self.dns, 'dns') if self.uidl != ServerDefaults.uidl: str = str + flag2str(self.uidl, 'uidl') if folded: str = str + "\n\t" else: str = str + " " if self.aka: str = str + "aka" for x in self.aka: str = str + " " + x if self.aka and self.localdomains: str = str + " " if self.localdomains: str = str + ("localdomains") for x in self.localdomains: str = str + " " + x if (self.aka or self.localdomains): if folded: str = str + "\n\t" else: str = str + " " if self.interface: str = str + " interface " + self.interface if self.monitor: str = str + " monitor " + self.monitor if (self.interface or self.monitor): if folded: str = str + "\n" if str[-1] == "\t": str = str[0:-1] return str; def __repr__(self): return self.dump(TRUE) def __str__(self): return "[Server: " + self.dump(FALSE) + "]" class User: def __init__(self): self.remote = "" # Remote username self.localnames = None # Local names self.password = "" # Password for mail account access self.folder = "" # Remote folder to retrieve from self.smtphost = 'localhost' # Host to forward to self.mda = "" # Mail Delive
README.packaging
================
fetchmail 6.3 changes relevant for packagers
--------------------------------------------
Greetings, dear packager!
The bullet points below mention a few useful hints for package(r)s:
- Please use OpenSSL and add --with-ssl to the ./configure command line.
SSL/TLS support hasn't been enabled in the default build in order to maintain
fetchmail 6.2 compatibility as far as possible. SSL/TLS however is a highly
recommended compilation option.
- Fetchmail now uses automake and supports all common automake targets and
overrides such as "make install-strip" or "DESTDIR=..." for staging areas.
- The fetchmailconf script has been renamed to fetchmailconf.py, automake will
install it into Python's top-level site-packages directory and byte-compile
it (so you need to package or remove fetchmailconf.pyc and fetchmailconf.pyo
as well).
- If you want to defeat Python byte-code compilation and would rather like to
install fetchmailconf.py yourself, you can add
PYTHON=:
to the ./configure command or pass this in the environment. This pretends
that no Python interpreter were installed.
- The Makefile generates a two-line "fetchmailconf" /bin/sh wrapper script that
executes the actual fetchmailconf.py with the python installation found at
configuration time, so that users can still type "fetchmailconf" rather than
"python fetchmailconf".
- Note that fetchmailconf.py supports a few command line arguments, so if you
use local wrapper scripts, be sure they pass on their own arguments properly.
Remember to use "$@" (with quotes) in shells, not $*.
- There is now a dummy fetchmailconf manual page which will just source (roff's
".so" command) the fetchmail manual page for now. You can of course keep your
symlinks in place and ignore this dummy. IF you install the dummy and
compress your man pages, be sure to test "man fetchmailconf", on some
systems, you'll need to adjust the ".so" command to point to the compressed
version.