[exim] Update to 4.73

David Woodhouse dwmw2 at fedoraproject.org
Wed Jan 5 23:12:40 UTC 2011


commit 40aaa859ca302b9301f019dd245e907ebf4bedd3
Author: David Woodhouse <David.Woodhouse at intel.com>
Date:   Wed Jan 5 23:11:46 2011 +0000

    Update to 4.73

 .gitignore                                         |    1 +
 exim-4.50-config.patch => exim-4.73-config.patch   |   85 +-
 ...71-dynlookup.patch => exim-4.73-dynlookup.patch | 1540 +++++++++++---------
 exim.spec                                          |   20 +-
 sources                                            |    3 +-
 trusted-configs                                    |    6 +
 6 files changed, 895 insertions(+), 760 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8f0b2c8..62993dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 sa-exim-4.2.tar.gz
 exim-4.72.tar.bz2
+/exim-4.73.tar.bz2
diff --git a/exim-4.50-config.patch b/exim-4.73-config.patch
similarity index 83%
rename from exim-4.50-config.patch
rename to exim-4.73-config.patch
index e42168b..06418e7 100644
--- a/exim-4.50-config.patch
+++ b/exim-4.73-config.patch
@@ -1,5 +1,16 @@
---- exim-4.71/src/EDITME.config	2009-11-20 12:18:19.000000000 +0000
-+++ exim-4.71/src/EDITME	2009-12-24 19:02:19.000000000 +0000
+--- exim-4.73/scripts/Configure-Makefile.config	2010-12-26 18:17:23.000000000 +0000
++++ exim-4.73/scripts/Configure-Makefile	2011-01-05 22:25:49.000000000 +0000
+@@ -137,7 +137,7 @@ if [ "${EXIM_PERL}" != "" ] ; then
+ 
+   mv $mft $mftt
+   echo "PERL_CC=`$PERL_COMMAND -MConfig -e 'print $Config{cc}'`" >>$mft
+-  echo "PERL_CCOPTS=`$PERL_COMMAND -MExtUtils::Embed -e ccopts`" >>$mft
++  echo "PERL_CCOPTS=`$PERL_COMMAND -MExtUtils::Embed -e ccopts` \$(CFLAGS)" >>$mft
+   echo "PERL_LIBS=`$PERL_COMMAND -MExtUtils::Embed -e ldopts`" >>$mft
+   echo "" >>$mft
+   cat $mftt >> $mft
+--- exim-4.73/src/EDITME.config	2010-12-26 18:17:23.000000000 +0000
++++ exim-4.73/src/EDITME	2011-01-05 22:29:05.000000000 +0000
 @@ -100,7 +100,7 @@
  # /usr/local/sbin. The installation script will try to create this directory,
  # and any superior directories, if they do not exist.
@@ -18,16 +29,16 @@
  
  # It is possible to specify a colon-separated list of files for CONFIGURE_FILE.
  # In this case, Exim will use the first of them that exists when it is run.
-@@ -134,7 +134,7 @@ CONFIGURE_FILE=/usr/exim/configure
- # owner of a local mailbox.) Specifying these values as root is very strongly
- # discouraged.
+@@ -133,7 +133,7 @@ CONFIGURE_FILE=/usr/exim/configure
+ # deliveries. (Local deliveries run as various non-root users, typically as the
+ # owner of a local mailbox.) Specifying these values as root is not supported.
  
 -EXIM_USER=
 +EXIM_USER=93
  
  # If you specify EXIM_USER as a name, this is looked up at build time, and the
  # uid number is built into the binary. However, you can specify that this
-@@ -155,7 +155,7 @@ EXIM_USER=
+@@ -154,7 +154,7 @@ EXIM_USER=
  # for EXIM_USER (e.g. EXIM_USER=exim), you don't need to set EXIM_GROUP unless
  # you want to use a group other than the default group for the given user.
  
@@ -36,7 +47,7 @@
  
  # Many sites define a user called "exim", with an appropriate default group,
  # and use
-@@ -235,7 +235,7 @@ TRANSPORT_SMTP=yes
+@@ -234,7 +234,7 @@ TRANSPORT_SMTP=yes
  # This one is special-purpose, and commonly not required, so it is not
  # included by default.
  
@@ -45,7 +56,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -244,9 +244,9 @@ TRANSPORT_SMTP=yes
+@@ -243,9 +243,9 @@ TRANSPORT_SMTP=yes
  # MBX, is included only when requested. If you do not know what this is about,
  # leave these settings commented out.
  
@@ -58,7 +69,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -262,17 +262,20 @@ LOOKUP_DBM=yes
+@@ -261,17 +261,20 @@ LOOKUP_DBM=yes
  LOOKUP_LSEARCH=yes
  LOOKUP_DNSDB=yes
  
@@ -88,7 +99,7 @@
  # LOOKUP_WHOSON=yes
  
  # These two settings are obsolete; all three lookups are compiled when
-@@ -343,14 +346,14 @@ EXIM_MONITOR=eximon.bin
+@@ -342,14 +345,14 @@ EXIM_MONITOR=eximon.bin
  # and the MIME ACL. Please read the documentation to learn more about these
  # features.
  
@@ -103,9 +114,18 @@
 -# WITH_OLD_DEMIME=yes
 +WITH_OLD_DEMIME=yes
  
+ # If you're using ClamAV and are backporting fixes to an old version, instead
+ # of staying current (which is the more usual approach) then you may need to
+@@ -482,7 +485,7 @@ FIXED_NEVER_USERS=root
+ # CONFIGURE_OWNER setting, to specify a configuration file which is listed in
+ # the TRUSTED_CONFIG_LIST file, then root privileges are not dropped by Exim.
+ 
+-# TRUSTED_CONFIG_LIST=/usr/exim/trusted_configs
++TRUSTED_CONFIG_LIST=/etc/exim/trusted-configs
+ 
+ 
  #------------------------------------------------------------------------------
- # Compiling Exim with experimental features. These are documented in
-@@ -486,11 +489,11 @@ FIXED_NEVER_USERS=root
+@@ -527,11 +530,11 @@ FIXED_NEVER_USERS=root
  # included in the Exim binary. You will then need to set up the run time
  # configuration to make use of the mechanism(s) selected.
  
@@ -122,7 +142,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -507,7 +510,7 @@ FIXED_NEVER_USERS=root
+@@ -548,7 +551,7 @@ FIXED_NEVER_USERS=root
  # one that is set in the headers_charset option. The default setting is
  # defined by this setting:
  
@@ -131,7 +151,7 @@
  
  # If you are going to make use of $header_xxx expansions in your configuration
  # file, or if your users are going to use them in filter files, and the normal
-@@ -527,7 +530,7 @@ HEADERS_CHARSET="ISO-8859-1"
+@@ -568,7 +571,7 @@ HEADERS_CHARSET="ISO-8859-1"
  # the Sieve filter support. For those OS where iconv() is known to be installed
  # as standard, the file in OS/Makefile-xxxx contains
  #
@@ -140,7 +160,7 @@
  #
  # If you are not using one of those systems, but have installed iconv(), you
  # need to uncomment that line above. In some cases, you may find that iconv()
-@@ -589,10 +592,11 @@ HEADERS_CHARSET="ISO-8859-1"
+@@ -630,10 +633,11 @@ HEADERS_CHARSET="ISO-8859-1"
  # leave these settings commented out.
  
  # This setting is required for any TLS support (either OpenSSL or GnuTLS)
@@ -154,7 +174,7 @@
  
  # Uncomment these settings if you are using GnuTLS
  # USE_GNUTLS=yes
-@@ -643,7 +647,7 @@ HEADERS_CHARSET="ISO-8859-1"
+@@ -684,7 +688,7 @@ HEADERS_CHARSET="ISO-8859-1"
  # Once you have done this, "make install" will build the info files and
  # install them in the directory you have defined.
  
@@ -163,7 +183,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -656,7 +660,7 @@ HEADERS_CHARSET="ISO-8859-1"
+@@ -697,7 +701,7 @@ HEADERS_CHARSET="ISO-8859-1"
  # %s. This will be replaced by one of the strings "main", "panic", or "reject"
  # to form the final file names. Some installations may want something like this:
  
@@ -172,7 +192,7 @@
  
  # which results in files with names /var/log/exim_mainlog, etc. The directory
  # in which the log files are placed must exist; Exim does not try to create
-@@ -705,7 +709,7 @@ EXICYCLOG_MAX=10
+@@ -746,7 +750,7 @@ EXICYCLOG_MAX=10
  # files. Both the name of the command and the suffix that it adds to files
  # need to be defined here. See also the EXICYCLOG_MAX configuration.
  
@@ -181,7 +201,7 @@
  COMPRESS_SUFFIX=gz
  
  
-@@ -713,7 +717,7 @@ COMPRESS_SUFFIX=gz
+@@ -754,7 +758,7 @@ COMPRESS_SUFFIX=gz
  # If the exigrep utility is fed compressed log files, it tries to uncompress
  # them using this command.
  
@@ -190,7 +210,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -722,7 +726,7 @@ ZCAT_COMMAND=/usr/bin/zcat
+@@ -763,7 +767,7 @@ ZCAT_COMMAND=/usr/bin/zcat
  # (version 5.004 or later) installed, set EXIM_PERL to perl.o. Using embedded
  # Perl costs quite a lot of resources. Only do this if you really need it.
  
@@ -199,7 +219,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -732,7 +736,7 @@ ZCAT_COMMAND=/usr/bin/zcat
+@@ -773,7 +777,7 @@ ZCAT_COMMAND=/usr/bin/zcat
  # that the local_scan API is made available by the linker. You may also need
  # to add -ldl to EXTRALIBS so that dlopen() is available to Exim.
  
@@ -208,7 +228,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -742,7 +746,7 @@ ZCAT_COMMAND=/usr/bin/zcat
+@@ -783,7 +787,7 @@ ZCAT_COMMAND=/usr/bin/zcat
  # support, which is intended for use in conjunction with the SMTP AUTH
  # facilities, is included only when requested by the following setting:
  
@@ -217,7 +237,7 @@
  
  # You probably need to add -lpam to EXTRALIBS, and in some releases of
  # GNU/Linux -ldl is also needed.
-@@ -810,7 +814,7 @@ ZCAT_COMMAND=/usr/bin/zcat
+@@ -851,7 +855,7 @@ ZCAT_COMMAND=/usr/bin/zcat
  # group. Once you have installed saslauthd, you should arrange for it to be
  # started by root at boot time.
  
@@ -226,7 +246,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -823,9 +827,9 @@ ZCAT_COMMAND=/usr/bin/zcat
+@@ -864,9 +868,9 @@ ZCAT_COMMAND=/usr/bin/zcat
  # You may well also have to specify a local "include" file and an additional
  # library for TCP wrappers, so you probably need something like this:
  #
@@ -239,7 +259,7 @@
  #
  # but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
  # as well.
-@@ -870,13 +874,13 @@ SYSTEM_ALIASES_FILE=/etc/aliases
+@@ -918,13 +922,13 @@ SYSTEM_ALIASES_FILE=/etc/aliases
  # is "yes", as well as supporting line editing, a history of input lines in the
  # current run is maintained.
  
@@ -255,7 +275,7 @@
  
  ###############################################################################
  #              THINGS YOU ALMOST NEVER NEED TO MENTION                        #
-@@ -897,13 +901,13 @@ SYSTEM_ALIASES_FILE=/etc/aliases
+@@ -945,13 +949,13 @@ SYSTEM_ALIASES_FILE=/etc/aliases
  # haven't got Perl, Exim will still build and run; you just won't be able to
  # use those utilities.
  
@@ -276,7 +296,7 @@
  
  
  #------------------------------------------------------------------------------
-@@ -1097,7 +1101,7 @@ TMPDIR="/tmp"
+@@ -1145,7 +1149,7 @@ TMPDIR="/tmp"
  # (process id) to a file so that it can easily be identified. The path of the
  # file can be specified here. Some installations may want something like this:
  
@@ -285,14 +305,3 @@
  
  # If PID_FILE_PATH is not defined, Exim writes a file in its spool directory
  # using the name "exim-daemon.pid".
---- exim-4.71/scripts/Configure-Makefile.config	2009-11-20 21:22:20.000000000 +0000
-+++ exim-4.71/scripts/Configure-Makefile	2009-12-24 18:59:48.000000000 +0000
-@@ -137,7 +137,7 @@ if [ "${EXIM_PERL}" != "" ] ; then
- 
-   mv $mft $mftt
-   echo "PERL_CC=`$PERL_COMMAND -MConfig -e 'print $Config{cc}'`" >>$mft
--  echo "PERL_CCOPTS=`$PERL_COMMAND -MExtUtils::Embed -e ccopts`" >>$mft
-+  echo "PERL_CCOPTS=`$PERL_COMMAND -MExtUtils::Embed -e ccopts` \$(CFLAGS)" >>$mft
-   echo "PERL_LIBS=`$PERL_COMMAND -MExtUtils::Embed -e ldopts`" >>$mft
-   echo "" >>$mft
-   cat $mftt >> $mft
diff --git a/exim-4.71-dynlookup.patch b/exim-4.73-dynlookup.patch
similarity index 84%
rename from exim-4.71-dynlookup.patch
rename to exim-4.73-dynlookup.patch
index cbfd244..de15008 100644
--- a/exim-4.71-dynlookup.patch
+++ b/exim-4.73-dynlookup.patch
@@ -1,7 +1,16 @@
-diff -uNr exim-4.71/Makefile exim-4.71-dynlookup/Makefile
---- exim-4.71/Makefile	2009-11-16 19:50:36.000000000 +0000
-+++ exim-4.71-dynlookup/Makefile	2009-12-24 19:54:45.000000000 +0000
-@@ -81,7 +81,7 @@
+commit e6d225ae6e6811d3c88dc201642a2127ff6c11bd
+Author: David Woodhouse <David.Woodhouse at intel.com>
+Date:   Wed Jan 5 22:55:50 2011 +0000
+
+    Add dynamic lookup support
+    
+    Fixed: bug #139
+
+diff --git a/src/Makefile b/src/Makefile
+index 0a48ff9..eb9df50 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -81,7 +81,7 @@ clean:; @echo ""; echo '*** "make clean" just removes all .o and .a files'
  
  clean_exim:; cd build-$(buildname); \
  	 $(RM_COMMAND) -f *.o lookups/*.o lookups/*.a auths/*.o auths/*.a \
@@ -10,10 +19,11 @@ diff -uNr exim-4.71/Makefile exim-4.71-dynlookup/Makefile
  
  distclean:; $(RM_COMMAND) -rf build-*
  
-diff -uNr exim-4.71/OS/Makefile-Base exim-4.71-dynlookup/OS/Makefile-Base
---- exim-4.71/OS/Makefile-Base	2009-06-10 08:34:04.000000000 +0100
-+++ exim-4.71-dynlookup/OS/Makefile-Base	2009-12-24 19:54:45.000000000 +0000
-@@ -313,6 +313,7 @@
+diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base
+index 451fcd2..5793869 100644
+--- a/src/OS/Makefile-Base
++++ b/src/OS/Makefile-Base
+@@ -313,6 +313,7 @@ OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
          rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
          route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
          store.o string.o tls.o tod.o transport.o tree.o verify.o \
@@ -21,10 +31,11 @@ diff -uNr exim-4.71/OS/Makefile-Base exim-4.71-dynlookup/OS/Makefile-Base
          local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
          $(OBJ_WITH_OLD_DEMIME) $(OBJ_EXPERIMENTAL)
  
-diff -uNr exim-4.71/scripts/Configure-Makefile exim-4.71-dynlookup/scripts/Configure-Makefile
---- exim-4.71/scripts/Configure-Makefile	2009-11-20 21:22:20.000000000 +0000
-+++ exim-4.71-dynlookup/scripts/Configure-Makefile	2009-12-24 19:54:45.000000000 +0000
-@@ -107,7 +107,7 @@
+diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
+index 35bb2c3..1b2ea1e 100755
+--- a/src/scripts/Configure-Makefile
++++ b/src/scripts/Configure-Makefile
+@@ -107,7 +107,7 @@ do   if test -r ../$f
              echo "# End of $f"
              echo ""
       fi
@@ -33,10 +44,51 @@ diff -uNr exim-4.71/scripts/Configure-Makefile exim-4.71-dynlookup/scripts/Confi
  
  # See if there is a definition of EXIM_PERL in what we have built so far.
  # If so, run Perl to find the default values for PERL_CC, PERL_CCOPTS,
-diff -uNr exim-4.71/scripts/MakeLinks exim-4.71-dynlookup/scripts/MakeLinks
---- exim-4.71/scripts/MakeLinks	2009-11-13 15:58:17.000000000 +0000
-+++ exim-4.71-dynlookup/scripts/MakeLinks	2009-12-24 19:54:45.000000000 +0000
-@@ -197,6 +197,7 @@
+diff --git a/src/scripts/MakeLinks b/src/scripts/MakeLinks
+index bb6dd49..5918139 100755
+--- a/src/scripts/MakeLinks
++++ b/src/scripts/MakeLinks
+@@ -32,39 +32,23 @@ mkdir lookups
+ cd lookups
+ ln -s ../../src/lookups/README           README
+ ln -s ../../src/lookups/Makefile         Makefile
+-ln -s ../../src/lookups/cdb.h            cdb.h
+ ln -s ../../src/lookups/cdb.c            cdb.c
+-ln -s ../../src/lookups/dbmdb.h          dbmdb.h
+ ln -s ../../src/lookups/dbmdb.c          dbmdb.c
+-ln -s ../../src/lookups/dnsdb.h          dnsdb.h
+ ln -s ../../src/lookups/dnsdb.c          dnsdb.c
+-ln -s ../../src/lookups/dsearch.h        dsearch.h
+ ln -s ../../src/lookups/dsearch.c        dsearch.c
+-ln -s ../../src/lookups/ibase.h          ibase.h
+ ln -s ../../src/lookups/ibase.c          ibase.c
+ ln -s ../../src/lookups/ldap.h           ldap.h
+ ln -s ../../src/lookups/ldap.c           ldap.c
+-ln -s ../../src/lookups/lsearch.h        lsearch.h
+ ln -s ../../src/lookups/lsearch.c        lsearch.c
+-ln -s ../../src/lookups/mysql.h          mysql.h
+ ln -s ../../src/lookups/mysql.c          mysql.c
+-ln -s ../../src/lookups/nis.h            nis.h
+ ln -s ../../src/lookups/nis.c            nis.c
+-ln -s ../../src/lookups/nisplus.h        nisplus.h
+ ln -s ../../src/lookups/nisplus.c        nisplus.c
+-ln -s ../../src/lookups/oracle.h         oracle.h
+ ln -s ../../src/lookups/oracle.c         oracle.c
+-ln -s ../../src/lookups/passwd.h         passwd.h
+ ln -s ../../src/lookups/passwd.c         passwd.c
+-ln -s ../../src/lookups/pgsql.h          pgsql.h
+ ln -s ../../src/lookups/pgsql.c          pgsql.c
+-ln -s ../../src/lookups/spf.h            spf.h
+ ln -s ../../src/lookups/spf.c            spf.c
+-ln -s ../../src/lookups/sqlite.h         sqlite.h
+ ln -s ../../src/lookups/sqlite.c         sqlite.c
+-ln -s ../../src/lookups/testdb.h         testdb.h
+ ln -s ../../src/lookups/testdb.c         testdb.c
+-ln -s ../../src/lookups/whoson.h         whoson.h
+ ln -s ../../src/lookups/whoson.c         whoson.c
+ 
+ ln -s ../../src/lookups/lf_functions.h   lf_functions.h
+@@ -197,6 +181,7 @@ ln -s ../src/mytypes.h         mytypes.h
  ln -s ../src/osfunctions.h     osfunctions.h
  ln -s ../src/store.h           store.h
  ln -s ../src/structs.h         structs.h
@@ -44,10 +96,45 @@ diff -uNr exim-4.71/scripts/MakeLinks exim-4.71-dynlookup/scripts/MakeLinks
  
  ln -s ../src/acl.c             acl.c
  ln -s ../src/buildconfig.c     buildconfig.c
-diff -uNr exim-4.71/src/config.h.defaults exim-4.71-dynlookup/src/config.h.defaults
---- exim-4.71/src/config.h.defaults	2009-11-16 19:50:36.000000000 +0000
-+++ exim-4.71-dynlookup/src/config.h.defaults	2009-12-24 19:54:45.000000000 +0000
-@@ -90,6 +90,8 @@
+diff --git a/src/src/EDITME b/src/src/EDITME
+index 3c162c9..be15e4e 100644
+--- a/src/src/EDITME
++++ b/src/src/EDITME
+@@ -249,6 +249,10 @@ TRANSPORT_SMTP=yes
+ 
+ 
+ #------------------------------------------------------------------------------
++# See below for dynamic lookup modules.
++# LOOKUP_MODULE_DIR=/usr/lib/exim/lookups/
++
++#------------------------------------------------------------------------------
+ # These settings determine which file and database lookup methods are included
+ # in the binary. See the manual chapter entitled "File and database lookups"
+ # for discussion. DBM and lsearch (linear search) are included by default. If
+@@ -256,6 +260,18 @@ TRANSPORT_SMTP=yes
+ # LOOKUP_DNSDB does *not* refer to general mail routing using the DNS. It is
+ # for the specialist case of using the DNS as a general database facility (not
+ # common).
++# If set to "2" instead of "yes" then the corresponding lookup will be
++# built as a module and must be installed into LOOKUP_MODULE_DIR. You need to
++# add -export-dynamic -rdynamic to EXTRALIBS. You may also need to add -ldl to
++# EXTRALIBS so that dlopen() is available to Exim. You need to define
++# LOOKUP_MODULE_DIR above so the exim binary actually loads dynamic lookup
++# modules.
++# Also, instead of adding all the libraries/includes to LOOKUP_INCLUDE and
++# LOOKUP_LIBS, add them to the respective LOOKUP_*_INCLUDE and LOOKUP_*_LIBS
++# (where * is the name as given here in this list). That ensures that only
++# the dynamic library and not the exim binary will be linked against the
++# library.
++# NOTE: LDAP cannot be built as a module!
+ 
+ LOOKUP_DBM=yes
+ LOOKUP_LSEARCH=yes
+diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults
+index 5cff6ad..8d951ae 100644
+--- a/src/src/config.h.defaults
++++ b/src/src/config.h.defaults
+@@ -90,6 +90,8 @@ it's a default value. */
  #define LOOKUP_WILDLSEARCH
  #define LOOKUP_NWILDLSEARCH
  
@@ -56,9 +143,10 @@ diff -uNr exim-4.71/src/config.h.defaults exim-4.71-dynlookup/src/config.h.defau
  #define MAX_FILTER_SIZE           (1024*1024)
  #define MAX_LOCALHOST_NUMBER        256
  #define MAX_INCLUDE_SIZE          (1024*1024)
-diff -uNr exim-4.71/src/drtables.c exim-4.71-dynlookup/src/drtables.c
---- exim-4.71/src/drtables.c	2009-11-16 19:50:36.000000000 +0000
-+++ exim-4.71-dynlookup/src/drtables.c	2009-12-24 19:54:45.000000000 +0000
+diff --git a/src/src/drtables.c b/src/src/drtables.c
+index e2d989c..92b4878 100644
+--- a/src/src/drtables.c
++++ b/src/src/drtables.c
 @@ -10,6 +10,8 @@
  
  #include "exim.h"
@@ -68,7 +156,7 @@ diff -uNr exim-4.71/src/drtables.c exim-4.71-dynlookup/src/drtables.c
  
  /* This module contains tables that define the lookup methods and drivers
  that are actually included in the binary. Its contents are controlled by
-@@ -17,527 +19,8 @@
+@@ -17,527 +19,8 @@ various macros in config.h that ultimately come from Local/Makefile. They are
  all described in src/EDITME. */
  
  
@@ -598,7 +686,7 @@ diff -uNr exim-4.71/src/drtables.c exim-4.71-dynlookup/src/drtables.c
  
  /* Table of information about all possible authentication mechamisms. All
  entries are always present if any mechanism is declared, but the functions are
-@@ -865,4 +348,226 @@
+@@ -865,4 +348,226 @@ transport_info transports_available[] = {
  { US"", NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, FALSE }
  };
  
@@ -825,43 +913,11 @@ diff -uNr exim-4.71/src/drtables.c exim-4.71-dynlookup/src/drtables.c
 +}
 +
  /* End of drtables.c */
-diff -uNr exim-4.71/src/EDITME exim-4.71-dynlookup/src/EDITME
---- exim-4.71/src/EDITME	2009-11-20 12:18:19.000000000 +0000
-+++ exim-4.71-dynlookup/src/EDITME	2009-12-24 19:54:45.000000000 +0000
-@@ -250,6 +250,10 @@
- 
- 
- #------------------------------------------------------------------------------
-+# See below for dynamic lookup modules.
-+# LOOKUP_MODULE_DIR=/usr/lib/exim/lookups/
-+
-+#------------------------------------------------------------------------------
- # These settings determine which file and database lookup methods are included
- # in the binary. See the manual chapter entitled "File and database lookups"
- # for discussion. DBM and lsearch (linear search) are included by default. If
-@@ -257,6 +261,18 @@
- # LOOKUP_DNSDB does *not* refer to general mail routing using the DNS. It is
- # for the specialist case of using the DNS as a general database facility (not
- # common).
-+# If set to "2" instead of "yes" then the corresponding lookup will be
-+# built as a module and must be installed into LOOKUP_MODULE_DIR. You need to
-+# add -export-dynamic -rdynamic to EXTRALIBS. You may also need to add -ldl to
-+# EXTRALIBS so that dlopen() is available to Exim. You need to define
-+# LOOKUP_MODULE_DIR above so the exim binary actually loads dynamic lookup
-+# modules.
-+# Also, instead of adding all the libraries/includes to LOOKUP_INCLUDE and
-+# LOOKUP_LIBS, add them to the respective LOOKUP_*_INCLUDE and LOOKUP_*_LIBS
-+# (where * is the name as given here in this list). That ensures that only
-+# the dynamic library and not the exim binary will be linked against the
-+# library.
-+# NOTE: LDAP cannot be built as a module!
- 
- LOOKUP_DBM=yes
- LOOKUP_LSEARCH=yes
-diff -uNr exim-4.71/src/exim.c exim-4.71-dynlookup/src/exim.c
---- exim-4.71/src/exim.c	2009-11-16 19:50:36.000000000 +0000
-+++ exim-4.71-dynlookup/src/exim.c	2009-12-24 19:54:45.000000000 +0000
-@@ -925,53 +925,53 @@
+diff --git a/src/src/exim.c b/src/src/exim.c
+index dce42f0..bda6190 100644
+--- a/src/src/exim.c
++++ b/src/src/exim.c
+@@ -776,53 +776,53 @@ fprintf(f, "Support for:");
  #endif
  fprintf(f, "\n");
  
@@ -932,7 +988,7 @@ diff -uNr exim-4.71/src/exim.c exim-4.71-dynlookup/src/exim.c
    fprintf(f, " whoson");
  #endif
  fprintf(f, "\n");
-@@ -3432,6 +3432,10 @@
+@@ -3510,6 +3510,10 @@ if (opt_perl_at_start && opt_perl_startup != NULL)
    }
  #endif /* EXIM_PERL */
  
@@ -943,10 +999,11 @@ diff -uNr exim-4.71/src/exim.c exim-4.71-dynlookup/src/exim.c
  /* Log the arguments of the call if the configuration file said so. This is
  a debugging feature for finding out what arguments certain MUAs actually use.
  Don't attempt it if logging is disabled, or if listing variables or if
-diff -uNr exim-4.71/src/expand.c exim-4.71-dynlookup/src/expand.c
---- exim-4.71/src/expand.c	2009-11-16 19:50:36.000000000 +0000
-+++ exim-4.71-dynlookup/src/expand.c	2009-12-24 19:54:45.000000000 +0000
-@@ -5473,8 +5473,8 @@
+diff --git a/src/src/expand.c b/src/src/expand.c
+index 7adf673..702faab 100644
+--- a/src/src/expand.c
++++ b/src/src/expand.c
+@@ -5506,8 +5506,8 @@ while (*s != 0)
            goto EXPAND_FAILED;
            }
  
@@ -957,10 +1014,11 @@ diff -uNr exim-4.71/src/expand.c exim-4.71-dynlookup/src/expand.c
          else if (opt != NULL) sub = NULL;
  
          if (sub == NULL)
-diff -uNr exim-4.71/src/globals.c exim-4.71-dynlookup/src/globals.c
---- exim-4.71/src/globals.c	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/globals.c	2009-12-24 19:54:45.000000000 +0000
-@@ -13,21 +13,6 @@
+diff --git a/src/src/globals.c b/src/src/globals.c
+index 71de52a..6653d62 100644
+--- a/src/src/globals.c
++++ b/src/src/globals.c
+@@ -13,21 +13,6 @@ that they are easy to find. */
  #include "exim.h"
  
  
@@ -982,10 +1040,11 @@ diff -uNr exim-4.71/src/globals.c exim-4.71-dynlookup/src/globals.c
  /* Generic options for auths, all of which live inside auth_instance
  data blocks and hence have the opt_public flag set. */
  
-diff -uNr exim-4.71/src/globals.h exim-4.71-dynlookup/src/globals.h
---- exim-4.71/src/globals.h	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/globals.h	2009-12-24 19:54:45.000000000 +0000
-@@ -440,7 +440,7 @@
+diff --git a/src/src/globals.h b/src/src/globals.h
+index b4e3f2a..db7a79b 100644
+--- a/src/src/globals.h
++++ b/src/src/globals.h
+@@ -441,7 +441,7 @@ extern BOOL    log_testing_mode;       /* TRUE in various testing modes */
  extern BOOL    log_timezone;           /* TRUE to include the timezone in log lines */
  extern unsigned int log_write_selector;/* Bit map of logging options for log_write() */
  extern uschar *login_sender_address;   /* The actual sender address */
@@ -994,9 +1053,11 @@ diff -uNr exim-4.71/src/globals.h exim-4.71-dynlookup/src/globals.h
  extern int     lookup_list_count;      /* Number of entries in the list */
  extern int     lookup_open_max;        /* Max lookup files to cache */
  extern uschar *lookup_value;           /* Value looked up from file */
-diff -uNr exim-4.71/src/lookupapi.h exim-4.71-dynlookup/src/lookupapi.h
---- exim-4.71/src/lookupapi.h	1970-01-01 01:00:00.000000000 +0100
-+++ exim-4.71-dynlookup/src/lookupapi.h	2009-12-24 19:54:45.000000000 +0000
+diff --git a/src/src/lookupapi.h b/src/src/lookupapi.h
+new file mode 100644
+index 0000000..97f92ab
+--- /dev/null
++++ b/src/src/lookupapi.h
 @@ -0,0 +1,58 @@
 +/* $Cambridge$ */
 +
@@ -1056,189 +1117,446 @@ diff -uNr exim-4.71/src/lookupapi.h exim-4.71-dynlookup/src/lookupapi.h
 +} lookup_module_info;
 +
 +/* End of lookupapi.h */
-diff -uNr exim-4.71/src/lookups/cdb.c exim-4.71-dynlookup/src/lookups/cdb.c
---- exim-4.71/src/lookups/cdb.c	2005-06-27 15:29:44.000000000 +0100
-+++ exim-4.71-dynlookup/src/lookups/cdb.c	2009-12-24 19:54:45.000000000 +0000
-@@ -56,7 +56,6 @@
- 
- #include "../exim.h"
- #include "lf_functions.h"
--#include "cdb.h"
+diff --git a/src/src/lookups/Makefile b/src/src/lookups/Makefile
+index 2c7cb87..76e56da 100644
+--- a/src/src/lookups/Makefile
++++ b/src/src/lookups/Makefile
+@@ -1,13 +1,171 @@
+ # $Cambridge: exim/src/src/lookups/Makefile,v 1.9 2009/06/10 07:34:05 tom Exp $
  
- #ifdef HAVE_MMAP
- #  include <sys/mman.h>
-@@ -144,7 +143,9 @@
-   return num;
- }
+-# Make file for building a library containing all the available lookups and
+-# calling it lookups.a. This is called from the main make file, after cd'ing
+-# to the lookups subdirectory. When the relevant LOOKUP_ macros are not
+-# defined, dummy modules get compiled.
++# Make file for building all the available lookups.
++# This is called from the main make file, after cd'ing
++# to the lookups subdirectory.
  
--void *
-+static void cdb_close(void *handle);
+-OBJ = cdb.o dbmdb.o dnsdb.o dsearch.o ibase.o ldap.o lsearch.o mysql.o nis.o \
+-      nisplus.o oracle.o passwd.o pgsql.o spf.o sqlite.o testdb.o whoson.o \
+-      lf_check_file.o lf_quote.o lf_sqlperform.o
++# because the variable is EXPERIMENTAL_SPF and not LOOKUP_SPF
++# we put this one here by default and compile a dummy if
++# EXPERIMENTAL_SPF is not defined
++OBJ=spf.o
++MODS=
 +
-+static void *
- cdb_open(uschar *filename,
-          uschar **errmsg)
- {
-@@ -245,7 +246,7 @@
- *             Check entry point                  *
- *************************************************/
- 
--BOOL
-+static BOOL
- cdb_check(void *handle,
-          uschar *filename,
-          int modemask,
-@@ -270,7 +271,7 @@
- *              Find entry point                  *
- *************************************************/
- 
--int
-+static int
- cdb_find(void *handle,
-         uschar *filename,
-         uschar *keystring,
-@@ -418,7 +419,7 @@
- 
- /* See local README for interface description */
- 
--void
-+static void
- cdb_close(void *handle)
- {
- struct cdb_state * cdbp = handle;
-@@ -434,4 +435,22 @@
-  (void)close(cdbp->fileno);
- }
- 
-+lookup_info cdb_lookup_info = {
-+  US"cdb",                       /* lookup name */
-+  lookup_absfile,                /* uses absolute file name */
-+  cdb_open,                      /* open function */
-+  cdb_check,                     /* check function */
-+  cdb_find,                      /* find function */
-+  cdb_close,                     /* close function */
-+  NULL,                          /* no tidy function */
-+  NULL                           /* no quoting function */
-+};
++ifeq ($(LOOKUP_CDB),2)
++MODS += cdb.so
++LOOKUP_cdb_INCLUDE = $(LOOKUP_CDB_INCLUDE)
++LOOKUP_cdb_LIBS = $(LOOKUP_CDB_LIBS)
++else
++ifneq ($(LOOKUP_CDB),)
++OBJ += cdb.o
++endif
++endif
 +
-+#ifdef DYNLOOKUP
-+#define cdb_lookup_module_info _lookup_module_info
-+#endif
++ifeq ($(LOOKUP_DBM),2)
++MODS += dbmdb.so
++LOOKUP_dbmdb_INCLUDE = $(LOOKUP_DBM_INCLUDE)
++LOOKUP_dbmdb_LIBS = $(LOOKUP_DBM_LIBS)
++else
++ifneq ($(LOOKUP_DBM),)
++OBJ += dbmdb.o
++endif
++endif
 +
-+static lookup_info *_lookup_list[] = { &cdb_lookup_info };
-+lookup_module_info cdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
++ifeq ($(LOOKUP_DNSDB),2)
++MODS += dnsdb.so
++LOOKUP_dnsdb_INCLUDE = $(LOOKUP_DNSDB_INCLUDE)
++LOOKUP_dnsdb_LIBS = $(LOOKUP_DNSDB_LIBS)
++else
++ifneq ($(LOOKUP_DNSDB),)
++OBJ += dnsdb.o
++endif
++endif
 +
- /* End of lookups/cdb.c */
-diff -uNr exim-4.71/src/lookups/cdb.h exim-4.71-dynlookup/src/lookups/cdb.h
---- exim-4.71/src/lookups/cdb.h	2004-10-07 14:10:01.000000000 +0100
-+++ exim-4.71-dynlookup/src/lookups/cdb.h	2009-12-24 19:54:45.000000000 +0000
-@@ -1,59 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/cdb.h,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
--
--/*************************************************
--*     Exim - an Internet mail transport agent    *
--*************************************************/
--
--/*
-- * $Id: cdb.h,v 1.2.2.1 1998/05/29 16:21:36 cvs Exp $
-- *
-- * Exim - CDB database lookup module
-- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- *
-- * Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
-- *
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU General Public License
-- * as published by the Free Software Foundation; either version 2
-- * of the License, or (at your option) any later version.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-- * 02111-1307, USA.
-- *
-- *
-- * This code implements Dan Bernstein's Constant DataBase (cdb) spec.
-- * Information, the spec and sample code for cdb can be obtained from
-- *      http://www.pobox.com/~djb/cdb.html
-- *
-- * This implementation borrows some code from Dan Bernstein's
-- * implementation (which has no license restrictions applied to it).
-- * This (read-only) implementation is completely contained within
-- * cdb.[ch] it does *not* link against an external cdb library.
-- *
-- *
-- * There are 2 varients included within this code.  One uses MMAP and
-- * should give better performance especially for multiple lookups on a
-- * modern machine.  The other is the default implementation which is
-- * used in the case where the MMAP fails or if MMAP was not compiled
-- * in.  this implementation is the same as the original reference cdb
-- * implementation.
-- *
-- */
--
--
--/* Functions for reading exim cdb files */
--
--extern void *cdb_open(uschar *, uschar **);
--extern BOOL  cdb_check(void *, uschar *, int, uid_t *, gid_t *, uschar **);
--extern int   cdb_find(void *, uschar *, uschar *, int, uschar **, uschar **,
--               BOOL *);
--extern void  cdb_close(void *);
--
--/* End of cdb.h */
-diff -uNr exim-4.71/src/lookups/dbmdb.c exim-4.71-dynlookup/src/lookups/dbmdb.c
---- exim-4.71/src/lookups/dbmdb.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dbmdb.c	2009-12-24 19:54:45.000000000 +0000
-@@ -9,7 +9,6 @@
- 
- #include "../exim.h"
- #include "lf_functions.h"
--#include "dbmdb.h"
- 
- 
- /*************************************************
-@@ -18,7 +17,7 @@
- 
- /* See local README for interface description */
- 
--void *
-+static void *
- dbmdb_open(uschar *filename, uschar **errmsg)
- {
- EXIM_DB *yield;
-@@ -45,7 +44,7 @@
- the same. Otherwise, for safety, we have to check for x.db or x.dir and x.pag.
- */
- 
--BOOL
-+static BOOL
- dbmdb_check(void *handle, uschar *filename, int modemask, uid_t *owners,
-   gid_t *owngroups, uschar **errmsg)
- {
-@@ -88,7 +87,7 @@
- /* See local README for interface description. This function adds 1 to
- the keylength in order to include the terminating zero. */
- 
--int
-+static int
- dbmdb_find(void *handle, uschar *filename, uschar *keystring, int length,
-   uschar **result, uschar **errmsg, BOOL *do_cache)
- {
-@@ -122,7 +121,7 @@
- /* See local README for interface description */
- 
- int
--dbmnz_find(void *handle, uschar *filename, uschar *keystring, int length,
-+static dbmnz_find(void *handle, uschar *filename, uschar *keystring, int length,
-   uschar **result, uschar **errmsg, BOOL *do_cache)
- {
++ifeq ($(LOOKUP_DSEARCH),2)
++MODS += dsearch.so
++LOOKUP_dsearch_INCLUDE = $(LOOKUP_DSEARCH_INCLUDE)
++LOOKUP_dsearch_LIBS = $(LOOKUP_DSEARCH_LIBS)
++else
++ifneq ($(LOOKUP_DSEARCH),)
++OBJ += dsearch.o
++endif
++endif
++
++ifeq ($(LOOKUP_IBASE),2)
++MODS += ibase.so
++LOOKUP_ibase_INCLUDE = $(LOOKUP_IBASE_INCLUDE)
++LOOKUP_ibase_LIBS = $(LOOKUP_IBASE_LIBS)
++else
++ifneq ($(LOOKUP_IBASE),)
++OBJ += ibase.o
++endif
++endif
++
++ifneq ($(LOOKUP_LDAP),)
++OBJ += ldap.o
++endif
++
++ifeq ($(LOOKUP_LSEARCH),2)
++MODS += lsearch.so
++LOOKUP_lsearch_INCLUDE = $(LOOKUP_LSEARCH_INCLUDE)
++LOOKUP_lsearch_LIBS = $(LOOKUP_LSEARCH_LIBS)
++else
++ifneq ($(LOOKUP_LSEARCH),)
++OBJ += lsearch.o
++endif
++endif
++
++ifeq ($(LOOKUP_MYSQL),2)
++MODS += mysql.so
++LOOKUP_mysql_INCLUDE = $(LOOKUP_MYSQL_INCLUDE)
++LOOKUP_mysql_LIBS = $(LOOKUP_MYSQL_LIBS)
++else
++ifneq ($(LOOKUP_MYSQL),)
++OBJ += mysql.o
++endif
++endif
++
++ifeq ($(LOOKUP_NIS),2)
++MODS += nis.so
++LOOKUP_nis_INCLUDE = $(LOOKUP_NIS_INCLUDE)
++LOOKUP_nis_LIBS = $(LOOKUP_NIS_LIBS)
++else
++ifneq ($(LOOKUP_NIS),)
++OBJ += nis.o
++endif
++endif
++
++ifeq ($(LOOKUP_NISPLUS),2)
++MODS += nisplus.so
++LOOKUP_nisplus_INCLUDE = $(LOOKUP_NISPLUS_INCLUDE)
++LOOKUP_nisplus_LIBS = $(LOOKUP_NISPLUS_LIBS)
++else
++ifneq ($(LOOKUP_NISPLUS),)
++OBJ += nisplus.o
++endif
++endif
++
++ifeq ($(LOOKUP_ORACLE),2)
++MODS += oracle.so
++LOOKUP_oracle_INCLUDE = $(LOOKUP_ORACLE_INCLUDE)
++LOOKUP_oracle_LIBS = $(LOOKUP_ORACLE_LIBS)
++else
++ifneq ($(LOOKUP_ORACLE),)
++OBJ += oracle.o
++endif
++endif
++
++ifeq ($(LOOKUP_PASSWD),2)
++MODS += passwd.so
++LOOKUP_passwd_INCLUDE = $(LOOKUP_PASSWD_INCLUDE)
++LOOKUP_passwd_LIBS = $(LOOKUP_PASSWD_LIBS)
++else
++ifneq ($(LOOKUP_PASSWD),)
++OBJ += passwd.o
++endif
++endif
++
++ifeq ($(LOOKUP_PGSQL),2)
++MODS += pgsql.so
++LOOKUP_pgsql_INCLUDE = $(LOOKUP_PGSQL_INCLUDE)
++LOOKUP_pgsql_LIBS = $(LOOKUP_PGSQL_LIBS)
++else
++ifneq ($(LOOKUP_PGSQL),)
++OBJ += pgsql.o
++endif
++endif
++
++ifeq ($(LOOKUP_SQLITE),2)
++MODS += sqlite.so
++LOOKUP_sqlite_INCLUDE = $(LOOKUP_SQLITE_INCLUDE)
++LOOKUP_sqlite_LIBS = $(LOOKUP_SQLITE_LIBS)
++else
++ifneq ($(LOOKUP_SQLITE),)
++OBJ += sqlite.o
++endif
++endif
++
++ifeq ($(LOOKUP_TESTDB),2)
++MODS += testdb.so
++LOOKUP_testdb_INCLUDE = $(LOOKUP_TESTDB_INCLUDE)
++LOOKUP_testdb_LIBS = $(LOOKUP_TESTDB_LIBS)
++else
++ifneq ($(LOOKUP_TESTDB),)
++OBJ += testdb.o
++endif
++endif
++
++ifeq ($(LOOKUP_WHOSON),2)
++MODS += whoson.so
++LOOKUP_whoson_INCLUDE = $(LOOKUP_WHOSON_INCLUDE)
++LOOKUP_whoson_LIBS = $(LOOKUP_WHOSON_LIBS)
++else
++ifneq ($(LOOKUP_WHOSON),)
++OBJ += whoson.o
++endif
++endif
++
++
++all:             lookups.a lf_quote.o lf_check_file.o lf_sqlperform.o $(MODS)
+ 
+ lookups.a:       $(OBJ)
+ 		 @$(RM_COMMAND) -f lookups.a
+@@ -15,30 +173,51 @@ lookups.a:       $(OBJ)
+ 		 @$(AR) lookups.a $(OBJ)
+ 		 $(RANLIB) $@
+ 
+-.SUFFIXES:       .o .c
++.SUFFIXES:       .o .c .so
+ .c.o:;           @echo "$(CC) $*.c"
+ 		 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
+ 
++.c.so:;          @echo "$(CC) -shared $*.c"
++		 $(FE)$(CC) $(LOOKUP_$*_INCLUDE) $(LOOKUP_$*_LIBS) -DDYNLOOKUP -shared -rdynamic $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@
++
+ lf_check_file.o: $(HDRS) lf_check_file.c  lf_functions.h
+ lf_quote.o:      $(HDRS) lf_quote.c       lf_functions.h
+ lf_sqlperform.o: $(HDRS) lf_sqlperform.c  lf_functions.h
+ 
+-cdb.o:           $(HDRS) cdb.c       cdb.h
+-dbmdb.o:         $(HDRS) dbmdb.c     dbmdb.h
+-dnsdb.o:         $(HDRS) dnsdb.c     dnsdb.h
+-dsearch.o:       $(HDRS) dsearch.c   dsearch.h
+-ibase.o:         $(HDRS) ibase.c     ibase.h
+-ldap.o:          $(HDRS) ldap.c      ldap.h
+-lsearch.o:       $(HDRS) lsearch.c   lsearch.h
+-mysql.o:         $(HDRS) mysql.c     mysql.h
+-nis.o:           $(HDRS) nis.c       nis.h
+-nisplus.o:       $(HDRS) nisplus.c   nisplus.h
+-oracle.o:        $(HDRS) oracle.c    oracle.h
+-passwd.o:        $(HDRS) passwd.c    passwd.h
+-pgsql.o:         $(HDRS) pgsql.c     pgsql.h
+-spf.o:           $(HDRS) spf.c       spf.h
+-sqlite.o:        $(HDRS) sqlite.c    sqlite.h
+-testdb.o:        $(HDRS) testdb.c    testdb.h
+-whoson.o:        $(HDRS) whoson.c    whoson.h
++cdb.o:           $(HDRS) cdb.c
++dbmdb.o:         $(HDRS) dbmdb.c
++dnsdb.o:         $(HDRS) dnsdb.c
++dsearch.o:       $(HDRS) dsearch.c
++ibase.o:         $(HDRS) ibase.c
++ldap.o:          $(HDRS) ldap.c
++lsearch.o:       $(HDRS) lsearch.c
++mysql.o:         $(HDRS) mysql.c
++nis.o:           $(HDRS) nis.c
++nisplus.o:       $(HDRS) nisplus.c
++oracle.o:        $(HDRS) oracle.c
++passwd.o:        $(HDRS) passwd.c
++pgsql.o:         $(HDRS) pgsql.c
++spf.o:           $(HDRS) spf.c
++sqlite.o:        $(HDRS) sqlite.c
++testdb.o:        $(HDRS) testdb.c
++whoson.o:        $(HDRS) whoson.c
++
++cdb.so:           $(HDRS) cdb.c
++dbmdb.so:         $(HDRS) dbmdb.c
++dnsdb.so:         $(HDRS) dnsdb.c
++dsearch.so:       $(HDRS) dsearch.c
++ibase.so:         $(HDRS) ibase.c
++ldap.so:          $(HDRS) ldap.c
++lsearch.so:       $(HDRS) lsearch.c
++mysql.so:         $(HDRS) mysql.c
++nis.so:           $(HDRS) nis.c
++nisplus.so:       $(HDRS) nisplus.c
++oracle.so:        $(HDRS) oracle.c
++passwd.so:        $(HDRS) passwd.c
++pgsql.so:         $(HDRS) pgsql.c
++spf.so:           $(HDRS) spf.c
++sqlite.so:        $(HDRS) sqlite.c
++testdb.so:        $(HDRS) testdb.c
++whoson.so:        $(HDRS) whoson.c
+ 
+ # End
+diff --git a/src/src/lookups/cdb.c b/src/src/lookups/cdb.c
+index 68000c6..6e8b887 100644
+--- a/src/src/lookups/cdb.c
++++ b/src/src/lookups/cdb.c
+@@ -56,7 +56,6 @@
+ 
+ #include "../exim.h"
+ #include "lf_functions.h"
+-#include "cdb.h"
+ 
+ #ifdef HAVE_MMAP
+ #  include <sys/mman.h>
+@@ -144,7 +143,9 @@ cdb_unpack(uschar *buf)
+   return num;
+ }
+ 
+-void *
++static void cdb_close(void *handle);
++
++static void *
+ cdb_open(uschar *filename,
+          uschar **errmsg)
+ {
+@@ -245,7 +246,7 @@ cdb_open(uschar *filename,
+ *             Check entry point                  *
+ *************************************************/
+ 
+-BOOL
++static BOOL
+ cdb_check(void *handle,
+          uschar *filename,
+          int modemask,
+@@ -270,7 +271,7 @@ cdb_check(void *handle,
+ *              Find entry point                  *
+ *************************************************/
+ 
+-int
++static int
+ cdb_find(void *handle,
+         uschar *filename,
+         uschar *keystring,
+@@ -418,7 +419,7 @@ cdb_find(void *handle,
+ 
+ /* See local README for interface description */
+ 
+-void
++static void
+ cdb_close(void *handle)
+ {
+ struct cdb_state * cdbp = handle;
+@@ -434,4 +435,22 @@ struct cdb_state * cdbp = handle;
+  (void)close(cdbp->fileno);
+ }
+ 
++lookup_info cdb_lookup_info = {
++  US"cdb",                       /* lookup name */
++  lookup_absfile,                /* uses absolute file name */
++  cdb_open,                      /* open function */
++  cdb_check,                     /* check function */
++  cdb_find,                      /* find function */
++  cdb_close,                     /* close function */
++  NULL,                          /* no tidy function */
++  NULL                           /* no quoting function */
++};
++
++#ifdef DYNLOOKUP
++#define cdb_lookup_module_info _lookup_module_info
++#endif
++
++static lookup_info *_lookup_list[] = { &cdb_lookup_info };
++lookup_module_info cdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
++
+ /* End of lookups/cdb.c */
+diff --git a/src/src/lookups/cdb.h b/src/src/lookups/cdb.h
+deleted file mode 100644
+index 084cafc..0000000
+--- a/src/src/lookups/cdb.h
++++ /dev/null
+@@ -1,59 +0,0 @@
+-/* $Cambridge: exim/src/src/lookups/cdb.h,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
+-
+-/*************************************************
+-*     Exim - an Internet mail transport agent    *
+-*************************************************/
+-
+-/*
+- * $Id: cdb.h,v 1.2.2.1 1998/05/29 16:21:36 cvs Exp $
+- *
+- * Exim - CDB database lookup module
+- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- *
+- * Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
+- *
+- * This program is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU General Public License
+- * as published by the Free Software Foundation; either version 2
+- * of the License, or (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+- * 02111-1307, USA.
+- *
+- *
+- * This code implements Dan Bernstein's Constant DataBase (cdb) spec.
+- * Information, the spec and sample code for cdb can be obtained from
+- *      http://www.pobox.com/~djb/cdb.html
+- *
+- * This implementation borrows some code from Dan Bernstein's
+- * implementation (which has no license restrictions applied to it).
+- * This (read-only) implementation is completely contained within
+- * cdb.[ch] it does *not* link against an external cdb library.
+- *
+- *
+- * There are 2 varients included within this code.  One uses MMAP and
+- * should give better performance especially for multiple lookups on a
+- * modern machine.  The other is the default implementation which is
+- * used in the case where the MMAP fails or if MMAP was not compiled
+- * in.  this implementation is the same as the original reference cdb
+- * implementation.
+- *
+- */
+-
+-
+-/* Functions for reading exim cdb files */
+-
+-extern void *cdb_open(uschar *, uschar **);
+-extern BOOL  cdb_check(void *, uschar *, int, uid_t *, gid_t *, uschar **);
+-extern int   cdb_find(void *, uschar *, uschar *, int, uschar **, uschar **,
+-               BOOL *);
+-extern void  cdb_close(void *);
+-
+-/* End of cdb.h */
+diff --git a/src/src/lookups/dbmdb.c b/src/src/lookups/dbmdb.c
+index 200a204..29a4a3a 100644
+--- a/src/src/lookups/dbmdb.c
++++ b/src/src/lookups/dbmdb.c
+@@ -9,7 +9,6 @@
+ 
+ #include "../exim.h"
+ #include "lf_functions.h"
+-#include "dbmdb.h"
+ 
+ 
+ /*************************************************
+@@ -18,7 +17,7 @@
+ 
+ /* See local README for interface description */
+ 
+-void *
++static void *
+ dbmdb_open(uschar *filename, uschar **errmsg)
+ {
+ EXIM_DB *yield;
+@@ -45,7 +44,7 @@ file name. If USE_TDB or USE_GDBM is set, we know it is tdb or gdbm, which do
+ the same. Otherwise, for safety, we have to check for x.db or x.dir and x.pag.
+ */
+ 
+-BOOL
++static BOOL
+ dbmdb_check(void *handle, uschar *filename, int modemask, uid_t *owners,
+   gid_t *owngroups, uschar **errmsg)
+ {
+@@ -88,7 +87,7 @@ return rc == 0;
+ /* See local README for interface description. This function adds 1 to
+ the keylength in order to include the terminating zero. */
+ 
+-int
++static int
+ dbmdb_find(void *handle, uschar *filename, uschar *keystring, int length,
+   uschar **result, uschar **errmsg, BOOL *do_cache)
+ {
+@@ -122,7 +121,7 @@ return FAIL;
+ /* See local README for interface description */
+ 
+ int
+-dbmnz_find(void *handle, uschar *filename, uschar *keystring, int length,
++static dbmnz_find(void *handle, uschar *filename, uschar *keystring, int length,
+   uschar **result, uschar **errmsg, BOOL *do_cache)
+ {
  return dbmdb_find(handle, filename, keystring, length-1, result, errmsg,
-@@ -138,9 +137,38 @@
+@@ -138,9 +137,38 @@ return dbmdb_find(handle, filename, keystring, length-1, result, errmsg,
  /* See local README for interface description */
  
  void
@@ -1278,11 +1596,13 @@ diff -uNr exim-4.71/src/lookups/dbmdb.c exim-4.71-dynlookup/src/lookups/dbmdb.c
 +lookup_module_info dbmdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 2 };
 +
  /* End of lookups/dbmdb.c */
-diff -uNr exim-4.71/src/lookups/dbmdb.h exim-4.71-dynlookup/src/lookups/dbmdb.h
---- exim-4.71/src/lookups/dbmdb.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dbmdb.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/dbmdb.h b/src/src/lookups/dbmdb.h
+deleted file mode 100644
+index d791383..0000000
+--- a/src/src/lookups/dbmdb.h
++++ /dev/null
 @@ -1,21 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/dbmdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/dbmdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -1303,9 +1623,10 @@ diff -uNr exim-4.71/src/lookups/dbmdb.h exim-4.71-dynlookup/src/lookups/dbmdb.h
 -extern void  dbmdb_close(void *);
 -
 -/* End of lookups/dbmdb.h */
-diff -uNr exim-4.71/src/lookups/dnsdb.c exim-4.71-dynlookup/src/lookups/dnsdb.c
---- exim-4.71/src/lookups/dnsdb.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dnsdb.c	2009-12-24 19:54:47.000000000 +0000
+diff --git a/src/src/lookups/dnsdb.c b/src/src/lookups/dnsdb.c
+index 89ad67d..5c9f96b 100644
+--- a/src/src/lookups/dnsdb.c
++++ b/src/src/lookups/dnsdb.c
 @@ -9,7 +9,6 @@
  
  #include "../exim.h"
@@ -1314,7 +1635,7 @@ diff -uNr exim-4.71/src/lookups/dnsdb.c exim-4.71-dynlookup/src/lookups/dnsdb.c
  
  
  
-@@ -67,7 +66,7 @@
+@@ -67,7 +66,7 @@ static int type_values[] = {
  
  /* See local README for interface description. */
  
@@ -1323,7 +1644,7 @@ diff -uNr exim-4.71/src/lookups/dnsdb.c exim-4.71-dynlookup/src/lookups/dnsdb.c
  dnsdb_open(uschar *filename, uschar **errmsg)
  {
  filename = filename;   /* Keep picky compilers happy */
-@@ -102,7 +101,7 @@
+@@ -108,7 +107,7 @@ default is "TXT".
  which may start with '<' in order to set a specific separator. The default
  separator, as always, is colon. */
  
@@ -1332,7 +1653,7 @@ diff -uNr exim-4.71/src/lookups/dnsdb.c exim-4.71-dynlookup/src/lookups/dnsdb.c
  dnsdb_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -400,4 +399,22 @@
+@@ -430,4 +429,22 @@ yield[ptr] = 0;
  return OK;
  }
  
@@ -1355,11 +1676,13 @@ diff -uNr exim-4.71/src/lookups/dnsdb.c exim-4.71-dynlookup/src/lookups/dnsdb.c
 +lookup_module_info dnsdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 +
  /* End of lookups/dnsdb.c */
-diff -uNr exim-4.71/src/lookups/dnsdb.h exim-4.71-dynlookup/src/lookups/dnsdb.h
---- exim-4.71/src/lookups/dnsdb.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dnsdb.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/dnsdb.h b/src/src/lookups/dnsdb.h
+deleted file mode 100644
+index c0e3a55..0000000
+--- a/src/src/lookups/dnsdb.h
++++ /dev/null
 @@ -1,16 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/dnsdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/dnsdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -1375,10 +1698,11 @@ diff -uNr exim-4.71/src/lookups/dnsdb.h exim-4.71-dynlookup/src/lookups/dnsdb.h
 -               BOOL *);
 -
 -/* End of lookups/dnsdb.h */
-diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearch.c
---- exim-4.71/src/lookups/dsearch.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dsearch.c	2009-12-24 19:54:47.000000000 +0000
-@@ -14,7 +14,6 @@
+diff --git a/src/src/lookups/dsearch.c b/src/src/lookups/dsearch.c
+index ab468ca..575872c 100644
+--- a/src/src/lookups/dsearch.c
++++ b/src/src/lookups/dsearch.c
+@@ -14,7 +14,6 @@ lstat()) rather than a directory scan). */
  
  #include "../exim.h"
  #include "lf_functions.h"
@@ -1386,7 +1710,7 @@ diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearc
  
  
  
-@@ -27,7 +26,7 @@
+@@ -27,7 +26,7 @@ whether it exists and whether it is searchable. However, we don't need to keep
  it open, because the "search" can be done by a call to lstat() rather than
  actually scanning through the list of files. */
  
@@ -1395,7 +1719,7 @@ diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearc
  dsearch_open(uschar *dirname, uschar **errmsg)
  {
  DIR *dp = opendir(CS dirname);
-@@ -51,7 +50,7 @@
+@@ -51,7 +50,7 @@ return (void *)(-1);
  integer as this gives warnings on 64-bit systems. */
  
  BOOL
@@ -1404,7 +1728,7 @@ diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearc
    gid_t *owngroups, uschar **errmsg)
  {
  handle = handle;
-@@ -69,7 +68,7 @@
+@@ -69,7 +68,7 @@ scanning the directory, as it is hopefully faster to let the OS do the scanning
  for us. */
  
  int
@@ -1413,7 +1737,7 @@ diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearc
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
  struct stat statbuf;
-@@ -115,9 +114,27 @@
+@@ -115,9 +114,27 @@ return DEFER;
  /* See local README for interface description */
  
  void
@@ -1442,11 +1766,13 @@ diff -uNr exim-4.71/src/lookups/dsearch.c exim-4.71-dynlookup/src/lookups/dsearc
 +lookup_module_info dsearch_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 +
  /* End of lookups/dsearch.c */
-diff -uNr exim-4.71/src/lookups/dsearch.h exim-4.71-dynlookup/src/lookups/dsearch.h
---- exim-4.71/src/lookups/dsearch.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/dsearch.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/dsearch.h b/src/src/lookups/dsearch.h
+deleted file mode 100644
+index 771e736..0000000
+--- a/src/src/lookups/dsearch.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/dsearch.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/dsearch.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -1464,9 +1790,10 @@ diff -uNr exim-4.71/src/lookups/dsearch.h exim-4.71-dynlookup/src/lookups/dsearc
 -extern void  dsearch_close(void *);
 -
 -/* End of lookups/dsearch.h */
-diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
---- exim-4.71/src/lookups/ibase.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/ibase.c	2009-12-24 19:54:48.000000000 +0000
+diff --git a/src/src/lookups/ibase.c b/src/src/lookups/ibase.c
+index 4ab153d..553d368 100644
+--- a/src/src/lookups/ibase.c
++++ b/src/src/lookups/ibase.c
 @@ -11,14 +11,7 @@
  
  #include "../exim.h"
@@ -1482,7 +1809,7 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
  #include <ibase.h>              /* The system header */
  
  /* Structure and anchor for caching connections. */
-@@ -40,7 +33,7 @@
+@@ -40,7 +33,7 @@ static ibase_connection *ibase_connections = NULL;
  
  /* See local README for interface description. */
  
@@ -1491,7 +1818,7 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
  {
      return (void *) (1);        /* Just return something non-null */
  }
-@@ -53,7 +46,7 @@
+@@ -53,7 +46,7 @@ void *ibase_open(uschar * filename, uschar ** errmsg)
  
  /* See local README for interface description. */
  
@@ -1500,7 +1827,7 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
  {
      ibase_connection *cn;
      ISC_STATUS status[20];
-@@ -458,7 +451,7 @@
+@@ -458,7 +451,7 @@ always leaves enough room for a terminating zero. */
  arguments are not used. Loop through a list of servers while the query is
  deferred with a retryable error. */
  
@@ -1509,7 +1836,7 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
  ibase_find(void *handle, uschar * filename, uschar * query, int length,
             uschar ** result, uschar ** errmsg, BOOL *do_cache)
  {
-@@ -510,7 +503,7 @@
+@@ -510,7 +503,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -1518,7 +1845,7 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
  {
      register int c;
      int count = 0;
-@@ -553,6 +546,22 @@
+@@ -553,6 +546,22 @@ uschar *ibase_quote(uschar * s, uschar * opt)
      return quoted;
  }
  
@@ -1541,11 +1868,13 @@ diff -uNr exim-4.71/src/lookups/ibase.c exim-4.71-dynlookup/src/lookups/ibase.c
 +lookup_module_info ibase_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/ibase.c */
-diff -uNr exim-4.71/src/lookups/ibase.h exim-4.71-dynlookup/src/lookups/ibase.h
---- exim-4.71/src/lookups/ibase.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/ibase.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/ibase.h b/src/src/lookups/ibase.h
+deleted file mode 100644
+index 640772a..0000000
+--- a/src/src/lookups/ibase.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/ibase.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/ibase.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -1563,10 +1892,11 @@ diff -uNr exim-4.71/src/lookups/ibase.h exim-4.71-dynlookup/src/lookups/ibase.h
 -extern uschar *ibase_quote(uschar *, uschar *);
 -
 -/* End of lookups/ibase.h */
-diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
---- exim-4.71/src/lookups/ldap.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/ldap.c	2009-12-24 19:54:49.000000000 +0000
-@@ -15,20 +15,6 @@
+diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
+index 936fe36..461ec15 100644
+--- a/src/src/lookups/ldap.c
++++ b/src/src/lookups/ldap.c
+@@ -15,20 +15,6 @@ researching how to handle the different kinds of error. */
  
  #include "../exim.h"
  #include "lf_functions.h"
@@ -1587,7 +1917,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  
  
  /* Include LDAP headers. The code below uses some "old" LDAP interfaces that
-@@ -1196,7 +1182,7 @@
+@@ -1196,7 +1182,7 @@ return DEFER;
  are handled by a common function, with a flag to differentiate between them.
  The handle and filename arguments are not used. */
  
@@ -1596,7 +1926,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldap_find(void *handle, uschar *filename, uschar *ldap_url, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -1205,7 +1191,7 @@
+@@ -1205,7 +1191,7 @@ do_cache = do_cache;
  return(control_ldap_search(ldap_url, SEARCH_LDAP_SINGLE, result, errmsg));
  }
  
@@ -1605,7 +1935,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldapm_find(void *handle, uschar *filename, uschar *ldap_url, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -1214,7 +1200,7 @@
+@@ -1214,7 +1200,7 @@ do_cache = do_cache;
  return(control_ldap_search(ldap_url, SEARCH_LDAP_MULTIPLE, result, errmsg));
  }
  
@@ -1614,7 +1944,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldapdn_find(void *handle, uschar *filename, uschar *ldap_url, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -1240,7 +1226,7 @@
+@@ -1240,7 +1226,7 @@ return(control_ldap_search(ldap_url, SEARCH_LDAP_AUTH, result, errmsg));
  
  /* See local README for interface description. */
  
@@ -1623,7 +1953,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldap_open(uschar *filename, uschar **errmsg)
  {
  return (void *)(1);    /* Just return something non-null */
-@@ -1255,7 +1241,7 @@
+@@ -1255,7 +1241,7 @@ return (void *)(1);    /* Just return something non-null */
  /* See local README for interface description.
  Make sure that eldap_dn does not refer to reclaimed or worse, freed store */
  
@@ -1632,7 +1962,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldap_tidy(void)
  {
  LDAP_CONNECTION *lcp = NULL;
-@@ -1351,7 +1337,7 @@
+@@ -1351,7 +1337,7 @@ quote_ldap_dn, respectively. */
  
  
  
@@ -1641,7 +1971,7 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
  eldap_quote(uschar *s, uschar *opt)
  {
  register int c;
-@@ -1470,6 +1456,44 @@
+@@ -1470,6 +1456,44 @@ else
  return quoted;
  }
  
@@ -1687,9 +2017,10 @@ diff -uNr exim-4.71/src/lookups/ldap.c exim-4.71-dynlookup/src/lookups/ldap.c
 +lookup_module_info ldap_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 3 };
  
  /* End of lookups/ldap.c */
-diff -uNr exim-4.71/src/lookups/ldap.h exim-4.71-dynlookup/src/lookups/ldap.h
---- exim-4.71/src/lookups/ldap.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/ldap.h	2009-12-24 19:54:49.000000000 +0000
+diff --git a/src/src/lookups/ldap.h b/src/src/lookups/ldap.h
+index b0f0ae5..21069e0 100644
+--- a/src/src/lookups/ldap.h
++++ b/src/src/lookups/ldap.h
 @@ -7,18 +7,9 @@
  /* Copyright (c) University of Cambridge 1995 - 2009 */
  /* See the file NOTICE for conditions of use and distribution. */
@@ -1710,9 +2041,10 @@ diff -uNr exim-4.71/src/lookups/ldap.h exim-4.71-dynlookup/src/lookups/ldap.h
 -extern uschar *eldap_quote(uschar *, uschar *);
  
  /* End of lookups/ldap.h */
-diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearch.c
---- exim-4.71/src/lookups/lsearch.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/lsearch.c	2009-12-24 19:54:49.000000000 +0000
+diff --git a/src/src/lookups/lsearch.c b/src/src/lookups/lsearch.c
+index ccb4850..5d64638 100644
+--- a/src/src/lookups/lsearch.c
++++ b/src/src/lookups/lsearch.c
 @@ -9,7 +9,6 @@
  
  #include "../exim.h"
@@ -1721,7 +2053,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  
  /* Codes for the different kinds of lsearch that are supported */
  
-@@ -28,7 +27,7 @@
+@@ -28,7 +27,7 @@ enum {
  
  /* See local README for interface description */
  
@@ -1730,7 +2062,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  lsearch_open(uschar *filename, uschar **errmsg)
  {
  FILE *f = Ufopen(filename, "rb");
-@@ -48,7 +47,7 @@
+@@ -48,7 +47,7 @@ return f;
  *             Check entry point                  *
  *************************************************/
  
@@ -1739,7 +2071,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  lsearch_check(void *handle, uschar *filename, int modemask, uid_t *owners,
    gid_t *owngroups, uschar **errmsg)
  {
-@@ -324,7 +323,7 @@
+@@ -324,7 +323,7 @@ return FAIL;
  
  /* See local README for interface description */
  
@@ -1748,7 +2080,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  lsearch_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -341,7 +340,7 @@
+@@ -341,7 +340,7 @@ return internal_lsearch_find(handle, filename, keystring, length, result,
  
  /* See local README for interface description */
  
@@ -1757,7 +2089,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  wildlsearch_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -358,7 +357,7 @@
+@@ -358,7 +357,7 @@ return internal_lsearch_find(handle, filename, keystring, length, result,
  
  /* See local README for interface description */
  
@@ -1766,7 +2098,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  nwildlsearch_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -376,7 +375,7 @@
+@@ -376,7 +375,7 @@ return internal_lsearch_find(handle, filename, keystring, length, result,
  
  /* See local README for interface description */
  
@@ -1775,7 +2107,7 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
  iplsearch_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -405,10 +404,64 @@
+@@ -405,10 +404,64 @@ else
  
  /* See local README for interface description */
  
@@ -1841,11 +2173,13 @@ diff -uNr exim-4.71/src/lookups/lsearch.c exim-4.71-dynlookup/src/lookups/lsearc
 +lookup_module_info lsearch_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 4 };
 +
  /* End of lookups/lsearch.c */
-diff -uNr exim-4.71/src/lookups/lsearch.h exim-4.71-dynlookup/src/lookups/lsearch.h
---- exim-4.71/src/lookups/lsearch.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/lsearch.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/lsearch.h b/src/src/lookups/lsearch.h
+deleted file mode 100644
+index 332b01c..0000000
+--- a/src/src/lookups/lsearch.h
++++ /dev/null
 @@ -1,25 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/lsearch.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/lsearch.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -1870,263 +2204,11 @@ diff -uNr exim-4.71/src/lookups/lsearch.h exim-4.71-dynlookup/src/lookups/lsearc
 -               uschar **, BOOL *);
 -
 -/* End of lookups/lsearch.h */
-diff -uNr exim-4.71/src/lookups/Makefile exim-4.71-dynlookup/src/lookups/Makefile
---- exim-4.71/src/lookups/Makefile	2009-06-10 08:34:05.000000000 +0100
-+++ exim-4.71-dynlookup/src/lookups/Makefile	2009-12-24 19:54:45.000000000 +0000
-@@ -1,13 +1,171 @@
- # $Cambridge: exim/exim-src/src/lookups/Makefile,v 1.9 2009/06/10 07:34:05 tom Exp $
- 
--# Make file for building a library containing all the available lookups and
--# calling it lookups.a. This is called from the main make file, after cd'ing
--# to the lookups subdirectory. When the relevant LOOKUP_ macros are not
--# defined, dummy modules get compiled.
--
--OBJ = cdb.o dbmdb.o dnsdb.o dsearch.o ibase.o ldap.o lsearch.o mysql.o nis.o \
--      nisplus.o oracle.o passwd.o pgsql.o spf.o sqlite.o testdb.o whoson.o \
--      lf_check_file.o lf_quote.o lf_sqlperform.o
-+# Make file for building all the available lookups.
-+# This is called from the main make file, after cd'ing
-+# to the lookups subdirectory.
-+
-+# because the variable is EXPERIMENTAL_SPF and not LOOKUP_SPF
-+# we put this one here by default and compile a dummy if
-+# EXPERIMENTAL_SPF is not defined
-+OBJ=spf.o
-+MODS=
-+
-+ifeq ($(LOOKUP_CDB),2)
-+MODS += cdb.so
-+LOOKUP_cdb_INCLUDE = $(LOOKUP_CDB_INCLUDE)
-+LOOKUP_cdb_LIBS = $(LOOKUP_CDB_LIBS)
-+else
-+ifneq ($(LOOKUP_CDB),)
-+OBJ += cdb.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_DBM),2)
-+MODS += dbmdb.so
-+LOOKUP_dbmdb_INCLUDE = $(LOOKUP_DBM_INCLUDE)
-+LOOKUP_dbmdb_LIBS = $(LOOKUP_DBM_LIBS)
-+else
-+ifneq ($(LOOKUP_DBM),)
-+OBJ += dbmdb.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_DNSDB),2)
-+MODS += dnsdb.so
-+LOOKUP_dnsdb_INCLUDE = $(LOOKUP_DNSDB_INCLUDE)
-+LOOKUP_dnsdb_LIBS = $(LOOKUP_DNSDB_LIBS)
-+else
-+ifneq ($(LOOKUP_DNSDB),)
-+OBJ += dnsdb.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_DSEARCH),2)
-+MODS += dsearch.so
-+LOOKUP_dsearch_INCLUDE = $(LOOKUP_DSEARCH_INCLUDE)
-+LOOKUP_dsearch_LIBS = $(LOOKUP_DSEARCH_LIBS)
-+else
-+ifneq ($(LOOKUP_DSEARCH),)
-+OBJ += dsearch.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_IBASE),2)
-+MODS += ibase.so
-+LOOKUP_ibase_INCLUDE = $(LOOKUP_IBASE_INCLUDE)
-+LOOKUP_ibase_LIBS = $(LOOKUP_IBASE_LIBS)
-+else
-+ifneq ($(LOOKUP_IBASE),)
-+OBJ += ibase.o
-+endif
-+endif
-+
-+ifneq ($(LOOKUP_LDAP),)
-+OBJ += ldap.o
-+endif
-+
-+ifeq ($(LOOKUP_LSEARCH),2)
-+MODS += lsearch.so
-+LOOKUP_lsearch_INCLUDE = $(LOOKUP_LSEARCH_INCLUDE)
-+LOOKUP_lsearch_LIBS = $(LOOKUP_LSEARCH_LIBS)
-+else
-+ifneq ($(LOOKUP_LSEARCH),)
-+OBJ += lsearch.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_MYSQL),2)
-+MODS += mysql.so
-+LOOKUP_mysql_INCLUDE = $(LOOKUP_MYSQL_INCLUDE)
-+LOOKUP_mysql_LIBS = $(LOOKUP_MYSQL_LIBS)
-+else
-+ifneq ($(LOOKUP_MYSQL),)
-+OBJ += mysql.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_NIS),2)
-+MODS += nis.so
-+LOOKUP_nis_INCLUDE = $(LOOKUP_NIS_INCLUDE)
-+LOOKUP_nis_LIBS = $(LOOKUP_NIS_LIBS)
-+else
-+ifneq ($(LOOKUP_NIS),)
-+OBJ += nis.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_NISPLUS),2)
-+MODS += nisplus.so
-+LOOKUP_nisplus_INCLUDE = $(LOOKUP_NISPLUS_INCLUDE)
-+LOOKUP_nisplus_LIBS = $(LOOKUP_NISPLUS_LIBS)
-+else
-+ifneq ($(LOOKUP_NISPLUS),)
-+OBJ += nisplus.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_ORACLE),2)
-+MODS += oracle.so
-+LOOKUP_oracle_INCLUDE = $(LOOKUP_ORACLE_INCLUDE)
-+LOOKUP_oracle_LIBS = $(LOOKUP_ORACLE_LIBS)
-+else
-+ifneq ($(LOOKUP_ORACLE),)
-+OBJ += oracle.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_PASSWD),2)
-+MODS += passwd.so
-+LOOKUP_passwd_INCLUDE = $(LOOKUP_PASSWD_INCLUDE)
-+LOOKUP_passwd_LIBS = $(LOOKUP_PASSWD_LIBS)
-+else
-+ifneq ($(LOOKUP_PASSWD),)
-+OBJ += passwd.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_PGSQL),2)
-+MODS += pgsql.so
-+LOOKUP_pgsql_INCLUDE = $(LOOKUP_PGSQL_INCLUDE)
-+LOOKUP_pgsql_LIBS = $(LOOKUP_PGSQL_LIBS)
-+else
-+ifneq ($(LOOKUP_PGSQL),)
-+OBJ += pgsql.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_SQLITE),2)
-+MODS += sqlite.so
-+LOOKUP_sqlite_INCLUDE = $(LOOKUP_SQLITE_INCLUDE)
-+LOOKUP_sqlite_LIBS = $(LOOKUP_SQLITE_LIBS)
-+else
-+ifneq ($(LOOKUP_SQLITE),)
-+OBJ += sqlite.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_TESTDB),2)
-+MODS += testdb.so
-+LOOKUP_testdb_INCLUDE = $(LOOKUP_TESTDB_INCLUDE)
-+LOOKUP_testdb_LIBS = $(LOOKUP_TESTDB_LIBS)
-+else
-+ifneq ($(LOOKUP_TESTDB),)
-+OBJ += testdb.o
-+endif
-+endif
-+
-+ifeq ($(LOOKUP_WHOSON),2)
-+MODS += whoson.so
-+LOOKUP_whoson_INCLUDE = $(LOOKUP_WHOSON_INCLUDE)
-+LOOKUP_whoson_LIBS = $(LOOKUP_WHOSON_LIBS)
-+else
-+ifneq ($(LOOKUP_WHOSON),)
-+OBJ += whoson.o
-+endif
-+endif
-+
-+
-+all:             lookups.a lf_quote.o lf_check_file.o lf_sqlperform.o $(MODS)
- 
- lookups.a:       $(OBJ)
- 		 @$(RM_COMMAND) -f lookups.a
-@@ -15,30 +173,51 @@
- 		 @$(AR) lookups.a $(OBJ)
- 		 $(RANLIB) $@
- 
--.SUFFIXES:       .o .c
-+.SUFFIXES:       .o .c .so
- .c.o:;           @echo "$(CC) $*.c"
- 		 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
- 
-+.c.so:;          @echo "$(CC) -shared $*.c"
-+		 $(FE)$(CC) $(LOOKUP_$*_INCLUDE) $(LOOKUP_$*_LIBS) -DDYNLOOKUP -shared -rdynamic $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@
-+
- lf_check_file.o: $(HDRS) lf_check_file.c  lf_functions.h
- lf_quote.o:      $(HDRS) lf_quote.c       lf_functions.h
- lf_sqlperform.o: $(HDRS) lf_sqlperform.c  lf_functions.h
- 
--cdb.o:           $(HDRS) cdb.c       cdb.h
--dbmdb.o:         $(HDRS) dbmdb.c     dbmdb.h
--dnsdb.o:         $(HDRS) dnsdb.c     dnsdb.h
--dsearch.o:       $(HDRS) dsearch.c   dsearch.h
--ibase.o:         $(HDRS) ibase.c     ibase.h
--ldap.o:          $(HDRS) ldap.c      ldap.h
--lsearch.o:       $(HDRS) lsearch.c   lsearch.h
--mysql.o:         $(HDRS) mysql.c     mysql.h
--nis.o:           $(HDRS) nis.c       nis.h
--nisplus.o:       $(HDRS) nisplus.c   nisplus.h
--oracle.o:        $(HDRS) oracle.c    oracle.h
--passwd.o:        $(HDRS) passwd.c    passwd.h
--pgsql.o:         $(HDRS) pgsql.c     pgsql.h
--spf.o:           $(HDRS) spf.c       spf.h
--sqlite.o:        $(HDRS) sqlite.c    sqlite.h
--testdb.o:        $(HDRS) testdb.c    testdb.h
--whoson.o:        $(HDRS) whoson.c    whoson.h
-+cdb.o:           $(HDRS) cdb.c
-+dbmdb.o:         $(HDRS) dbmdb.c
-+dnsdb.o:         $(HDRS) dnsdb.c
-+dsearch.o:       $(HDRS) dsearch.c
-+ibase.o:         $(HDRS) ibase.c
-+ldap.o:          $(HDRS) ldap.c
-+lsearch.o:       $(HDRS) lsearch.c
-+mysql.o:         $(HDRS) mysql.c
-+nis.o:           $(HDRS) nis.c
-+nisplus.o:       $(HDRS) nisplus.c
-+oracle.o:        $(HDRS) oracle.c
-+passwd.o:        $(HDRS) passwd.c
-+pgsql.o:         $(HDRS) pgsql.c
-+spf.o:           $(HDRS) spf.c
-+sqlite.o:        $(HDRS) sqlite.c
-+testdb.o:        $(HDRS) testdb.c
-+whoson.o:        $(HDRS) whoson.c
-+
-+cdb.so:           $(HDRS) cdb.c
-+dbmdb.so:         $(HDRS) dbmdb.c
-+dnsdb.so:         $(HDRS) dnsdb.c
-+dsearch.so:       $(HDRS) dsearch.c
-+ibase.so:         $(HDRS) ibase.c
-+ldap.so:          $(HDRS) ldap.c
-+lsearch.so:       $(HDRS) lsearch.c
-+mysql.so:         $(HDRS) mysql.c
-+nis.so:           $(HDRS) nis.c
-+nisplus.so:       $(HDRS) nisplus.c
-+oracle.so:        $(HDRS) oracle.c
-+passwd.so:        $(HDRS) passwd.c
-+pgsql.so:         $(HDRS) pgsql.c
-+spf.so:           $(HDRS) spf.c
-+sqlite.so:        $(HDRS) sqlite.c
-+testdb.so:        $(HDRS) testdb.c
-+whoson.so:        $(HDRS) whoson.c
- 
- # End
-diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
---- exim-4.71/src/lookups/mysql.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/mysql.c	2009-12-24 19:54:49.000000000 +0000
-@@ -13,22 +13,6 @@
+diff --git a/src/src/lookups/mysql.c b/src/src/lookups/mysql.c
+index f2e9a15..97b9c11 100644
+--- a/src/src/lookups/mysql.c
++++ b/src/src/lookups/mysql.c
+@@ -13,22 +13,6 @@ functions. */
  
  #include "../exim.h"
  #include "lf_functions.h"
@@ -2149,7 +2231,7 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
  
  #include <mysql.h>       /* The system header */
  
-@@ -51,7 +35,7 @@
+@@ -51,7 +35,7 @@ static mysql_connection *mysql_connections = NULL;
  
  /* See local README for interface description. */
  
@@ -2158,7 +2240,7 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
  mysql_open(uschar *filename, uschar **errmsg)
  {
  return (void *)(1);    /* Just return something non-null */
-@@ -65,7 +49,7 @@
+@@ -65,7 +49,7 @@ return (void *)(1);    /* Just return something non-null */
  
  /* See local README for interface description. */
  
@@ -2167,7 +2249,7 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
  mysql_tidy(void)
  {
  mysql_connection *cn;
-@@ -342,7 +326,7 @@
+@@ -357,7 +341,7 @@ arguments are not used. The code to loop through a list of servers while the
  query is deferred with a retryable error is now in a separate function that is
  shared with other SQL lookups. */
  
@@ -2176,7 +2258,7 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
  mysql_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -372,7 +356,7 @@
+@@ -387,7 +371,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -2185,10 +2267,12 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
  mysql_quote(uschar *s, uschar *opt)
  {
  register int c;
-@@ -414,7 +398,24 @@
+@@ -429,7 +413,24 @@ while ((c = *s++) != 0)
  return quoted;
  }
  
+-
+-#endif  /* MYSQL_LOOKUP */
 +/* These are the lookup_info blocks for this driver */
 +
 +static lookup_info mysql_lookup_info = {
@@ -2205,17 +2289,18 @@ diff -uNr exim-4.71/src/lookups/mysql.c exim-4.71-dynlookup/src/lookups/mysql.c
 +#ifdef DYNLOOKUP
 +#define mysql_lookup_module_info _lookup_module_info
 +#endif
- 
--#endif  /* MYSQL_LOOKUP */
++
 +static lookup_info *_lookup_list[] = { &mysql_lookup_info };
 +lookup_module_info mysql_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/mysql.c */
-diff -uNr exim-4.71/src/lookups/mysql.h exim-4.71-dynlookup/src/lookups/mysql.h
---- exim-4.71/src/lookups/mysql.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/mysql.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/mysql.h b/src/src/lookups/mysql.h
+deleted file mode 100644
+index df7b555..0000000
+--- a/src/src/lookups/mysql.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/mysql.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/mysql.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2233,9 +2318,10 @@ diff -uNr exim-4.71/src/lookups/mysql.h exim-4.71-dynlookup/src/lookups/mysql.h
 -extern uschar *mysql_quote(uschar *, uschar *);
 -
 -/* End of lookups/mysql.h */
-diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
---- exim-4.71/src/lookups/nis.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/nis.c	2009-12-24 19:54:50.000000000 +0000
+diff --git a/src/src/lookups/nis.c b/src/src/lookups/nis.c
+index ad04e0a..8177f4b 100644
+--- a/src/src/lookups/nis.c
++++ b/src/src/lookups/nis.c
 @@ -9,19 +9,6 @@
  
  #include "../exim.h"
@@ -2256,7 +2342,7 @@ diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
  
  #include <rpcsvc/ypclnt.h>
  
-@@ -33,7 +20,7 @@
+@@ -33,7 +20,7 @@ static void dummy(int x) { dummy(x-1); }
  /* See local README for interface description. This serves for both
  the "nis" and "nis0" lookup types. */
  
@@ -2265,7 +2351,7 @@ diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
  nis_open(uschar *filename, uschar **errmsg)
  {
  char *nis_domain;
-@@ -55,7 +42,7 @@
+@@ -55,7 +42,7 @@ return nis_domain;
  for nis0 because they are so short it isn't worth trying to use any common
  code. */
  
@@ -2274,7 +2360,7 @@ diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
  nis_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -81,7 +68,7 @@
+@@ -81,7 +68,7 @@ return (rc == YPERR_KEY || rc == YPERR_MAP)? FAIL : DEFER;
  
  /* See local README for interface description. */
  
@@ -2283,7 +2369,7 @@ diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
  nis0_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -99,6 +86,33 @@
+@@ -99,6 +86,33 @@ if ((rc = yp_match(CS handle, CS filename, CS keystring, length + 1,
  return (rc == YPERR_KEY || rc == YPERR_MAP)? FAIL : DEFER;
  }
  
@@ -2318,11 +2404,13 @@ diff -uNr exim-4.71/src/lookups/nis.c exim-4.71-dynlookup/src/lookups/nis.c
 +lookup_module_info nis_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 2 };
  
  /* End of lookups/nis.c */
-diff -uNr exim-4.71/src/lookups/nis.h exim-4.71-dynlookup/src/lookups/nis.h
---- exim-4.71/src/lookups/nis.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/nis.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/nis.h b/src/src/lookups/nis.h
+deleted file mode 100644
+index cd4ca58..0000000
+--- a/src/src/lookups/nis.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/nis.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/nis.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2340,9 +2428,10 @@ diff -uNr exim-4.71/src/lookups/nis.h exim-4.71-dynlookup/src/lookups/nis.h
 -               BOOL *);
 -
 -/* End of lookups/nis.h */
-diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplus.c
---- exim-4.71/src/lookups/nisplus.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/nisplus.c	2009-12-24 19:54:51.000000000 +0000
+diff --git a/src/src/lookups/nisplus.c b/src/src/lookups/nisplus.c
+index 33d4ffe..5213af3 100644
+--- a/src/src/lookups/nisplus.c
++++ b/src/src/lookups/nisplus.c
 @@ -9,21 +9,6 @@
  
  #include "../exim.h"
@@ -2365,7 +2454,7 @@ diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplu
  
  #include <rpcsvc/nis.h>
  
-@@ -34,7 +19,7 @@
+@@ -34,7 +19,7 @@ static void dummy(int x) { dummy(x-1); }
  
  /* See local README for interface description. */
  
@@ -2374,7 +2463,7 @@ diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplu
  nisplus_open(uschar *filename, uschar **errmsg)
  {
  return (void *)(1);    /* Just return something non-null */
-@@ -58,7 +43,7 @@
+@@ -58,7 +43,7 @@ name tagged on the end after a colon. If there is no result-field name, the
  yield is the concatenation of all the fields, preceded by their names and an
  equals sign. */
  
@@ -2383,7 +2472,7 @@ diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplu
  nisplus_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -250,7 +235,7 @@
+@@ -250,7 +235,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -2392,7 +2481,7 @@ diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplu
  nisplus_quote(uschar *s, uschar *opt)
  {
  int count = 0;
-@@ -274,6 +259,22 @@
+@@ -274,6 +259,22 @@ while (*s != 0)
  return quoted;
  }
  
@@ -2416,11 +2505,13 @@ diff -uNr exim-4.71/src/lookups/nisplus.c exim-4.71-dynlookup/src/lookups/nisplu
 +lookup_module_info nisplus_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/nisplus.c */
-diff -uNr exim-4.71/src/lookups/nisplus.h exim-4.71-dynlookup/src/lookups/nisplus.h
---- exim-4.71/src/lookups/nisplus.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/nisplus.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/nisplus.h b/src/src/lookups/nisplus.h
+deleted file mode 100644
+index aa25696..0000000
+--- a/src/src/lookups/nisplus.h
++++ /dev/null
 @@ -1,17 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/nisplus.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/nisplus.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2437,10 +2528,11 @@ diff -uNr exim-4.71/src/lookups/nisplus.h exim-4.71-dynlookup/src/lookups/nisplu
 -extern uschar *nisplus_quote(uschar *, uschar *);
 -
 -/* End of lookups/nisplus.h */
-diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.c
---- exim-4.71/src/lookups/oracle.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/oracle.c	2009-12-24 19:54:51.000000000 +0000
-@@ -15,27 +15,12 @@
+diff --git a/src/src/lookups/oracle.c b/src/src/lookups/oracle.c
+index 5997f19..50dfb4a 100644
+--- a/src/src/lookups/oracle.c
++++ b/src/src/lookups/oracle.c
+@@ -15,27 +15,12 @@ some comments from my position of Oracle ignorance. */
  #include "../exim.h"
  
  
@@ -2468,7 +2560,7 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
  #define PARSE_NO_DEFER           0     /* parse straight away */
  #define PARSE_V7_LNG             2
  #define MAX_ITEM_BUFFER_SIZE  1024     /* largest size of a cell of data */
-@@ -212,7 +197,7 @@
+@@ -212,7 +197,7 @@ return col;
  
  /* See local README for interface description. */
  
@@ -2477,7 +2569,7 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
  oracle_open(uschar *filename, uschar **errmsg)
  {
  return (void *)(1);    /* Just return something non-null */
-@@ -226,7 +211,7 @@
+@@ -226,7 +211,7 @@ return (void *)(1);    /* Just return something non-null */
  
  /* See local README for interface description. */
  
@@ -2486,7 +2578,7 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
  oracle_tidy(void)
  {
  oracle_connection *cn;
-@@ -532,7 +517,7 @@
+@@ -532,7 +517,7 @@ else
  arguments are not used. Loop through a list of servers while the query is
  deferred with a retryable error. */
  
@@ -2495,7 +2587,7 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
  oracle_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -577,7 +562,7 @@
+@@ -577,7 +562,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -2504,7 +2596,7 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
  oracle_quote(uschar *s, uschar *opt)
  {
  register int c;
-@@ -619,6 +604,22 @@
+@@ -619,6 +604,22 @@ while ((c = *s++) != 0)
  return quoted;
  }
  
@@ -2528,11 +2620,13 @@ diff -uNr exim-4.71/src/lookups/oracle.c exim-4.71-dynlookup/src/lookups/oracle.
 +lookup_module_info oracle_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/oracle.c */
-diff -uNr exim-4.71/src/lookups/oracle.h exim-4.71-dynlookup/src/lookups/oracle.h
---- exim-4.71/src/lookups/oracle.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/oracle.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/oracle.h b/src/src/lookups/oracle.h
+deleted file mode 100644
+index b642796..0000000
+--- a/src/src/lookups/oracle.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/oracle.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/oracle.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2550,9 +2644,10 @@ diff -uNr exim-4.71/src/lookups/oracle.h exim-4.71-dynlookup/src/lookups/oracle.
 -extern uschar *oracle_quote(uschar *, uschar *);
 -
 -/* End of lookups/oracle.h */
-diff -uNr exim-4.71/src/lookups/passwd.c exim-4.71-dynlookup/src/lookups/passwd.c
---- exim-4.71/src/lookups/passwd.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/passwd.c	2009-12-24 19:54:52.000000000 +0000
+diff --git a/src/src/lookups/passwd.c b/src/src/lookups/passwd.c
+index 481be2c..420eefc 100644
+--- a/src/src/lookups/passwd.c
++++ b/src/src/lookups/passwd.c
 @@ -8,7 +8,6 @@
  /* See the file NOTICE for conditions of use and distribution. */
  
@@ -2570,7 +2665,7 @@ diff -uNr exim-4.71/src/lookups/passwd.c exim-4.71-dynlookup/src/lookups/passwd.
  passwd_open(uschar *filename, uschar **errmsg)
  {
  filename = filename;     /* Keep picky compilers happy */
-@@ -35,7 +34,7 @@
+@@ -35,7 +34,7 @@ return (void *)(-1);     /* Just return something non-null */
  
  /* See local README for interface description */
  
@@ -2579,7 +2674,7 @@ diff -uNr exim-4.71/src/lookups/passwd.c exim-4.71-dynlookup/src/lookups/passwd.
  passwd_find(void *handle, uschar *filename, uschar *keystring, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -53,4 +52,22 @@
+@@ -53,4 +52,22 @@ if (!route_finduser(keystring, &pw, NULL)) return FAIL;
  return OK;
  }
  
@@ -2602,11 +2697,13 @@ diff -uNr exim-4.71/src/lookups/passwd.c exim-4.71-dynlookup/src/lookups/passwd.
 +lookup_module_info passwd_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 +
  /* End of lookups/passwd.c */
-diff -uNr exim-4.71/src/lookups/passwd.h exim-4.71-dynlookup/src/lookups/passwd.h
---- exim-4.71/src/lookups/passwd.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/passwd.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/passwd.h b/src/src/lookups/passwd.h
+deleted file mode 100644
+index 5624a01..0000000
+--- a/src/src/lookups/passwd.h
++++ /dev/null
 @@ -1,16 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/passwd.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/passwd.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2622,10 +2719,11 @@ diff -uNr exim-4.71/src/lookups/passwd.h exim-4.71-dynlookup/src/lookups/passwd.
 -               BOOL *);
 -
 -/* End of lookups/passwd.h */
-diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
---- exim-4.71/src/lookups/pgsql.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/pgsql.c	2009-12-24 19:54:52.000000000 +0000
-@@ -13,21 +13,6 @@
+diff --git a/src/src/lookups/pgsql.c b/src/src/lookups/pgsql.c
+index 287ddcd..5bd9627 100644
+--- a/src/src/lookups/pgsql.c
++++ b/src/src/lookups/pgsql.c
+@@ -13,21 +13,6 @@ socket extension. */
  
  #include "../exim.h"
  #include "lf_functions.h"
@@ -2647,7 +2745,7 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
  
  #include <libpq-fe.h>       /* The system header */
  
-@@ -49,7 +34,7 @@
+@@ -49,7 +34,7 @@ static pgsql_connection *pgsql_connections = NULL;
  
  /* See local README for interface description. */
  
@@ -2656,7 +2754,7 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
  pgsql_open(uschar *filename, uschar **errmsg)
  {
  return (void *)(1);    /* Just return something non-null */
-@@ -63,7 +48,7 @@
+@@ -63,7 +48,7 @@ return (void *)(1);    /* Just return something non-null */
  
  /* See local README for interface description. */
  
@@ -2665,7 +2763,7 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
  pgsql_tidy(void)
  {
  pgsql_connection *cn;
-@@ -414,7 +399,7 @@
+@@ -414,7 +399,7 @@ arguments are not used. The code to loop through a list of servers while the
  query is deferred with a retryable error is now in a separate function that is
  shared with other SQL lookups. */
  
@@ -2674,7 +2772,7 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
  pgsql_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -454,7 +439,7 @@
+@@ -454,7 +439,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -2683,7 +2781,7 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
  pgsql_quote(uschar *s, uschar *opt)
  {
  register int c;
-@@ -501,6 +486,22 @@
+@@ -501,6 +486,22 @@ while ((c = *s++) != 0)
  return quoted;
  }
  
@@ -2707,11 +2805,13 @@ diff -uNr exim-4.71/src/lookups/pgsql.c exim-4.71-dynlookup/src/lookups/pgsql.c
 +lookup_module_info pgsql_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/pgsql.c */
-diff -uNr exim-4.71/src/lookups/pgsql.h exim-4.71-dynlookup/src/lookups/pgsql.h
---- exim-4.71/src/lookups/pgsql.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/pgsql.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/pgsql.h b/src/src/lookups/pgsql.h
+deleted file mode 100644
+index 228e314..0000000
+--- a/src/src/lookups/pgsql.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/pgsql.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/pgsql.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2729,10 +2829,11 @@ diff -uNr exim-4.71/src/lookups/pgsql.h exim-4.71-dynlookup/src/lookups/pgsql.h
 -extern uschar *pgsql_quote(uschar *, uschar *);
 -
 -/* End of lookups/pgsql.h */
-diff -uNr exim-4.71/src/lookups/spf.c exim-4.71-dynlookup/src/lookups/spf.c
---- exim-4.71/src/lookups/spf.c	2009-11-11 14:43:28.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/spf.c	2009-12-24 19:54:53.000000000 +0000
-@@ -24,7 +24,6 @@
+diff --git a/src/src/lookups/spf.c b/src/src/lookups/spf.c
+index ee2a2c7..2ca4bba 100644
+--- a/src/src/lookups/spf.c
++++ b/src/src/lookups/spf.c
+@@ -24,7 +24,6 @@ static void dummy(int x) { dummy(x-1); }
  #else
  
  #include "lf_functions.h"
@@ -2740,7 +2841,7 @@ diff -uNr exim-4.71/src/lookups/spf.c exim-4.71-dynlookup/src/lookups/spf.c
  #ifndef HAVE_NS_TYPE
  #define HAVE_NS_TYPE
  #endif
-@@ -32,7 +31,7 @@
+@@ -32,7 +31,7 @@ static void dummy(int x) { dummy(x-1); }
  #include <spf2/spf_dns_resolv.h>
  #include <spf2/spf_dns_cache.h>
  
@@ -2749,7 +2850,7 @@ diff -uNr exim-4.71/src/lookups/spf.c exim-4.71-dynlookup/src/lookups/spf.c
    SPF_server_t *spf_server = NULL;
    spf_server = SPF_server_new(SPF_DNS_CACHE, 0);
    if (spf_server == NULL) {
-@@ -42,12 +41,12 @@
+@@ -42,12 +41,12 @@ void *spf_open(uschar *filename, uschar **errmsg) {
    return (void *) spf_server;
  }
  
@@ -2764,7 +2865,7 @@ diff -uNr exim-4.71/src/lookups/spf.c exim-4.71-dynlookup/src/lookups/spf.c
               uschar **result, uschar **errmsg, BOOL *do_cache) {
    SPF_server_t *spf_server = handle;
    SPF_request_t *spf_request = NULL;
-@@ -75,4 +74,22 @@
+@@ -75,4 +74,22 @@ int spf_find(void *handle, uschar *filename, uschar *keystring, int key_len,
    return OK;
  }
  
@@ -2787,11 +2888,13 @@ diff -uNr exim-4.71/src/lookups/spf.c exim-4.71-dynlookup/src/lookups/spf.c
 +lookup_module_info spf_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 +
  #endif /* EXPERIMENTAL_SPF */
-diff -uNr exim-4.71/src/lookups/spf.h exim-4.71-dynlookup/src/lookups/spf.h
---- exim-4.71/src/lookups/spf.h	2005-05-25 21:07:55.000000000 +0100
-+++ exim-4.71-dynlookup/src/lookups/spf.h	2009-12-24 19:54:53.000000000 +0000
+diff --git a/src/src/lookups/spf.h b/src/src/lookups/spf.h
+deleted file mode 100644
+index 6b9056a..0000000
+--- a/src/src/lookups/spf.h
++++ /dev/null
 @@ -1,26 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/spf.h,v 1.1 2005/05/25 20:07:55 tom Exp $ */
+-/* $Cambridge: exim/src/src/lookups/spf.h,v 1.1 2005/05/25 20:07:55 tom Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2817,9 +2920,10 @@ diff -uNr exim-4.71/src/lookups/spf.h exim-4.71-dynlookup/src/lookups/spf.h
 -extern int spf_find(void *, uschar *, uschar *, int, uschar **, uschar **,
 -                    BOOL *);
 -
-diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.c
---- exim-4.71/src/lookups/sqlite.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/sqlite.c	2009-12-24 19:54:53.000000000 +0000
+diff --git a/src/src/lookups/sqlite.c b/src/src/lookups/sqlite.c
+index 654c5c6..5759c43 100644
+--- a/src/src/lookups/sqlite.c
++++ b/src/src/lookups/sqlite.c
 @@ -9,11 +9,7 @@
  
  #include "../exim.h"
@@ -2832,7 +2936,7 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
  #include <sqlite3.h>
  
  
-@@ -23,7 +19,7 @@
+@@ -23,7 +19,7 @@ static void dummy(int x) { dummy(x-1); }
  
  /* See local README for interface description. */
  
@@ -2841,7 +2945,7 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
  sqlite_open(uschar *filename, uschar **errmsg)
  {
  sqlite3 *db = NULL;
-@@ -85,7 +81,7 @@
+@@ -85,7 +81,7 @@ return 0;
  }
  
  
@@ -2850,7 +2954,7 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
  sqlite_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -113,7 +109,7 @@
+@@ -113,7 +109,7 @@ return OK;
  
  /* See local README for interface description. */
  
@@ -2859,7 +2963,7 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
  {
  sqlite3_close(handle);
  }
-@@ -134,7 +130,7 @@
+@@ -134,7 +130,7 @@ Arguments:
  Returns:     the processed string or NULL for a bad option
  */
  
@@ -2868,7 +2972,7 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
  sqlite_quote(uschar *s, uschar *opt)
  {
  register int c;
-@@ -159,6 +155,22 @@
+@@ -159,6 +155,22 @@ while ((c = *s++) != 0)
  return quoted;
  }
  
@@ -2892,11 +2996,13 @@ diff -uNr exim-4.71/src/lookups/sqlite.c exim-4.71-dynlookup/src/lookups/sqlite.
 +lookup_module_info sqlite_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/sqlite.c */
-diff -uNr exim-4.71/src/lookups/sqlite.h exim-4.71-dynlookup/src/lookups/sqlite.h
---- exim-4.71/src/lookups/sqlite.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/sqlite.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/sqlite.h b/src/src/lookups/sqlite.h
+deleted file mode 100644
+index 15df25f..0000000
+--- a/src/src/lookups/sqlite.h
++++ /dev/null
 @@ -1,18 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/sqlite.h,v 1.4 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/sqlite.h,v 1.4 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2914,9 +3020,10 @@ diff -uNr exim-4.71/src/lookups/sqlite.h exim-4.71-dynlookup/src/lookups/sqlite.
 -extern uschar *sqlite_quote(uschar *, uschar *);
 -
 -/* End of lookups/sqlite.h */
-diff -uNr exim-4.71/src/lookups/testdb.c exim-4.71-dynlookup/src/lookups/testdb.c
---- exim-4.71/src/lookups/testdb.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/testdb.c	2009-12-24 19:54:54.000000000 +0000
+diff --git a/src/src/lookups/testdb.c b/src/src/lookups/testdb.c
+index ec23e13..03404d8 100644
+--- a/src/src/lookups/testdb.c
++++ b/src/src/lookups/testdb.c
 @@ -9,7 +9,6 @@
  
  #include "../exim.h"
@@ -2925,7 +3032,7 @@ diff -uNr exim-4.71/src/lookups/testdb.c exim-4.71-dynlookup/src/lookups/testdb.
  
  
  /* These are not real lookup functions; they are just a way of testing the
-@@ -23,7 +22,7 @@
+@@ -23,7 +22,7 @@ the find function. */
  
  /* See local README for interface description. */
  
@@ -2934,7 +3041,7 @@ diff -uNr exim-4.71/src/lookups/testdb.c exim-4.71-dynlookup/src/lookups/testdb.
  testdb_open(uschar *filename, uschar **errmsg)
  {
  filename = filename;   /* Keep picky compilers happy */
-@@ -39,7 +38,7 @@
+@@ -39,7 +38,7 @@ return (void *)(1);    /* Just return something non-null */
  
  /* See local README for interface description. */
  
@@ -2943,7 +3050,7 @@ diff -uNr exim-4.71/src/lookups/testdb.c exim-4.71-dynlookup/src/lookups/testdb.
  testdb_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -66,4 +65,22 @@
+@@ -66,4 +65,22 @@ if (Ustrcmp(query, "nocache") == 0) *do_cache = FALSE;
  return OK;
  }
  
@@ -2966,11 +3073,13 @@ diff -uNr exim-4.71/src/lookups/testdb.c exim-4.71-dynlookup/src/lookups/testdb.
 +lookup_module_info testdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
 +
  /* End of lookups/testdb.c */
-diff -uNr exim-4.71/src/lookups/testdb.h exim-4.71-dynlookup/src/lookups/testdb.h
---- exim-4.71/src/lookups/testdb.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/testdb.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/testdb.h b/src/src/lookups/testdb.h
+deleted file mode 100644
+index 0e9cdde..0000000
+--- a/src/src/lookups/testdb.h
++++ /dev/null
 @@ -1,16 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/testdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/testdb.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -2986,9 +3095,10 @@ diff -uNr exim-4.71/src/lookups/testdb.h exim-4.71-dynlookup/src/lookups/testdb.
 -               BOOL *);
 -
 -/* End of lookups/testdb.h */
-diff -uNr exim-4.71/src/lookups/whoson.c exim-4.71-dynlookup/src/lookups/whoson.c
---- exim-4.71/src/lookups/whoson.c	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/whoson.c	2009-12-24 19:54:54.000000000 +0000
+diff --git a/src/src/lookups/whoson.c b/src/src/lookups/whoson.c
+index 3b0960f..d197905 100644
+--- a/src/src/lookups/whoson.c
++++ b/src/src/lookups/whoson.c
 @@ -12,22 +12,7 @@
  #include "../exim.h"
  
@@ -3012,7 +3122,7 @@ diff -uNr exim-4.71/src/lookups/whoson.c exim-4.71-dynlookup/src/lookups/whoson.
  
  
  /*************************************************
-@@ -36,7 +21,7 @@
+@@ -36,7 +21,7 @@ static void dummy(int x) { dummy(x-1); }
  
  /* See local README for interface description. */
  
@@ -3021,7 +3131,7 @@ diff -uNr exim-4.71/src/lookups/whoson.c exim-4.71-dynlookup/src/lookups/whoson.
  whoson_open(uschar *filename, uschar **errmsg)
  {
  filename = filename;   /* Keep picky compilers happy */
-@@ -51,7 +36,7 @@
+@@ -51,7 +36,7 @@ return (void *)(1);    /* Just return something non-null */
  
  /* See local README for interface description. */
  
@@ -3030,7 +3140,7 @@ diff -uNr exim-4.71/src/lookups/whoson.c exim-4.71-dynlookup/src/lookups/whoson.
  whoson_find(void *handle, uschar *filename, uschar *query, int length,
    uschar **result, uschar **errmsg, BOOL *do_cache)
  {
-@@ -77,6 +62,22 @@
+@@ -77,6 +62,22 @@ switch (wso_query(query, CS buffer, sizeof(buffer)))
    }
  }
  
@@ -3054,11 +3164,13 @@ diff -uNr exim-4.71/src/lookups/whoson.c exim-4.71-dynlookup/src/lookups/whoson.
 +lookup_module_info whoson_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
  
  /* End of lookups/whoson.c */
-diff -uNr exim-4.71/src/lookups/whoson.h exim-4.71-dynlookup/src/lookups/whoson.h
---- exim-4.71/src/lookups/whoson.h	2009-11-16 19:50:38.000000000 +0000
-+++ exim-4.71-dynlookup/src/lookups/whoson.h	1970-01-01 01:00:00.000000000 +0100
+diff --git a/src/src/lookups/whoson.h b/src/src/lookups/whoson.h
+deleted file mode 100644
+index 2a3a5c0..0000000
+--- a/src/src/lookups/whoson.h
++++ /dev/null
 @@ -1,16 +0,0 @@
--/* $Cambridge: exim/exim-src/src/lookups/whoson.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
+-/* $Cambridge: exim/src/src/lookups/whoson.h,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
 -
 -/*************************************************
 -*     Exim - an Internet mail transport agent    *
@@ -3074,10 +3186,11 @@ diff -uNr exim-4.71/src/lookups/whoson.h exim-4.71-dynlookup/src/lookups/whoson.
 -               BOOL *);
 -
 -/* End of lookups/whoson.h */
-diff -uNr exim-4.71/src/macros.h exim-4.71-dynlookup/src/macros.h
---- exim-4.71/src/macros.h	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/macros.h	2009-12-24 19:54:55.000000000 +0000
-@@ -96,7 +96,7 @@
+diff --git a/src/src/macros.h b/src/src/macros.h
+index 09bc601..3f24025 100644
+--- a/src/src/macros.h
++++ b/src/src/macros.h
+@@ -96,7 +96,7 @@ don't make the file descriptors two-way. */
  
  /* A macro to simplify testing bits in lookup types */
  
@@ -3086,10 +3199,11 @@ diff -uNr exim-4.71/src/macros.h exim-4.71-dynlookup/src/macros.h
  
  /* Debugging control */
  
-diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
---- exim-4.71/src/search.c	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/search.c	2009-12-24 19:54:55.000000000 +0000
-@@ -71,7 +71,7 @@
+diff --git a/src/src/search.c b/src/src/search.c
+index 6e52cf2..528dc72 100644
+--- a/src/src/search.c
++++ b/src/src/search.c
+@@ -71,7 +71,7 @@ int top = lookup_list_count;
  while (top > bot)
    {
    int mid = (top + bot)/2;
@@ -3098,7 +3212,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
  
    /* If c == 0 we have matched the incoming name with the start of the search
    type name. However, some search types are substrings of others (e.g. nis and
-@@ -81,9 +81,9 @@
+@@ -81,9 +81,9 @@ while (top > bot)
    are testing. By leaving c == 0 when the lengths are different, and doing a
    > 0 test below, this all falls out correctly. */
  
@@ -3110,7 +3224,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
      search_error_message  = string_sprintf("lookup type \"%.*s\" is not "
        "available (not in the binary - check buildtime LOOKUP configuration)",
        len, name);
-@@ -237,8 +237,8 @@
+@@ -237,8 +237,8 @@ if (t->left != NULL) tidyup_subtree(t->left);
  if (t->right != NULL) tidyup_subtree(t->right);
  if (c != NULL &&
      c->handle != NULL &&
@@ -3121,7 +3235,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
  }
  
  
-@@ -270,7 +270,7 @@
+@@ -270,7 +270,7 @@ open_filecount = 0;
  /* Call the general tidyup entry for any drivers that have one. */
  
  for (i = 0; i < lookup_list_count; i++)
@@ -3130,7 +3244,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
  
  if (search_reset_point != NULL) store_reset(search_reset_point);
  search_reset_point = NULL;
-@@ -335,7 +335,7 @@
+@@ -335,7 +335,7 @@ search_open(uschar *filename, int search_type, int modemask, uid_t *owners,
  void *handle;
  tree_node *t;
  search_cache *c;
@@ -3139,7 +3253,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
  uschar keybuffer[256];
  int old_pool = store_pool;
  
-@@ -388,7 +388,7 @@
+@@ -388,7 +388,7 @@ if (lk->type == lookup_absfile && open_filecount >= lookup_open_max)
        ((search_cache *)(open_bot->data.ptr))->down = NULL;
      else
        open_top = NULL;
@@ -3148,7 +3262,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
      c->handle = NULL;
      open_filecount--;
      }
-@@ -480,7 +480,7 @@
+@@ -480,7 +480,7 @@ search_find_defer = FALSE;
  
  DEBUG(D_lookup) debug_printf("internal_search_find: file=\"%s\"\n  "
    "type=%s key=\"%s\"\n", filename,
@@ -3157,7 +3271,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
  
  /* Insurance. If the keystring is empty, just fail. */
  
-@@ -511,7 +511,7 @@
+@@ -511,7 +511,7 @@ if ((t = tree_search(c->item_cache, keystring)) == NULL)
    like FAIL, except that search_find_defer is set so the caller can
    distinguish if necessary. */
  
@@ -3166,7 +3280,7 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
        &data, &search_error_message, &do_cache) == DEFER)
      {
      search_find_defer = TRUE;
-@@ -622,7 +622,7 @@
+@@ -622,7 +622,7 @@ DEBUG(D_lookup)
  that opens real files. */
  
  if (open_top != (tree_node *)handle &&
@@ -3175,10 +3289,11 @@ diff -uNr exim-4.71/src/search.c exim-4.71-dynlookup/src/search.c
    {
    search_cache *c = (search_cache *)(t->data.ptr);
    tree_node *up = c->up;
-diff -uNr exim-4.71/src/structs.h exim-4.71-dynlookup/src/structs.h
---- exim-4.71/src/structs.h	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/structs.h	2009-12-24 19:54:55.000000000 +0000
-@@ -322,34 +322,7 @@
+diff --git a/src/src/structs.h b/src/src/structs.h
+index cf967a6..483539f 100644
+--- a/src/src/structs.h
++++ b/src/src/structs.h
+@@ -322,34 +322,7 @@ typedef struct router_info {
  
  /* Structure for holding information about a lookup type. */
  
@@ -3214,10 +3329,11 @@ diff -uNr exim-4.71/src/structs.h exim-4.71-dynlookup/src/structs.h
  
  
  /* Structure for holding information about the configured authentication
-diff -uNr exim-4.71/src/verify.c exim-4.71-dynlookup/src/verify.c
---- exim-4.71/src/verify.c	2009-11-16 19:50:37.000000000 +0000
-+++ exim-4.71-dynlookup/src/verify.c	2009-12-24 19:54:55.000000000 +0000
-@@ -2256,7 +2256,7 @@
+diff --git a/src/src/verify.c b/src/src/verify.c
+index 371883a..1ead302 100644
+--- a/src/src/verify.c
++++ b/src/src/verify.c
+@@ -2256,7 +2256,7 @@ if (iplookup)
      }
    else   /* Single-key style */
      {
diff --git a/exim.spec b/exim.spec
index 75d3385..8fa78d6 100644
--- a/exim.spec
+++ b/exim.spec
@@ -11,8 +11,8 @@
 
 Summary: The exim mail transfer agent
 Name: exim
-Version: 4.72
-Release: 2%{?dist}
+Version: 4.73
+Release: 1%{?dist}
 License: GPLv2+
 Url: http://www.exim.org/
 Group: System Environment/Daemons
@@ -36,9 +36,10 @@ Source13: http://marc.merlins.org/linux/exim/files/sa-exim-4.2.tar.gz
 Source20: exim-greylist.conf.inc
 Source21: mk-greylist-db.sql
 Source22: greylist-tidy.sh
+Source23: trusted-configs
 
 Patch4: exim-rhl.patch
-Patch6: exim-4.50-config.patch
+Patch6: exim-4.73-config.patch
 Patch8: exim-4.24-libdir.patch
 Patch12: exim-4.33-cyrus.patch
 Patch13: exim-4.43-pamconfig.patch
@@ -49,7 +50,7 @@ Patch20: exim-4.63-allow-filter.patch
 Patch21: exim-4.63-localhost-is-local.patch
 Patch22: exim-4.66-greylist-conf.patch
 Patch23: exim-4.67-smarthost-config.patch
-Patch24: exim-4.71-dynlookup.patch
+Patch24: exim-4.73-dynlookup.patch
 Patch25: exim-4.69-dynlookup-config.patch
 Patch26: exim-4.69-strictaliasing.patch
 
@@ -179,7 +180,7 @@ greylisting unconditional.
 %patch21 -p1 -b .localhost
 %patch22 -p1 -b .grey
 %patch23 -p1 -b .smarthost
-%patch24 -p1 -b .dynlookup
+%patch24 -p2 -b .dynlookup
 %patch25 -p1 -b .dynconfig
 %patch26 -p1 -b .strictaliasing
 
@@ -329,6 +330,7 @@ install -m644 %{SOURCE20} $RPM_BUILD_ROOT/%_sysconfdir/exim/exim-greylist.conf.i
 install -m644 %{SOURCE21} $RPM_BUILD_ROOT/%_sysconfdir/exim/mk-greylist-db.sql
 mkdir -p $RPM_BUILD_ROOT/%_sysconfdir/cron.daily
 install -m755 %{SOURCE22} $RPM_BUILD_ROOT/%_sysconfdir/cron.daily/greylist-tidy.sh
+install -m644 %{SOURCE23} $RPM_BUILD_ROOT/%_sysconfdir/exim/trusted-configs
 touch $RPM_BUILD_ROOT/%_var/spool/exim/db/greylist.db
 
 %clean
@@ -420,11 +422,10 @@ fi
 %dir %{_var}/spool/exim/msglog
 %dir %{_var}/log/exim
 
-%defattr(-,root,mail)
+%defattr(-,root,root)
 %dir %{_sysconfdir}/exim
 %config(noreplace) %{_sysconfdir}/exim/exim.conf
-
-%defattr(-,root,root)
+%config(noreplace) %{_sysconfdir}/exim/trusted-configs
 %config(noreplace) %{_sysconfdir}/sysconfig/exim
 %{_sysconfdir}/rc.d/init.d/exim
 %config(noreplace) %{_sysconfdir}/logrotate.d/exim
@@ -501,6 +502,9 @@ test "$1"  = 0 || %{_initrddir}/clamd.exim condrestart >/dev/null || :
 %{_sysconfdir}/cron.daily/greylist-tidy.sh
 
 %changelog
+* Wed Jan 05 2011 David Woodhouse <David.Woodhouse at intel.com> - 4.73-1
+- Update to 4.73
+
 * Sat Aug 07 2010 David Woodhouse <David.Woodhouse at intel.com> - 4.72-2
 - Fedora infrastructure ate my package; bump release and rebuild
 
diff --git a/sources b/sources
index f0b23ba..49c10e7 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-ad76f73c6b3d01caa88078e3e622745a  sa-exim-4.2.tar.gz
-ccc937b533568e5e8340f181a3b3d2ff  exim-4.72.tar.bz2
+b32fb85c5161ad2fabfe9ba860a1ad2c  exim-4.73.tar.bz2
diff --git a/trusted-configs b/trusted-configs
new file mode 100644
index 0000000..135206b
--- /dev/null
+++ b/trusted-configs
@@ -0,0 +1,6 @@
+# This file contains a list, one per line, of the files which are permitted
+# to be used as Exim configuration files with root privileges. If you want
+# to be able to run Exim with the -C option, and have it re-execute itself
+# for local delivery, then you'll need to add your configuration file here.
+/etc/exim/exim4.conf
+/etc/exim/exim.conf


More information about the scm-commits mailing list