diff options
author | Eray Aslan <eras@gentoo.org> | 2013-01-18 13:44:00 +0000 |
---|---|---|
committer | Eray Aslan <eras@gentoo.org> | 2013-01-18 13:44:00 +0000 |
commit | 35d3e5222561d9e54eda6147cf982883898685e3 (patch) | |
tree | b1dc501471b6e428088d110c5f2fd34c9cecf5c9 /mail-filter | |
parent | dev-python/mpmath: Bump to new python stuff and fix build for py3, #438584 (diff) | |
download | gentoo-2-35d3e5222561d9e54eda6147cf982883898685e3.tar.gz gentoo-2-35d3e5222561d9e54eda6147cf982883898685e3.tar.bz2 gentoo-2-35d3e5222561d9e54eda6147cf982883898685e3.zip |
Version bump - bug #452324. Start before mta - bug #451114. Use libbsd instead of internal library - bug #441790. Add option to disable crypto initialization thanks to Christian Rößner - bug #452470.
(Portage version: 2.2.0_alpha154/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/opendkim/ChangeLog | 14 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim-2.7.4-DisableCryptoInit.patch | 109 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim-2.7.4-bsd.patch | 558 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim.init.r3 | 56 | ||||
-rw-r--r-- | mail-filter/opendkim/opendkim-2.7.4.ebuild | 191 |
5 files changed, 926 insertions, 2 deletions
diff --git a/mail-filter/opendkim/ChangeLog b/mail-filter/opendkim/ChangeLog index 4cd832884178..65927dc086fa 100644 --- a/mail-filter/opendkim/ChangeLog +++ b/mail-filter/opendkim/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for mail-filter/opendkim -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/opendkim/ChangeLog,v 1.54 2012/11/27 20:17:19 eras Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/opendkim/ChangeLog,v 1.55 2013/01/18 13:44:00 eras Exp $ + +*opendkim-2.7.4 (18 Jan 2013) + + 18 Jan 2013; Eray Aslan <eras@gentoo.org> + +files/opendkim-2.7.4-DisableCryptoInit.patch, + +files/opendkim-2.7.4-bsd.patch, +files/opendkim.init.r3, + +opendkim-2.7.4.ebuild: + Version bump - bug #452324. Start before mta - bug #451114. Use libbsd instead + of internal library - bug #441790. Add option to disable crypto + initialization thanks to Christian Rößner - bug #452470. 27 Nov 2012; Eray Aslan <eras@gentoo.org> -files/opendkim-2.4.0-ipv6.patch, -opendkim-2.4.3.ebuild, -opendkim-2.5.2-r1.ebuild, -opendkim-2.6.3.ebuild, diff --git a/mail-filter/opendkim/files/opendkim-2.7.4-DisableCryptoInit.patch b/mail-filter/opendkim/files/opendkim-2.7.4-DisableCryptoInit.patch new file mode 100644 index 000000000000..deb9476af2eb --- /dev/null +++ b/mail-filter/opendkim/files/opendkim-2.7.4-DisableCryptoInit.patch @@ -0,0 +1,109 @@ +From 23548465adccd682ba9ecba58025f852d2353bad Mon Sep 17 00:00:00 2001 +From: Murray S. Kucherawy <msk@trusteddomain.org> +Date: Thu, 10 Jan 2013 00:49:11 -0800 +Subject: [PATCH] Fix bug #SF3531477: Add (hopefully temporary) configuration option + "DisableCryptoInit" so that opendkim's initialization of the crypto library + doesn't conflict with the same work done by other libraries. Reported by + Quanah Gibson-Mount. + +--- + opendkim/opendkim-config.h | 1 + + opendkim/opendkim-crypto.c | 7 +++++-- + opendkim/opendkim.c | 17 +++++++++++++---- + opendkim/opendkim.conf.5.in | 6 ++++++ + 5 files changed, 29 insertions(+), 6 deletions(-) + +diff --git a/opendkim/opendkim-config.h b/opendkim/opendkim-config.h +index dfc3606..0d40bb9 100644 +--- a/opendkim/opendkim-config.h ++++ b/opendkim/opendkim-config.h +@@ -56,6 +56,7 @@ struct configdef dkimf_config[] = + { "Diagnostics", CONFIG_TYPE_BOOLEAN, FALSE }, + { "DiagnosticDirectory", CONFIG_TYPE_STRING, FALSE }, + { "DisableADSP", CONFIG_TYPE_BOOLEAN, FALSE }, ++ { "DisableCryptoInit", CONFIG_TYPE_BOOLEAN, FALSE }, + #ifdef _FFR_DKIM_REPUTATION + { "DKIMReputationFail", CONFIG_TYPE_INTEGER, FALSE }, + { "DKIMReputationPass", CONFIG_TYPE_INTEGER, FALSE }, +diff --git a/opendkim/opendkim-crypto.c b/opendkim/opendkim-crypto.c +index 2ea9b44..fb42fd0 100644 +--- a/opendkim/opendkim-crypto.c ++++ b/opendkim/opendkim-crypto.c +@@ -121,9 +121,12 @@ dkimf_crypto_init(void) + void + dkimf_crypto_free(void) + { +- (void) gnutls_global_deinit(); ++ if (crypto_init_done) ++ { ++ (void) gnutls_global_deinit(); + +- (void) pthread_key_delete(logkey); ++ (void) pthread_key_delete(logkey); ++ } + + return; + } +diff --git a/opendkim/opendkim.c b/opendkim/opendkim.c +index 9863d30..3fa0a60 100644 +--- a/opendkim/opendkim.c ++++ b/opendkim/opendkim.c +@@ -209,6 +209,7 @@ struct lua_global + + struct dkimf_config + { ++ _Bool conf_disablecryptoinit; /* initialize SSL libs? */ + #ifdef USE_LDAP + _Bool conf_softstart; /* do LDAP soft starts */ + #endif /* USE_LDAP */ +@@ -6414,6 +6415,10 @@ dkimf_config_load(struct config *data, struct dkimf_config *conf, + &conf->conf_noadsp, + sizeof conf->conf_noadsp); + ++ (void) config_get(data, "DisableCryptoInit", ++ &conf->conf_disablecryptoinit, ++ sizeof conf->conf_disablecryptoinit); ++ + str = NULL; + (void) config_get(data, "ADSPAction", &str, sizeof str); + if (str != NULL) +@@ -17503,11 +17508,15 @@ main(int argc, char **argv) + } + + /* initialize libcrypto mutexes */ +- status = dkimf_crypto_init(); +- if (status != 0) ++ if (!curconf->conf_disablecryptoinit) + { +- fprintf(stderr, "%s: error initializing crypto library: %s\n", +- progname, strerror(status)); ++ status = dkimf_crypto_init(); ++ if (status != 0) ++ { ++ fprintf(stderr, ++ "%s: error initializing crypto library: %s\n", ++ progname, strerror(status)); ++ } + } + + if ((curconf->conf_mode & DKIMF_MODE_VERIFIER) != 0 && +diff --git a/opendkim/opendkim.conf.5.in b/opendkim/opendkim.conf.5.in +index a963e73..2c20549 100644 +--- a/opendkim/opendkim.conf.5.in ++++ b/opendkim/opendkim.conf.5.in +@@ -236,6 +236,12 @@ If set, suppresses Author Domain Signing Practices (ADSP) checks, which + require multiple additional DNS queries. + + .TP ++.I DisableCryptoInit (Boolean) ++If set, skips initialization of the SSL library initialization steps, which ++are normaly required in multi-threaded environments. This assumes some other ++library opendkim is using will do the required initialization and shutdown. ++ ++.TP + .I DKIMReputationFail (integer) + If the reputation returned by the DNS reputation service exceeds this + value then the result "x-dkim-rep" is set to "fail". +-- +1.7.4.1 + diff --git a/mail-filter/opendkim/files/opendkim-2.7.4-bsd.patch b/mail-filter/opendkim/files/opendkim-2.7.4-bsd.patch new file mode 100644 index 000000000000..594ef4bf4a17 --- /dev/null +++ b/mail-filter/opendkim/files/opendkim-2.7.4-bsd.patch @@ -0,0 +1,558 @@ +diff -Nru opendkim-2.7.4/configure.ac opendkim-2.7.4/configure.ac +--- opendkim-2.7.4/configure.ac 2013-01-18 06:47:47.000000000 +0000 ++++ opendkim-2.7.4/configure.ac 2013-01-18 06:47:47.000000000 +0000 +@@ -182,6 +182,9 @@ + + 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]) + ++bsdstrl_h_found="no" ++AC_CHECK_HEADERS([bsd/string.h], [bsdstrl_h_found="yes"]) ++ + strl_found="no" + libstrl_found="no" + strl_h_found="no" +@@ -218,11 +221,11 @@ + saved_LIBS="$LIBS" + LIBS="" + AC_SEARCH_LIBS([strlcat], +- [strl], ++ [bsd strl], + [libstrl_found="yes"], + [strl_found="no"]) + AC_SEARCH_LIBS([strlcpy], +- [strl], ++ [bsd strl], + [libstrl_found="yes"], + [strl_found="no"]) + STRL_LIBS="$LIBS" +@@ -236,13 +239,18 @@ + fi + # we need to include <strl.h> if: + # (a) strlcat and strlcpy weren't found, since we'll be rolling our own; OR +-# (b) an installed strl.h was found +-if test x"$strl_h_found" = x"yes" -o \( x"$strl_found" = x"no" -a x"$libstrl_found" = x"no" \) ++# (b) an installed strl.h was found and no installed bsd/string.h was found ++if test x"$strl_h_found" = x"yes" -o \( x"$strl_found" = x"no" -a x"$libstrl_found" = x"no" \) -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 + # + # Checks for structure members + # +diff -Nru opendkim-2.7.4/libopendkim/dkim-cache.c opendkim-2.7.4/libopendkim/dkim-cache.c +--- opendkim-2.7.4/libopendkim/dkim-cache.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim-cache.c 2013-01-18 06:47:47.000000000 +0000 +@@ -27,6 +27,11 @@ + #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> +diff -Nru opendkim-2.7.4/libopendkim/dkim-canon.c opendkim-2.7.4/libopendkim/dkim-canon.c +--- opendkim-2.7.4/libopendkim/dkim-canon.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim-canon.c 2013-01-18 06:47:47.000000000 +0000 +@@ -45,6 +45,11 @@ + #include "dkim-util.h" + #include "util.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> +diff -Nru opendkim-2.7.4/libopendkim/dkim-keys.c opendkim-2.7.4/libopendkim/dkim-keys.c +--- opendkim-2.7.4/libopendkim/dkim-keys.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim-keys.c 2013-01-18 06:47:47.000000000 +0000 +@@ -29,6 +29,11 @@ + #include "dkim-test.h" + #include "util.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> +diff -Nru opendkim-2.7.4/libopendkim/dkim-policy.c opendkim-2.7.4/libopendkim/dkim-policy.c +--- opendkim-2.7.4/libopendkim/dkim-policy.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim-policy.c 2013-01-18 06:47:47.000000000 +0000 +@@ -34,6 +34,11 @@ + #include "dkim-test.h" + #include "util.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> +diff -Nru opendkim-2.7.4/libopendkim/dkim-test.c opendkim-2.7.4/libopendkim/dkim-test.c +--- opendkim-2.7.4/libopendkim/dkim-test.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim-test.c 2013-01-18 06:47:47.000000000 +0000 +@@ -36,6 +36,11 @@ + #include "dkim-util.h" + #include "dkim-test.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> +diff -Nru opendkim-2.7.4/libopendkim/dkim.c opendkim-2.7.4/libopendkim/dkim.c +--- opendkim-2.7.4/libopendkim/dkim.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/dkim.c 2013-01-18 06:47:47.000000000 +0000 +@@ -92,6 +92,11 @@ + #include "util.h" + #include "base64.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test122.c opendkim-2.7.4/libopendkim/tests/t-test122.c +--- opendkim-2.7.4/libopendkim/tests/t-test122.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test122.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test123.c opendkim-2.7.4/libopendkim/tests/t-test123.c +--- opendkim-2.7.4/libopendkim/tests/t-test123.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test123.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test127.c opendkim-2.7.4/libopendkim/tests/t-test127.c +--- opendkim-2.7.4/libopendkim/tests/t-test127.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test127.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test131.c opendkim-2.7.4/libopendkim/tests/t-test131.c +--- opendkim-2.7.4/libopendkim/tests/t-test131.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test131.c 2013-01-18 06:47:47.000000000 +0000 +@@ -23,6 +23,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test136.c opendkim-2.7.4/libopendkim/tests/t-test136.c +--- opendkim-2.7.4/libopendkim/tests/t-test136.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test136.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test142.c opendkim-2.7.4/libopendkim/tests/t-test142.c +--- opendkim-2.7.4/libopendkim/tests/t-test142.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test142.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test42.c opendkim-2.7.4/libopendkim/tests/t-test42.c +--- opendkim-2.7.4/libopendkim/tests/t-test42.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test42.c 2013-01-18 06:47:47.000000000 +0000 +@@ -26,6 +26,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test55.c opendkim-2.7.4/libopendkim/tests/t-test55.c +--- opendkim-2.7.4/libopendkim/tests/t-test55.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test55.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test56.c opendkim-2.7.4/libopendkim/tests/t-test56.c +--- opendkim-2.7.4/libopendkim/tests/t-test56.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test56.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test57.c opendkim-2.7.4/libopendkim/tests/t-test57.c +--- opendkim-2.7.4/libopendkim/tests/t-test57.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test57.c 2013-01-18 06:47:47.000000000 +0000 +@@ -24,6 +24,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test73.c opendkim-2.7.4/libopendkim/tests/t-test73.c +--- opendkim-2.7.4/libopendkim/tests/t-test73.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test73.c 2013-01-18 06:47:47.000000000 +0000 +@@ -27,6 +27,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test84.c opendkim-2.7.4/libopendkim/tests/t-test84.c +--- opendkim-2.7.4/libopendkim/tests/t-test84.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test84.c 2013-01-18 06:47:47.000000000 +0000 +@@ -26,6 +26,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test86.c opendkim-2.7.4/libopendkim/tests/t-test86.c +--- opendkim-2.7.4/libopendkim/tests/t-test86.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test86.c 2013-01-18 06:47:47.000000000 +0000 +@@ -26,6 +26,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/tests/t-test88.c opendkim-2.7.4/libopendkim/tests/t-test88.c +--- opendkim-2.7.4/libopendkim/tests/t-test88.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/tests/t-test88.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "../dkim.h" + #include "t-testdata.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> +diff -Nru opendkim-2.7.4/libopendkim/util.c opendkim-2.7.4/libopendkim/util.c +--- opendkim-2.7.4/libopendkim/util.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/libopendkim/util.c 2013-01-18 06:47:47.000000000 +0000 +@@ -27,6 +27,11 @@ + #include "dkim-internal.h" + #include "util.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> +diff -Nru opendkim-2.7.4/miltertest/miltertest.c opendkim-2.7.4/miltertest/miltertest.c +--- opendkim-2.7.4/miltertest/miltertest.c 2013-01-18 06:47:47.000000000 +0000 ++++ opendkim-2.7.4/miltertest/miltertest.c 2013-01-18 06:47:47.000000000 +0000 +@@ -38,6 +38,11 @@ + /* libopendkim includes */ + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/config.c opendkim-2.7.4/opendkim/config.c +--- opendkim-2.7.4/opendkim/config.c 2013-01-07 01:07:30.000000000 +0000 ++++ opendkim-2.7.4/opendkim/config.c 2013-01-18 06:47:47.000000000 +0000 +@@ -23,6 +23,11 @@ + /* libopendkim includes */ + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/flowrate.c opendkim-2.7.4/opendkim/flowrate.c +--- opendkim-2.7.4/opendkim/flowrate.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/flowrate.c 2013-01-18 06:47:47.000000000 +0000 +@@ -16,6 +16,11 @@ + #include <string.h> + #include <stdlib.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> +diff -Nru opendkim-2.7.4/opendkim/opendkim-ar.c opendkim-2.7.4/opendkim/opendkim-ar.c +--- opendkim-2.7.4/opendkim/opendkim-ar.c 2013-01-07 01:07:30.000000000 +0000 ++++ opendkim-2.7.4/opendkim/opendkim-ar.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + # include <sysexits.h> + #endif /* ARTEST */ + ++/* 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> +diff -Nru opendkim-2.7.4/opendkim/opendkim-db.c opendkim-2.7.4/opendkim/opendkim-db.c +--- opendkim-2.7.4/opendkim/opendkim-db.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/opendkim-db.c 2013-01-18 06:47:47.000000000 +0000 +@@ -37,6 +37,11 @@ + /* libopendkim includes */ + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/opendkim-spam.c opendkim-2.7.4/opendkim/opendkim-spam.c +--- opendkim-2.7.4/opendkim/opendkim-spam.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/opendkim-spam.c 2013-01-18 06:47:47.000000000 +0000 +@@ -24,6 +24,11 @@ + # include <odbx.h> + #endif /* USE_ODBX */ + ++/* 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> +diff -Nru opendkim-2.7.4/opendkim/opendkim-testkey.c opendkim-2.7.4/opendkim/opendkim-testkey.c +--- opendkim-2.7.4/opendkim/opendkim-testkey.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/opendkim-testkey.c 2013-01-18 06:47:47.000000000 +0000 +@@ -39,6 +39,11 @@ + #include <dkim.h> + #include <dkim-test.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> +diff -Nru opendkim-2.7.4/opendkim/opendkim.c opendkim-2.7.4/opendkim/opendkim.c +--- opendkim-2.7.4/opendkim/opendkim.c 2013-01-07 01:07:30.000000000 +0000 ++++ opendkim-2.7.4/opendkim/opendkim.c 2013-01-18 06:47:47.000000000 +0000 +@@ -98,6 +98,11 @@ + # include "vbr.h" + #endif /* _FFR_VBR */ + ++/* 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> +diff -Nru opendkim-2.7.4/opendkim/reputation.c opendkim-2.7.4/opendkim/reputation.c +--- opendkim-2.7.4/opendkim/reputation.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/reputation.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + /* libopendkim includes */ + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/stats.c opendkim-2.7.4/opendkim/stats.c +--- opendkim-2.7.4/opendkim/stats.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/stats.c 2013-01-18 06:47:47.000000000 +0000 +@@ -41,6 +41,11 @@ + /* libopendkim includes */ + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/test.c opendkim-2.7.4/opendkim/test.c +--- opendkim-2.7.4/opendkim/test.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/test.c 2013-01-18 06:47:47.000000000 +0000 +@@ -22,6 +22,11 @@ + #include "build-config.h" + #include <dkim.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> +diff -Nru opendkim-2.7.4/opendkim/util.c opendkim-2.7.4/opendkim/util.c +--- opendkim-2.7.4/opendkim/util.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/opendkim/util.c 2013-01-18 06:47:47.000000000 +0000 +@@ -47,6 +47,11 @@ + # endif /* SOLARIS <= 20600 */ + #endif /* SOLARIS */ + ++/* 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> +diff -Nru opendkim-2.7.4/stats/opendkim-importstats.c opendkim-2.7.4/stats/opendkim-importstats.c +--- opendkim-2.7.4/stats/opendkim-importstats.c 2012-11-30 01:32:17.000000000 +0000 ++++ opendkim-2.7.4/stats/opendkim-importstats.c 2013-01-18 06:47:47.000000000 +0000 +@@ -23,6 +23,11 @@ + /* OpenDKIM includes */ + #include "stats.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> diff --git a/mail-filter/opendkim/files/opendkim.init.r3 b/mail-filter/opendkim/files/opendkim.init.r3 new file mode 100644 index 000000000000..cade3a41449e --- /dev/null +++ b/mail-filter/opendkim/files/opendkim.init.r3 @@ -0,0 +1,56 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/opendkim/files/opendkim.init.r3,v 1.1 2013/01/18 13:44:00 eras Exp $ + +CONFFILE=/etc/opendkim/${SVCNAME}.conf + +depend() { + use dns logger net + before mta +} + +check_cfg() { + + PIDFILE=$(sed -ne 's/^[[:space:]]*PidFile[[:space:]]\+//p' "${CONFFILE}") + local PIDDIR="${PIDFILE%/*}" + if [ ! -d "${PIDDIR}" ] ; then + checkpath -q -d -o milter:milter -m 0755 "${PIDDIR}" || return 1 + fi + if [ ! -f "${CONFFILE}" ] ; then + eerror "Configuration file ${CONFFILE} is missing" + return 1 + fi + if [ -z "${PIDFILE}" ] ; then + eerror "Configuration file needs PidFile setting - recommend adding 'PidFile /var/run/opendkim/${SVCNAME}.pid' to ${CONFFILE}" + return 1 + fi + + if egrep -q '^[[:space:]]*Background[[:space:]]+no' "${CONFFILE}" ; then + eerror "${SVCNAME} service cannot run with Background key set to yes!" + return 1 + fi +} + +start() { + check_cfg || return 1 + + # Remove stalled Unix socket if no other process is using it + local UNIX_SOCKET=$(sed -ne 's/^[[:space:]]*Socket[[:space:]]\+\(unix\|local\)://p' "${CONFFILE}") + + if [ -S "${UNIX_SOCKET}" ] && ! fuser -s "${UNIX_SOCKET}"; then + rm "${UNIX_SOCKET}" + fi + + ebegin "Starting OpenDKIM" + start-stop-daemon --start --pidfile "${PIDFILE}" \ + --exec /usr/sbin/opendkim -- -x "${CONFFILE}" + eend $? +} + +stop() { + check_cfg || return 1 + ebegin "Stopping OpenDKIM" + start-stop-daemon --stop --pidfile "${PIDFILE}" + eend $? +} diff --git a/mail-filter/opendkim/opendkim-2.7.4.ebuild b/mail-filter/opendkim/opendkim-2.7.4.ebuild new file mode 100644 index 000000000000..929affd5fa80 --- /dev/null +++ b/mail-filter/opendkim/opendkim-2.7.4.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/opendkim/opendkim-2.7.4.ebuild,v 1.1 2013/01/18 13:44:00 eras Exp $ + +EAPI=4 +inherit eutils db-use autotools user + +# for betas +#MY_P=${P/_b/.B} +#S=${WORKDIR}/${PN}-2.0.0 +#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz" + +DESCRIPTION="A milter-based application to provide DKIM signing and verification" +HOMEPAGE="http://opendkim.org" +SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz" + +LICENSE="Sendmail-Open-Source BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+berkdb gnutls ldap lua opendbx poll sasl +ssl static-libs unbound" + +DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) + dev-libs/libbsd + ssl? ( >=dev-libs/openssl-0.9.8 ) + berkdb? ( >=sys-libs/db-3.2 ) + opendbx? ( >=dev-db/opendbx-1.4.0 ) + lua? ( dev-lang/lua ) + ldap? ( net-nds/openldap ) + sasl? ( dev-libs/cyrus-sasl ) + unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root ) + !unbound? ( net-libs/ldns ) + gnutls? ( >=net-libs/gnutls-2.11.7 )" + +RDEPEND="${DEPEND} + sys-process/psmisc" + +REQUIRED_USE="sasl? ( ldap )" + +pkg_setup() { + enewgroup milter + # mail-milter/spamass-milter creates milter user with this home directory + # For consistency reasons, milter user must be created here with this home directory + # even though this package doesn't need a home directory for this user (#280571) + enewuser milter -1 -1 /var/lib/milter milter +} + +src_prepare() { + sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \ + -e 's:/var/db/opendkim:/var/lib/opendkim:g' \ + -e 's:/etc/mail:/etc/opendkim:g' \ + -e 's:mailnull:milter:g' \ + -e 's:^#[[:space:]]*PidFile.*:PidFile /var/run/opendkim/opendkim.pid:' \ + opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \ + stats/opendkim-reportstats || die + + sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \ + || die + + # don't go over the sock length and fail + sed -i -e '/^sock/s/t-sign-ss-macro-value-file.sock/t-s-s-m-v-f.sock/' \ + opendkim/tests/t-sign-ss-macro-value-file.lua || die + + epatch "${FILESDIR}/${P}-bsd.patch" + epatch "${FILESDIR}/${P}-DisableCryptoInit.patch" + eautoreconf +} + +src_configure() { + local myconf + if use berkdb ; then + myconf=$(db_includedir) + myconf="--with-db-incdir=${myconf#-I}" + myconf+=" --enable-popauth" + myconf+=" --enable-query_cache" + myconf+=" --enable-stats" + fi + if use unbound; then + myconf+=" --with-unbound" + else + myconf+=" --with-ldns" + fi + if use ldap; then + myconf+=" $(use_with sasl)" + fi + econf \ + $(use_with berkdb db) \ + $(use_with opendbx odbx) \ + $(use_with lua) \ + $(use_enable lua rbl) \ + $(use_with ldap openldap) \ + $(use_enable poll) \ + $(use_enable static-libs static) \ + $(use_with gnutls) \ + ${myconf} \ + --docdir=/usr/share/doc/${PF} \ + --htmldir=/usr/share/doc/${PF}/html \ + --enable-filter \ + --enable-adsp_lists \ + --enable-dkim_reputation \ + --enable-identity_header \ + --enable-rate_limit \ + --enable-redirect \ + --enable-resign \ + --enable-replace_rules \ + --enable-default_sender \ + --enable-sender_macro \ + --enable-vbr \ + --disable-rpath \ + --disable-live-testing +} + +src_install() { + emake DESTDIR="${D}" install + + dosbin stats/opendkim-reportstats + newinitd "${FILESDIR}/opendkim.init.r3" opendkim + dodir /etc/opendkim /var/lib/opendkim + fowners milter:milter /var/lib/opendkim + + # default configuration + if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then + grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \ + > "${D}"/etc/opendkim/opendkim.conf + if use unbound; then + echo TrustedAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf + fi + echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf + if use berkdb; then + echo Statistics /var/lib/opendkim/stats.dat >> \ + "${D}"/etc/opendkim/opendkim.conf + fi + fi + + use static-libs || find "${D}" -name "*.la" -delete +} + +pkg_postinst() { + elog "If you want to sign your mail messages and need some help" + elog "please run:" + elog " emerge --config ${CATEGORY}/${PN}" + elog "It will help you create your key and give you hints on how" + elog "to configure your DNS and MTA." + + ewarn "Make sure your MTA has r/w access to the socket file." + ewarn "This can be done either by setting UMask to 002 and adding MTA's user" + ewarn "to milter group or you can simply set UMask to 000." +} + +pkg_config() { + local selector keysize pubkey + + read -p "Enter the selector name (default ${HOSTNAME}): " selector + [[ -n "${selector}" ]] || selector=${HOSTNAME} + if [[ -z "${selector}" ]]; then + eerror "Oddly enough, you don't have a HOSTNAME." + return 1 + fi + if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then + ewarn "The private key for this selector already exists." + else + keysize=1024 + # generate the private and public keys + opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \ + -s ${selector} -d '(your domain)' && \ + chown milter:milter \ + "${ROOT}"etc/opendkim/"${selector}".private || \ + { eerror "Failed to create private and public keys." ; return 1; } + chmod go-r "${ROOT}"etc/opendkim/"${selector}".private + fi + + # opendkim selector configuration + echo + einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:" + einfo " Keyfile /etc/opendkim/${selector}.private" + einfo " Selector ${selector}" + + # MTA configuration + echo + einfo "If you are using Postfix, add following lines to your main.cf:" + einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock" + einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock" + einfo " and read http://www.postfix.org/MILTER_README.html" + + # DNS configuration + einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:" + cat "${ROOT}"etc/opendkim/${selector}.txt + einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:" + einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text" + einfo + einfo "Also look at the ADSP http://tools.ietf.org/html/rfc5617" +} |