Add tcp_wrappers_daemon_name (closes: bug #278)
authorJohn Jetmore <jj33@pobox.com>
Sat, 12 Jun 2010 15:21:25 +0000 (15:21 +0000)
committerJohn Jetmore <jj33@pobox.com>
Sat, 12 Jun 2010 15:21:25 +0000 (15:21 +0000)
(I honestly have no memory of writing this patch...)

doc/doc-docbook/spec.xfpt
doc/doc-txt/ChangeLog
doc/doc-txt/NewStuff
doc/doc-txt/OptionLists.txt
src/src/EDITME
src/src/buildconfig.c
src/src/config.h.defaults
src/src/globals.c
src/src/globals.h
src/src/readconf.c
src/src/smtp_in.c

index 7d2ae02d2b07a3963984d61b647b0a8df17ce32b..14c1bf8d8c592b5f3d5b1f3ddad9060e700cf5e1 100644 (file)
@@ -1,4 +1,4 @@
-. $Cambridge: exim/doc/doc-docbook/spec.xfpt,v 1.86 2010/06/09 01:30:16 pdp Exp $
+. $Cambridge: exim/doc/doc-docbook/spec.xfpt,v 1.87 2010/06/12 15:21:25 jetmore Exp $
 .
 . /////////////////////////////////////////////////////////////////////////////
 . This is the primary source of the Exim Manual. It is an xfpt document that is
 .
 . /////////////////////////////////////////////////////////////////////////////
 . This is the primary source of the Exim Manual. It is an xfpt document that is
@@ -1896,6 +1896,8 @@ given in chapter &<<CHAPTLS>>&.
 .section "Use of tcpwrappers" "SECID27"
 .cindex "tcpwrappers, building Exim to support"
 .cindex "USE_TCP_WRAPPERS"
 .section "Use of tcpwrappers" "SECID27"
 .cindex "tcpwrappers, building Exim to support"
 .cindex "USE_TCP_WRAPPERS"
+.cindex "TCP_WRAPPERS_DAEMON_NAME"
+.cindex "tcp_wrappers_daemon_name"
 Exim can be linked with the &'tcpwrappers'& library in order to check incoming
 SMTP calls using the &'tcpwrappers'& control files. This may be a convenient
 alternative to Exim's own checking facilities for installations that are
 Exim can be linked with the &'tcpwrappers'& library in order to check incoming
 SMTP calls using the &'tcpwrappers'& control files. This may be a convenient
 alternative to Exim's own checking facilities for installations that are
@@ -1910,14 +1912,17 @@ USE_TCP_WRAPPERS=yes
 CFLAGS=-O -I/usr/local/include
 EXTRALIBS_EXIM=-L/usr/local/lib -lwrap
 .endd
 CFLAGS=-O -I/usr/local/include
 EXTRALIBS_EXIM=-L/usr/local/lib -lwrap
 .endd
-in &_Local/Makefile_&. The name to use in the &'tcpwrappers'& control files is
-&"exim"&. For example, the line
+in &_Local/Makefile_&. The daemon name to use in the &'tcpwrappers'& control
+files is &"exim"&. For example, the line
 .code
 exim : LOCAL  192.168.1.  .friendly.domain.example
 .endd
 in your &_/etc/hosts.allow_& file allows connections from the local host, from
 the subnet 192.168.1.0/24, and from all hosts in &'friendly.domain.example'&.
 .code
 exim : LOCAL  192.168.1.  .friendly.domain.example
 .endd
 in your &_/etc/hosts.allow_& file allows connections from the local host, from
 the subnet 192.168.1.0/24, and from all hosts in &'friendly.domain.example'&.
-All other connections are denied. Consult the &'tcpwrappers'& documentation for
+All other connections are denied. The daemon name used by &'tcpwrappers'&
+can be changed at build time by setting TCP_WRAPPERS_DAEMON_NAME in
+in &_Local/Makefile_&, or by setting tcp_wrappers_daemon_name in the
+configure file. Consult the &'tcpwrappers'& documentation for
 further details.
 
 
 further details.
 
 
index f486e025b4b36754f5bfc027d82217b32ade536f..b0e013c46de439a4092f5a72fa7017690bd163e7 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.631 2010/06/09 01:30:16 pdp Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.632 2010/06/12 15:21:25 jetmore Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -50,6 +50,10 @@ PP/16 Add bool_lax{} expansion operator and use that for combining multiple
       condition rules, instead of bool{}.  Make both bool{} and bool_lax{}
       ignore trailing whitespace.
 
       condition rules, instead of bool{}.  Make both bool{} and bool_lax{}
       ignore trailing whitespace.
 
+JJ/02 prevent non-panic DKIM error from being sent to paniclog
+
+JJ/03 added tcp_wrappers_daemon_name to allow host entries other than
+      "exim" to be used
 
 Exim version 4.72
 -----------------
 
 Exim version 4.72
 -----------------
index 91c9b5f715ad4099962cb140a864aaa6844ffb1e..dbf7e86001e4c330c63983f9b2bad61d7b2be734 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.174 2010/06/07 08:23:20 pdp Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.175 2010/06/12 15:21:25 jetmore Exp $
 
 New Features in Exim
 --------------------
 
 New Features in Exim
 --------------------
@@ -83,6 +83,13 @@ Version 4.73
 
  9. Routers now support multiple "condition" tests,
 
 
  9. Routers now support multiple "condition" tests,
 
+10. There is now a runtime configuration option "tcp_wrappers_daemon_name".
+    Setting this allows an admin to define which entry in the tcpwrappers
+    config file will be used to control access to the daemon.  This option
+    is only available when Exim is built with USE_TCP_WRAPPERS.  The
+    default value is set at build time using the TCP_WRAPPERS_DAEMON_NAME
+    build option.
+
 
 Version 4.72
 ------------
 
 Version 4.72
 ------------
index 89d86063e5a40d197933a572ae93731ecae7d6cf..00bafe9c523bc464709744674e78855cca1f5937 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/OptionLists.txt,v 1.37 2010/06/06 02:08:50 pdp Exp $
+$Cambridge: exim/doc/doc-txt/OptionLists.txt,v 1.38 2010/06/12 15:21:25 jetmore Exp $
 
 LISTS OF EXIM OPTIONS
 ---------------------
 
 LISTS OF EXIM OPTIONS
 ---------------------
@@ -529,6 +529,7 @@ system_filter_reply_transport        string          unset         main
 system_filter_user                   string          unset         main              4.00 replacing message_filter
 tcp_nodelay                          boolean         true          main              4.23
                                                      true          smtp              4.23
 system_filter_user                   string          unset         main              4.00 replacing message_filter
 tcp_nodelay                          boolean         true          main              4.23
                                                      true          smtp              4.23
+tcp_wrappers_daemon_name             string*         ++            main              4.73
 temp_errors                          string list     +             pipe              1.95
 text                                 string*         unset         autoreply
 timeout                              time            5m            lmtp              3.20
 temp_errors                          string list     +             pipe              1.95
 text                                 string*         unset         autoreply
 timeout                              time            5m            lmtp              3.20
@@ -909,6 +910,7 @@ SUPPORT_TRANSLATE_IP_ADDRESS optional*    support for address translation
 SYSLOG_LOG_PID               optional     add pid to syslog lines
 SYSLOG_LONG_LINES            optional     do not split long syslog lines
 SYSTEM_ALIASES_FILE          optional     defaults to /etc/aliases
 SYSLOG_LOG_PID               optional     add pid to syslog lines
 SYSLOG_LONG_LINES            optional     do not split long syslog lines
 SYSTEM_ALIASES_FILE          optional     defaults to /etc/aliases
+TCP_WRAPPERS_DAEMON_NAME     system*      daemon name used by tcpwrappers libraru
 TIMEZONE_DEFAULT             optional     default for timezone option
 TLS_INCLUDE                  optional     path to include files for TLS
 TLS_LIBS                     optional     additional libraries for TLS
 TIMEZONE_DEFAULT             optional     default for timezone option
 TLS_INCLUDE                  optional     path to include files for TLS
 TLS_LIBS                     optional     additional libraries for TLS
index 7f7f6b3a44e7c033124513f618251731f085779a..050d9ad10c6ef5b9e769144921acc7a4a6f5966f 100644 (file)
@@ -1,4 +1,4 @@
-# $Cambridge: exim/src/src/EDITME,v 1.26 2010/06/06 02:46:13 pdp Exp $
+# $Cambridge: exim/src/src/EDITME,v 1.27 2010/06/12 15:21:25 jetmore Exp $
 
 ##################################################
 #          The Exim mail transport agent         #
 
 ##################################################
 #          The Exim mail transport agent         #
@@ -847,6 +847,13 @@ ZCAT_COMMAND=/usr/bin/zcat
 #
 # but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
 # as well.
 #
 # but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
 # as well.
+#
+# To use a name other than exim in the tcpwrappers config file,
+# e.g. if you're running multiple daemons with different access lists,
+# or multiple MTAs with the same access list, define
+# TCP_WRAPPERS_DAEMON_NAME accordingly
+#
+# TCP_WRAPPERS_DAEMON_NAME="exim"
 
 
 #------------------------------------------------------------------------------
 
 
 #------------------------------------------------------------------------------
index 780800c5831ef298f3b8cc154c73ac5036a19716..38ed0311f170d62fff599d83584d47f1dc1c5876 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/buildconfig.c,v 1.19 2010/06/07 18:25:57 pdp Exp $ */
+/* $Cambridge: exim/src/src/buildconfig.c,v 1.20 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -807,9 +807,10 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
         fprintf(new, "\"%s\"\n", value);
         }
 
         fprintf(new, "\"%s\"\n", value);
         }
 
-      /* Timezone values and HEADERS_CHARSET get quoted */
+      /* Timezone values HEADERS_CHARSET, and TCP_WRAPPERS_DAEMON_NAME get quoted */
 
       else if (strcmp(name, "TIMEZONE_DEFAULT") == 0||
 
       else if (strcmp(name, "TIMEZONE_DEFAULT") == 0||
+               strcmp(name, "TCP_WRAPPERS_DAEMON_NAME") == 0||
                strcmp(name, "HEADERS_CHARSET") == 0)
         fprintf(new, "\"%s\"\n", value);
 
                strcmp(name, "HEADERS_CHARSET") == 0)
         fprintf(new, "\"%s\"\n", value);
 
index e114c6bc09b27aa6f60886313c88dab615de1787..c6895b62123025038f9ba1bb5057688c117458b5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/config.h.defaults,v 1.19 2010/06/05 11:13:29 pdp Exp $ */
+/* $Cambridge: exim/src/src/config.h.defaults,v 1.20 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -128,6 +128,7 @@ it's a default value. */
 #define SYSLOG_LOG_PID
 #define SYSLOG_LONG_LINES
 
 #define SYSLOG_LOG_PID
 #define SYSLOG_LONG_LINES
 
+#define TCP_WRAPPERS_DAEMON_NAME "exim"
 #define TIMEZONE_DEFAULT
 #define TMPDIR
 
 #define TIMEZONE_DEFAULT
 #define TMPDIR
 
index b4e24485cbee0dea81e4bf91cc86d8653215014c..645cdb130d0a851395dfd24a19ef99c0d47c970b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.87 2010/06/05 09:10:10 pdp Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.88 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -1193,6 +1193,9 @@ BOOL    system_filter_uid_set  = FALSE;
 BOOL    system_filtering       = FALSE;
 
 BOOL    tcp_nodelay            = TRUE;
 BOOL    system_filtering       = FALSE;
 
 BOOL    tcp_nodelay            = TRUE;
+#ifdef USE_TCP_WRAPPERS
+uschar *tcp_wrappers_daemon_name = US TCP_WRAPPERS_DAEMON_NAME;
+#endif
 int     test_harness_load_avg  = 0;
 int     thismessage_size_limit = 0;
 int     timeout_frozen_after   = 0;
 int     test_harness_load_avg  = 0;
 int     thismessage_size_limit = 0;
 int     timeout_frozen_after   = 0;
index e3991dcbddc50cea07eb5b3071bafc49b34377c1..b036def7c5e696892c7fb0a6c6bc83addff7bbc0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.h,v 1.68 2010/06/05 09:10:10 pdp Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.69 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -758,6 +758,9 @@ extern BOOL    system_filter_uid_set;  /* TRUE if uid set */
 extern BOOL    system_filtering;       /* TRUE when running system filter */
 
 extern BOOL    tcp_nodelay;            /* Controls TCP_NODELAY on daemon */
 extern BOOL    system_filtering;       /* TRUE when running system filter */
 
 extern BOOL    tcp_nodelay;            /* Controls TCP_NODELAY on daemon */
+#ifdef USE_TCP_WRAPPERS
+extern uschar *tcp_wrappers_daemon_name; /* tcpwrappers daemon lookup name */
+#endif
 extern int     test_harness_load_avg;  /* For use when testing */
 extern int     thismessage_size_limit; /* Limit for this message */
 extern int     timeout_frozen_after;   /* Max time to keep frozen messages */
 extern int     test_harness_load_avg;  /* For use when testing */
 extern int     thismessage_size_limit; /* Limit for this message */
 extern int     timeout_frozen_after;   /* Max time to keep frozen messages */
index 6b11621e0f7a34a3009a1f881fa34967039b8b34..33f10690b8670da900c0e65fd32d000db5f80063 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/readconf.c,v 1.43 2010/06/07 08:23:20 pdp Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.44 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -399,6 +399,9 @@ static optionlist optionlist_config[] = {
   { "system_filter_reply_transport",opt_stringptr,&system_filter_reply_transport },
   { "system_filter_user",       opt_uid,         &system_filter_uid },
   { "tcp_nodelay",              opt_bool,        &tcp_nodelay },
   { "system_filter_reply_transport",opt_stringptr,&system_filter_reply_transport },
   { "system_filter_user",       opt_uid,         &system_filter_uid },
   { "tcp_nodelay",              opt_bool,        &tcp_nodelay },
+#ifdef USE_TCP_WRAPPERS
+  { "tcp_wrappers_daemon_name", opt_stringptr,   &tcp_wrappers_daemon_name },
+#endif
   { "timeout_frozen_after",     opt_time,        &timeout_frozen_after },
   { "timezone",                 opt_stringptr,   &timezone_string },
 #ifdef SUPPORT_TLS
   { "timeout_frozen_after",     opt_time,        &timeout_frozen_after },
   { "timezone",                 opt_stringptr,   &timezone_string },
 #ifdef SUPPORT_TLS
index 8edfe810424b4380e8d2bd39e29a8d2208c46cb2..9d10961c51a7cdbfe44e22ccaaebb031d0f08160 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/smtp_in.c,v 1.66 2009/11/16 19:50:37 nm4 Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.67 2010/06/12 15:21:26 jetmore Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -31,6 +31,7 @@ including that header, and restore its value afterwards. */
 
 int allow_severity = LOG_INFO;
 int deny_severity  = LOG_NOTICE;
 
 int allow_severity = LOG_INFO;
 int deny_severity  = LOG_NOTICE;
+uschar *tcp_wrappers_name;
 #endif
 
 
 #endif
 
 
@@ -1692,7 +1693,14 @@ if (!sender_host_unknown)
 
   #ifdef USE_TCP_WRAPPERS
   errno = 0;
 
   #ifdef USE_TCP_WRAPPERS
   errno = 0;
-  if (!hosts_ctl("exim",
+  tcp_wrappers_name = expand_string(tcp_wrappers_daemon_name);
+  if (tcp_wrappers_name == NULL)
+    {
+    log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Expansion of \"%s\" "
+      "(tcp_wrappers_name) failed: %s", string_printing(tcp_wrappers_name),
+        expand_string_message);
+    }
+  if (!hosts_ctl(tcp_wrappers_name,
          (sender_host_name == NULL)? STRING_UNKNOWN : CS sender_host_name,
          (sender_host_address == NULL)? STRING_UNKNOWN : CS sender_host_address,
          (sender_ident == NULL)? STRING_UNKNOWN : CS sender_ident))
          (sender_host_name == NULL)? STRING_UNKNOWN : CS sender_host_name,
          (sender_host_address == NULL)? STRING_UNKNOWN : CS sender_host_address,
          (sender_ident == NULL)? STRING_UNKNOWN : CS sender_ident))