diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | conf.c | 49 | ||||
-rwxr-xr-x | fetchmailconf | 21 |
3 files changed, 68 insertions, 5 deletions
@@ -3,6 +3,9 @@ fetchmail-4.6.3 (): * Introduced `debug' verbosity, invocable by -v -v. * Make authentication failures more visible by syslogging them. +* fetchmailconf now has access to information about which fetchmail + compile-time options have been enabled, and uses it to control + the choices in various panels. There are 252 people on fetchmail-friends and 295 on fetchmail-announce. @@ -129,7 +129,54 @@ void dump_config(struct runctl *runp, struct query *querylist) fputs("from Tkinter import TRUE, FALSE\n\n", stdout); - fputs("# Start of initializer\n", stdout); + /* + * We need this in order to know whether `interface' and `monitor' + * are valid options or not. + */ +#ifdef linux + fputs("os_type = 'linux'\n", stdout); +#else + fputs("os_type = 'generic'\n", stdout); +#endif + + /* + * This should be approximately in sync with the -V option dumping + * in fetchmail.c. + */ + printf("feature_options = ("); +#ifdef POP2_ENABLE + printf("'pop2',"); +#endif /* POP2_ENABLE */ +#ifdef POP3_ENABLE + printf("'pop3',"); +#endif /* POP3_ENABLE */ +#ifdef IMAP_ENABLE + printf("'imap',"); +#endif /* IMAP_ENABLE */ +#ifdef GSSAPI + printf("'imap-gss',"); +#endif /* GSSAPI */ +#ifdef RPA_ENABLE + printf("'rpa',"); +#endif /* RPA_ENABLE */ +#ifdef SDPS_ENABLE + printf("'sdps',"); +#endif /* SDPS_ENABLE */ +#ifdef ETRN_ENABLE + printf("'etrn',"); +#endif /* ETRN_ENABLE */ +#if OPIE + printf("'opie',"); +#endif /* OPIE */ +#if INET6 + printf("'inet6',"); +#endif /* INET6 */ +#if NET_SECURITY + printf("'netsec',"); +#endif /* NET_SECURITY */ + printf(")\n"); + + fputs("# Start of configuration initializer\n", stdout); fputs("fetchmailrc = ", stdout); indent('{'); diff --git a/fetchmailconf b/fetchmailconf index 22fddfd5..005acc4d 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -7,7 +7,7 @@ # # TO DO: Arrange for save and quit buttons to clean up all frames dependent # on the current ones. -version = "1.5" +version = "1.6" from Tkinter import * from Dialog import * @@ -310,8 +310,6 @@ defaultports = {"auto":0, "IMAP-K4":143, "ETRN":25} -protolist = ("auto", "POP2", "POP3", "APOP", "KPOP", "IMAP", "IMAP-K4", "ETRN") - authlist = ("password", "kerberos") listboxhelp = { @@ -870,6 +868,21 @@ class ServerEdit(Frame, MyWidget): command=lambda: helpwin(controlhelp)).pack(side=RIGHT) ctlwin.pack(fill=X) + # Compute the available protocols from the compile-time options + protolist = ['auto'] + if 'pop2' in feature_options: + protolist.append("POP2") + if 'pop3' in feature_options: + protolist = protolist + ["POP3", "APOP", "KPOP"] + if 'sdps' in feature_options: + protolist.append("SDPS") + if 'imap' in feature_options: + protolist.append("IMAP") + if 'imap-gss' in feature_options: + protolist.append("IMAP-K4") + if 'etrn' in feature_options: + protolist.append("ETRN") + protwin = Frame(leftwin, relief=RAISED, bd=5) Label(protwin, text="Protocol").pack(side=TOP) ButtonBar(protwin, '', @@ -918,7 +931,7 @@ class ServerEdit(Frame, MyWidget): self.server.localdomains, None, mdropwin, multihelp) mdropwin.pack(fill=X) - if 'interface' in dictmembers or 'monitor' in dictmembers or 'netsec' in dictmembers: + if os_type == 'linux' or 'netsec' in feature_options: 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 |