]> Pileus Git - ~andy/fetchmail/commitdiff
Give fetchmailconf access to feature options.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 18 Oct 1998 17:00:21 +0000 (17:00 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 18 Oct 1998 17:00:21 +0000 (17:00 -0000)
svn path=/trunk/; revision=2108

NEWS
conf.c
fetchmailconf

diff --git a/NEWS b/NEWS
index 7b4aa60e7098b3ad226d31e669192eaa769732a8..2deccb6da97926bc9adae536ad6053153bf52400 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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.
 
diff --git a/conf.c b/conf.c
index f85e9f5885adfdc446e0d02e04e443a23779a056..0b112ab4db4360e9c6946da0820b3b5b57d62dc4 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -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('{');
 
index 22fddfd5131be43ab33fbb3dfa8cf14d5644eabc..005acc4d129516e65b8cb73978ab6a0022372e54 100755 (executable)
@@ -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