Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ doesn't find it, you will need to specify the location with
--with-db-libdir
--with-db-lib
These provide a finer control over the location of BerkeleyDB
include, library path and libary name where the default
include, library path and libary name where the default
locations of --with-db are not enough.

--with-domain Specifies the local domain name in use. Used only for
Expand Down Expand Up @@ -129,9 +129,9 @@ doesn't find it, you will need to specify the location with
/usr directories will be searched for the required includes
and libraries.

--with-unbound Location of the Unbound DNSSEC capable asynchronous resolver
--with-unbound Location of the Unbound DNSSEC capable asynchronous resolver
library and include file.



FEATURES
Expand Down Expand Up @@ -210,6 +210,10 @@ Steps to compiling the library and the milter:
system.
./configure

Note: When creating a package, pass `--without-libbsd` to the configure
script. If it fails, the program depends on either of libbsd or libobsd
in your system.

(5) Compile the package.
make

Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ o sendmail v8.13.0 (or later), or Postfix 2.3, (or later) and libmilter.

o Access to a working nameserver (required only for signature verification).

o On Linux systems, either libbsd (BSD compatibility library) or some other
library that provides strlcat() and strlcpy().
o If `./configure --without-libbsd` fails, either of libbsd or libobsd are
required. This happens on glibc, for instance.

o If you wish to interface the filter with SQL databases, or store statistical
information in a database, OpenDBX v1.3.7 or later is required.
Expand Down Expand Up @@ -229,7 +229,7 @@ Other OpenDKIM issues:

Report any bugs to the email address opendkim-users@lists.opendkim.org or to
the sourceforge issue trackers accessible at:

https://sourceforge.net/p/opendkim/_list/tickets


Expand Down
127 changes: 33 additions & 94 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
#
# Copyright (c) 2009-2015, The Trusted Domain Project. All rights reserved.
#
#

#
# Setup
Expand Down Expand Up @@ -47,13 +47,13 @@ AC_CONFIG_MACRO_DIR([m4])

#
# Hexadecimal version, for use in generating dkim.h
#
#
HEX_VERSION=$(printf %08x $(( ((VERSION_RELEASE << 8 | VERSION_MAJOR_REV) << 8 | VERSION_MINOR_REV) << 8| VERSION_PATCH )))
AC_SUBST([HEX_VERSION])

#
# library version, passed to libtool
#
#
LIBOPENDKIM_VERSION_INFO=$(printf %d:%d:%d LIBVERSION_CURRENT LIBVERSION_REVISION LIBVERSION_AGE)
AC_SUBST([LIBOPENDKIM_VERSION_INFO])

Expand Down Expand Up @@ -130,11 +130,11 @@ AC_CHECK_TYPES([useconds_t])
# See if libopendkim will need -lresolv
#
dnscheck='
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <resolv.h>
int main() {
res_mkquery (0, 0, 0, 0, 0, 0, 0, 0, 0);
dn_expand (0, 0, 0, 0, 0);
Expand Down Expand Up @@ -165,7 +165,7 @@ $dnscheck
LIBS="$saved_LIBS"
])
AC_SUBST([LIBRESOLV])

#
# Checks for header files
#
Expand Down Expand Up @@ -196,78 +196,17 @@ AC_FUNC_REALLOC

AC_CHECK_FUNCS([dup2 endpwent getcwd gethostname gethostbyname getaddrinfo gethostbyname2 gettimeofday isascii memchr memmove memset regcomp select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol strtoul strtoull realpath strsep])

bsdstrl_h_found="no"
strl_found="no"
libstrl_found="no"
strl_h_found="no"

AC_CHECK_HEADERS([bsd/string.h], [bsdstrl_h_found="yes"])

AC_CHECK_FUNCS([strlcat strlcpy], [strl_found="yes"],
[
saved_LIBS="$LIBS"
LIBS="$outer_LIBS"
AC_SEARCH_LIBS([strlcat],
[bsd strl],
[libstrl_found="yes"],
[strl_found="no"])
AC_SEARCH_LIBS([strlcpy],
[bsd strl],
[libstrl_found="yes"],
[strl_found="no"])
STRL_LIBS="$LIBS"
LIBS="$saved_LIBS"
])

if test x"$libstrl_found" = x"yes"
then
LIBS="$LIBS $STRL_LIBS"
fi

# we need something above to have worked
if test x"$strl_found" != x"yes" -a x"$libstrl_found" != x"yes"
then
AC_MSG_ERROR(no strlcpy/strlcat found)
fi

AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
if test x"$strl_h_found" != x"yes"
then
strldirs="/usr/local/include /usr/include"

for d in $strldirs
do
AC_MSG_CHECKING([for strl.h in $d/strl])
if test -f $d/strl/strl.h
then
unset ac_cv_header_strl_h
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$d/strl"
AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
CPPFLAGS="$saved_CPPFLAGS"
fi

if test x"$strl_h_found" = x"yes"
then
CPPFLAGS="$CPPFLAGS -I$d/strl"
break
fi
done
fi

# we need to include <strl.h> if an installed strl.h was found and no
# bsd/string.h was found
if test x"$strl_h_found" = x"yes" -a x"$bsdstrl_h_found" = x"no"
then
AC_DEFINE([USE_STRL_H], 1,
[Define to 1 if you need to include <strl.h> to get the `strlcat()' and `strlcpy()' functions.])
fi

if test x"$bsdstrl_h_found" = x"yes"
then
AC_DEFINE([USE_BSD_H], 1,
[Define to 1 if you need to include <bsd/string.h> to get the `strlcat()' and `strlcpy()' functions.])
fi
AC_ARG_WITH([libbsd], AS_HELP_STRING([--without-libbsd],
[Error when BSD functions are not found]))
AC_CHECK_FUNCS([strlcpy strlcat],, [LIBBSD_NEEDED=yes])
AS_IF([test "x$LIBBSD_NEEDED" = "xyes"], [
AS_IF([test "x$with_libbsd" = "xno"], [
AC_MSG_ERROR([BSD functions not found and --without-libbsd was used])
])
PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay],,
[AC_MSG_ERROR([BSD functions not found,
libbsd is required])])
])

#
# Checks for structure members
Expand Down Expand Up @@ -446,7 +385,7 @@ fi

#
# test coverage/profiling stuff
#
#
AC_ARG_ENABLE([codecoverage],
AS_HELP_STRING([--enable-codecoverage],
[include code coverage/profiling code]))
Expand Down Expand Up @@ -574,7 +513,7 @@ AM_CONDITIONAL(GPROF_FILENAMES, test x"$gprof_gmon_out" = x"no")

#
# opendkim
#
#
AC_ARG_ENABLE([filter],
AS_HELP_STRING([--disable-filter],
[do not compile the opendkim filter]),
Expand Down Expand Up @@ -732,7 +671,7 @@ then

#if GNUTLS_VERSION_NUMBER < 0x020b07
# error GnuTLS 2.11.7 or later required
#endif
#endif
int main()
{
return 0;
Expand Down Expand Up @@ -1025,7 +964,7 @@ AC_SUBST(LIBMILTER_LIBS)

#
# librrd
#
#
AC_ARG_WITH([librrd],
AS_HELP_STRING([--with-librrd],
[location of librrd includes and library]),
Expand All @@ -1039,7 +978,7 @@ fi

if test \( x"$librrdpath" = x"auto" -o x"$librrdpath" = x"yes" \) -a x"$PKG_CONFIG" != x""
then
PKG_CHECK_MODULES([RRDTOOL], [librrd],
PKG_CHECK_MODULES([RRDTOOL], [librrd],
[
librrd_found="yes"
],
Expand Down Expand Up @@ -1101,7 +1040,7 @@ AC_SUBST(RRDTOOL_LIBS)

#
# libmemcached
#
#
AC_ARG_WITH([libmemcached],
AS_HELP_STRING([--with-libmemcached],
[location of libmemcached includes and library]),
Expand All @@ -1111,7 +1050,7 @@ libmemcache_found="no"

if test \( x"$libmcdpath" = x"auto" -o x"$libmcdpath" = x"yes" \) -a x"$PKG_CONFIG" != x""
then
PKG_CHECK_MODULES([LIBMEMCACHED], [libmemcached >= 0.36],
PKG_CHECK_MODULES([LIBMEMCACHED], [libmemcached >= 0.36],
[
libmemcache_found="yes"
LIBMEMCACHED_INCDIRS="$LIBMEMCACHED_CFLAGS"
Expand Down Expand Up @@ -1175,7 +1114,7 @@ main()
return 0;
}
])],
AC_MSG_RESULT([ok]),
AC_MSG_RESULT([ok]),
AC_MSG_ERROR([libmemcached version 0.36 or later required]))
fi

Expand Down Expand Up @@ -1399,7 +1338,7 @@ if test \( x"$trepath" = x"auto" -o x"$trepath" = x"yes" \) -a x"$PKG_CONFIG" !
then
PKG_CHECK_MODULES([LIBTRE], [tre >= 0.8.0], [tre_found="yes"],
[
PKG_CHECK_MODULES([LIBTRE], [tre >= 0.7.5],
PKG_CHECK_MODULES([LIBTRE], [tre >= 0.7.5],
[
tre_found="yes"
AC_DEFINE([TRE_PRE_080], 1,
Expand Down Expand Up @@ -1642,7 +1581,7 @@ main()
return 0;
}
])],
AC_MSG_RESULT([ok]),
AC_MSG_RESULT([ok]),
AC_MSG_ERROR([Lua version 5.1 or later required]))
CPPFLAGS="$saved_CPPFLAGS"
AC_DEFINE([USE_LUA], 1, [support for Lua scripting])
Expand Down Expand Up @@ -1852,7 +1791,7 @@ main()
return 0;
}
])],
AC_MSG_RESULT([ok]),
AC_MSG_RESULT([ok]),
AC_MSG_ERROR([OpenLDAP version 2.1.3 or later required]))
CPPFLAGS="$saved_CPPFLAGS"
AC_DEFINE([USE_LDAP], 1, [OpenLDAP support for datasets enabled])
Expand Down Expand Up @@ -2102,7 +2041,7 @@ fi

#
# reputation requires libjansson
#
#

AC_ARG_WITH([libjansson],
AS_HELP_STRING([--with-libjansson],
Expand Down Expand Up @@ -2434,7 +2373,7 @@ AC_DEFINE_UNQUOTED([LIBOPENDKIM_FEATURE_STRING], "$LIBOPENDKIM_FEATURE_STRING",

#
# setup for testing
#
#

AC_ARG_ENABLE([live-testing],
AS_HELP_STRING([--disable-live-testing],
Expand All @@ -2444,7 +2383,7 @@ AM_CONDITIONAL(LIVE_TESTS, test x"$live_tests" = x"yes")

#
# specify test socket
#
#

AC_ARG_WITH([test-socket],
AS_HELP_STRING([--with-test-socket],
Expand Down Expand Up @@ -2551,7 +2490,7 @@ AC_SUBST(LIBERL_LIBS)

CPPFLAGS="$CPPFLAGS -DCONFIG_BASE=\\\"$sysconfdir\\\""

test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$prefix" = xNONE && prefix=$ac_default_prefix
SYSCONFDIR=`eval echo "$sysconfdir"`
AC_SUBST([SYSCONFDIR])

Expand Down Expand Up @@ -2661,7 +2600,7 @@ AC_OUTPUT([ Makefile
miltertest/Makefile
opendkim/Makefile opendkim/opendkim.8 opendkim/opendkim-genkey
opendkim/opendkim-genkey.8 opendkim/opendkim-genzone.8
opendkim/opendkim-lua.3
opendkim/opendkim-lua.3
opendkim/opendkim-testkey.8 opendkim/opendkim-stats.8
opendkim/opendkim-testmsg.8 opendkim/opendkim.conf.5
opendkim/opendkim.conf.simple
Expand Down
4 changes: 2 additions & 2 deletions libopendkim/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ LDADD = ./libopendkim.la

lib_LTLIBRARIES = libopendkim.la
libopendkim_la_SOURCES = base32.c base64.c dkim-atps.c dkim-cache.c dkim-canon.c dkim-dns.c dkim-keys.c dkim-mailparse.c dkim-report.c dkim-tables.c dkim-test.c dkim-util.c dkim.c util.c base64.h dkim-cache.h dkim-canon.h dkim-dns.h dkim-internal.h dkim-keys.h dkim-mailparse.h dkim-report.h dkim-tables.h dkim-test.h dkim-types.h dkim-util.h dkim.h util.h
libopendkim_la_CPPFLAGS = $(LIBCRYPTO_CPPFLAGS)
libopendkim_la_CPPFLAGS = $(LIBCRYPTO_CPPFLAGS) $(LIBBSD_CFLAGS)
libopendkim_la_CFLAGS = $(LIBCRYPTO_INCDIRS) $(LIBOPENDKIM_INC) $(COV_CFLAGS)
libopendkim_la_LDFLAGS = -no-undefined $(LIBCRYPTO_LIBDIRS) $(COV_LDFLAGS) -version-info $(LIBOPENDKIM_VERSION_INFO)
libopendkim_la_LDFLAGS = -no-undefined $(LIBCRYPTO_LIBDIRS) $(COV_LDFLAGS) -version-info $(LIBOPENDKIM_VERSION_INFO) $(LIBBSD_LIBS)
libopendkim_la_LIBADD = $(LIBOPENDKIM_LIBS) $(LIBCRYPTO_LDADD) $(COV_LIBADD)
if !ALL_SYMBOLS
libopendkim_la_DEPENDENCIES = symbols.map
Expand Down
10 changes: 0 additions & 10 deletions libopendkim/dkim-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@
#include "dkim-internal.h"
#include "dkim-cache.h"

/* libbsd if found */
#ifdef USE_BSD_H
# include <bsd/string.h>
#endif /* USE_BSD_H */

/* libstrl if needed */
#ifdef USE_STRL_H
# include <strl.h>
#endif /* USE_STRL_H */

/* limits, macros, etc. */
#define BUFRSZ 1024
#define DB_MODE (S_IRUSR|S_IWUSR)
Expand Down
Loading