summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2013-01-18 13:44:10 +0000
committerEray Aslan <eras@gentoo.org>2013-01-18 13:44:10 +0000
commit92b0f434f18e3b617b107dbc5e1ea71bea930950 (patch)
tree6956d997533c4fff077fd0162cfe290296a4a980 /mail-filter
parentdev-python/mpmath: Bump to new python stuff and fix build for py3, #438584 (diff)
downloadhistorical-92b0f434f18e3b617b107dbc5e1ea71bea930950.tar.gz
historical-92b0f434f18e3b617b107dbc5e1ea71bea930950.tar.bz2
historical-92b0f434f18e3b617b107dbc5e1ea71bea930950.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.
Package-Manager: portage-2.2.0_alpha154/cvs/Linux x86_64 Manifest-Sign-Key: 0x77F1F175586A3B1F
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/opendkim/ChangeLog14
-rw-r--r--mail-filter/opendkim/Manifest33
-rw-r--r--mail-filter/opendkim/files/opendkim-2.7.4-DisableCryptoInit.patch109
-rw-r--r--mail-filter/opendkim/files/opendkim-2.7.4-bsd.patch558
-rw-r--r--mail-filter/opendkim/files/opendkim.init.r356
-rw-r--r--mail-filter/opendkim/opendkim-2.7.4.ebuild191
6 files changed, 945 insertions, 16 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/Manifest b/mail-filter/opendkim/Manifest
index 933241330f06..c5fd01691063 100644
--- a/mail-filter/opendkim/Manifest
+++ b/mail-filter/opendkim/Manifest
@@ -2,33 +2,38 @@
Hash: SHA256
AUX opendkim-2.7.2-strl.patch 1158 SHA256 23d06779d843aecd8a8540d40effa90f7d3fa854eccbee22672731438be7c88f SHA512 57dae887354a164d6146c55d258b8b41cdfbf9df887d228ab6ae9f2868b2096b44d738897880e1ad39c2d1d2ccade655cdb2658a171499cb470e6aafc0ca72bc WHIRLPOOL 760706018224941090b82b65b613bb90f51c6cfdba4f87bd640e6f301719c137592fd54f0bc383e0fa384f4f8e4ecd3699906ad70b86ffdf85f5fb9c12842ae0
+AUX opendkim-2.7.4-DisableCryptoInit.patch 3747 SHA256 83c0fac5ed1393cdfda695637f337a2a43bcd45476f11ed7db1bc422a080f421 SHA512 c8c352a56150cf0e8a2ce4b0020c03d60da1e8c184e830b325348e1e9272df8634e014a4ae6b62d4c8c596d855ecdf163eb4c09104e31084d1643364bcf093f8 WHIRLPOOL d6ad3a4ea0c2ba7b41d06750beb3fb19dd26f29f44f1ffc6855e93f8a5e8af631c35c9b782d32a7fcb83361e881ea6dffb22d59035d9b3148cf39b37ee62f1db
+AUX opendkim-2.7.4-bsd.patch 18006 SHA256 a4cfb4d26dc7d27134f66f7b1e78b40f6c0c77f3986af787001c094c4734f95f SHA512 9ee24d02d2662b2898dd073b7ec882889fe9568d2afca8751c6ad6c68af60523d77ca79557f540607a68cb159bf0df7266122ed8fe3a3b67ca4e578b325b4892 WHIRLPOOL 8408536bd7fd080eedc99b3b133562d5049a63a61420b5a38759237dce09af8ab257f524152ca870de18c13113b6370bc5c0f8fe06fc43d89101ecbcfbb157e9
AUX opendkim.init.r2 1533 SHA256 0e8fab90020c109f602d8367a6501bfb3b397a50f020b6fade5024e2facf593c SHA512 8c7aef32c67e1ec4bf3afb0df48d861b6f1399c8a825161d00ca1400d87b084ad16de68401f9cece4cc9c07b06377641cc664d7e79750a0fc106f1088fb2dff7 WHIRLPOOL 00783d779d904118eb172f859c289d8b2b1832f1de1f17ab30a5a9f0af6ffa324395f2777b82fbde2e46d26f064d4ffec368b6734ce9cfe09173f24a7053de50
+AUX opendkim.init.r3 1545 SHA256 63f316ef776ad1a9fe87cff7748fac4574c2355b6205e3ef21285ddb84c8cb33 SHA512 c28b93f230b65ba483302dbb0f6cba0d8b2cf29cce0309521e67f6aa0e4c041b0dd69eaca8152d6b0b1b02dbe1ff9634fef0840856c8e192f17a1c24ffac7166 WHIRLPOOL f42cb79de47d2fdac26ef4a45132e996640da824aadaf0c3e66182160e941322ff78a37c18a32ca50efb0bb4fbf11b622a1ce5931146c47a06156c256d568b81
DIST opendkim-2.6.7.tar.gz 1129124 SHA256 45da209ccddfb6f6888ac2366b6e38a6460b36ff0da527aed910217cead6fc84 SHA512 f47f4c4805b96a2c57774dd69a7770751649397866b29392aa756c4b143579d93951166c817342fde12b8994251a8b44d2de61e6059fd04686e04aa6e668cdd3 WHIRLPOOL df662ca97ac937720038b16fb8b5e8f3f1d6a9d5b73102082a889abddaa003ca8ddf8fcba670fb16f7d00e4fd8b07fc0ddaff97f070e795822350751b0cb0608
DIST opendkim-2.6.8.tar.gz 1141247 SHA256 1b2e9033842634a1dc891afa10a94ba58c0e7663670e2faf117b27bead541edc SHA512 0f1a48741194d9d47b9e301bb1d1a32f0396f12ed93eeafcaea74783e5ca9fb1f0a7cc6bb384df687d30026105e65c33c6b9cee86aa836906d959b4d2315946e WHIRLPOOL 00c841fc5d73ab7b0fe26a4612e8a319087a8a15a3a7fb5bcd61ad98cb9b5cf860fb54c98077ad99792d1e5c626bd2ce69eabb1da560f45725d23170e9100293
DIST opendkim-2.7.0.tar.gz 1143836 SHA256 f5c2319ec23fa20a6bd4bb1b4abc005f6a7dbb77852c13091a3f2a042f82fee2 SHA512 17c53cfb7198162446c5db72d6bb234d41fcb6f167e12ee04609e36fd78916a2133f9f401800dd24e29ed811e4e123090296f24611b5fef6525711377642e320 WHIRLPOOL 52c8a0e20e2e2e3ba6364b0e14bd6122fcf3566c59029464fa5d9a1d5cf697dd89a1ce99b970987bf62c83768a64fe0be1caf02941f6153538368fd2428a9fd1
DIST opendkim-2.7.1.tar.gz 1153665 SHA256 782c030ce3b09d9ef536d2b98910d5a9289ba2128e8392e6ff568b2ade0282ed SHA512 76074ba23f4a4e142f6c41cc2474ac8e4281a770695a615b51ddcb0cb1b195ac295ce2be3f433e2213fc2c7b3355fa470e19d6a3421d4f0af4acb065eb498dd0 WHIRLPOOL 69a61297d1d79c2a296b99453f5b24c4c9b109b8fab9d114d627c788e1ea2b5e836b99d7c11312214794157f3a48dd8ea6cb79d8bdbc6156c3e019743df57e37
DIST opendkim-2.7.2.tar.gz 1156510 SHA256 cf72a26506ef48a2c6b231947226ab460cdb6e05b18176ee42a94b3b6d521b42 SHA512 be1cf2329f9a871df560bcdb60f9f2277ac5220ed9f94c112410994b1dc1f1ee7274bea76b8ce7c118695f73831fb3459007b728a151ece966a1021d6774e425 WHIRLPOOL 2e07e87bf274a3644bec6c42ccc7ca0575206fa67eba8009f52f24213a74c4985b2e78eb9e6b4b0938cb513c186b0c858f2d80330019a20eee18188d39f68677
+DIST opendkim-2.7.4.tar.gz 1158496 SHA256 fa66f7ca52dd3fa94cd869e8fe9e8f849ab83d6a32a8d4ed3cf18b06b4584e76 SHA512 f897cea21832355cac5421a96a906f67aaff1bcc0ceb5e027c73845d7c0cd27ec12862a826534b01339571533cba061b86e1a1bad91c405488bada729e2846cb WHIRLPOOL afe329829211cedacc7d27b5a4d03469e1fe8935cabc0b51158a69862ef993d6438499a206628dafc31c7904b9b95d1eeb31edf6583249cf54396793af68bdbc
EBUILD opendkim-2.6.7-r1.ebuild 6380 SHA256 1fdfd5a87069115fea59cd641a554561b89666eb05283355c19429e36ef42fdb SHA512 3923604c1fa2f53ded36ee08fca144b9683f322b5f40342a46dd25085a8af18856c7b9238020f22f4f054a31d79d22d6bec85627e0aa616956b26b1821762d05 WHIRLPOOL e07276482ec7107e5b7af5bc57581bf6e04761ae9801ceb4f649b43a30467ed6d5be22fbcaa506acbb113f675f98f5100e09b0a45d4304c5b66d1642d2a8ece6
EBUILD opendkim-2.6.8.ebuild 6380 SHA256 1251c1d8ced6ad6b0c2c51fe20699623fc5d10c41bd0b3cd73eca9b31fbd8f2a SHA512 68914959f5e82083e36e41731a2121f08e3dabd97c46849e611a09cd757017dd1f853ccaa95216ee988010634e9933767f4caae34e46cb161847d5be245ab221 WHIRLPOOL 3a3bca5c1a51066bcd91dd7e6bc29a0c364a7fdfff9c027268a11f847dcab07300e09d2d88bdd04b3fd696f4abc06275e2408f5e7535d01a5b2b6e23bd76cb63
EBUILD opendkim-2.7.0.ebuild 5980 SHA256 bba11f3060774c3e665b8c9e0a91483a817d34f6c40268214ed2f66591059c6f SHA512 bbae17c344d99a982e549feeaeb85c9fefa3739c6b35e0e05ffc26c65b92befb4e44284c24dcd17a645e61545805fbb75b57192e8afea639a6595543bd30e87d WHIRLPOOL b256873263f8b861c8c67c453c6f737eccb526cb96ff04306bea949d002c06232f792d1a26945b943cee0db5b8b014f8557a7f54897e5854ff90f67239dcda6c
EBUILD opendkim-2.7.1.ebuild 5980 SHA256 1b0ab9e9a9c3ad9ee31c7a55102c0e8eab149f56dce0c1348f9a981d09044379 SHA512 3b240ae0f2e2f2716a2f206fb668d4e01eea2c0ec04dbf638c78cb5ebaaf98c15ae45540a14a8433832222fcba2b25ac12e1c3bf4e35bc73b1a858f22f5b9c7a WHIRLPOOL ce2318ef0e7104ad756cd2f6d03114a653c0763f14ecbf8d001e52a01ac6f6dfe22fc0cd02e8c305b322d1aba8cddd8644b05c8a9633aefbb2ff9c9c439bf8ad
EBUILD opendkim-2.7.2.ebuild 6018 SHA256 bf833332cc51619ef502df419bd1ea00f4cfac9580c0d769ee27d03e6d9be51e SHA512 46dd38590bc4683244bf57f65bf0d796cacded1a6c8507dddd7337e4b147169e7a21428b495863de52651af89020911651dc6b9d6b891fc761a61c0f886a9de1 WHIRLPOOL 4bafda1b64e90f60ead18947ec051fa55e4b7edf1be3be0208c6d365ebc5fa040253987e4b9a965e4b053f6450d41b3708d49db0f3a570a1cf397b28846f89e2
-MISC ChangeLog 9405 SHA256 6d5ca965066dfe140364f04987bf493835114a85b7f5f0756910d984ff92df78 SHA512 03509563d0a773cccf4849c6f665a245cbc6a5c4d39717f1b149f19ff84649667928100858c1ccf06535f36f77bb5a188934697c20b8426329bb857e4ac6c253 WHIRLPOOL 40d4a742fd13bcb64f15149b4d52d67a15e230d4ef9f37cece4d65791c217824cb457fe40a9c7c44dd76836d652a2ddc2fd786dc2c59dc6ffb992c2daea06a9a
+EBUILD opendkim-2.7.4.ebuild 6085 SHA256 f94750bee3106d5cb84480fc2f0c6f211b2d5d077e287d481840ece3eb37d315 SHA512 b7fef312987158eba8c28bd8704cade8911805187465acc3bebd809fa4cc0518b23790b5205eb1d6421a868b427491f1e434de9bdea11582b5d7aa94402df3ae WHIRLPOOL 6d39660ae2a899647010ce3041b2e22794228e97ca2d45b67f6d7d3f262652ab73c9fa6c05da7565028cf6afd17c3506f3920f213462a97281780480f92880fd
+MISC ChangeLog 9825 SHA256 f2bcffb82f9b8d37e07a1a0a6f2ffd005a8e12f7971626d403045d888b1f9dae SHA512 73e24afa23ea5045bcac50e942cf08f2c2b7ded52165150d56b59fb41c78a04fabe52d484a31c9df8cf9e621b778e96fc6cc740da8edcc80b09e286e1ddf18f0 WHIRLPOOL 72cb953c62c555de14a512736d88f828a543b3b87dd0c3674a51ab89a7663c2c8704f3e7deaf6c747ad88e1628bc6fb078aca39fe049dfd58478f51128a3833c
MISC metadata.xml 1325 SHA256 5c79e487583ffa41f2823235e61232f84c1ac18ef41b1b71150f8d32f76b82eb SHA512 ae25f27a0c0cc5c3460b150f3eb6369e34b3051984b58da6a81847b5e90edc62e91fdd8f0d428576ef73614db095dc3a415237cccc1cc3cc806f9d99ff588df5 WHIRLPOOL d8b1221d484e12c31d76a20e8a7e6e0d033e16884e7dd14f657d4383f24f8f9294bc51dea4f512896a4183f9299c2faef31e7540d95c418000245090a3a0cdfe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iQIcBAEBCAAGBQJQtR/XAAoJEHfx8XVYajsfYY4QAIDsyyiqcw4SxWhWJ1TbD6GA
-s9mbWcaD2WITpYShOC8PCxNVQBT6UcA08H8wfqT3HUwr7ARzp8P4Uhhqb3eAlItq
-ricaKwczGEemk/lXU7MPtryxiIdhRmAO2TP35Pokzz8fVy5IsAUXR6kcedf5Lxfn
-imdxuptL9Q5k7fgdAPsqiYfBND+MFRvOc7Es0EcR2zm3tr/KcFt2WElyIBpvudZI
-6VHlAUuYYMIWjqQJozg4ts8cMVsCnc4+U2p5FFiF8yeDw93FVsEHgpU6lGkbxY+J
-mO9F+ZKSG0aevDHWdc+bYZIaY5x94K85h2M7gwzInDD3uRA/CREEBbSCVMIobrRm
-I1xSayzUVcqIzkvGQmQO2kRdRy771KlnhEwqEurJvn/GVScKPFcGSiJw6x/PsDqA
-Z4zUhrKPa6LEEsuVFgaXYV0H/FArK8XZTslQHelzFDFINJVOys5J9tLH5n2I2Nay
-wLcK9kbWWVj4bEcu5i5fUiAN+x9tUkQpTzn0eQvgHEDv90afv7CTyJSPiaiZnAf6
-quuXhqJI0Jzw4MTeIexF2X6hkxxWSdWhxruaDGcnsRsl0XIdMgNXiKm73v/QGUEq
-R6W6vrjACEJUMvM94AflhwNzZCk9bhitSK6vwMrSRVWE92BcPC8LpWYFf/W/yNT8
-WlUpeQrAeGcPTVSoXQjc
-=E4iv
+iQIcBAEBCAAGBQJQ+VGpAAoJEHfx8XVYajsfVj4QAIHI6wTMXAWAyIf1v2g35fpX
+u+cp9D9GaAcJq4gtPz5H2IurJCkd6IeyF8/Oh/EO3+qUB+J8CRr/Z6fKVk2tgTo9
+i13UvQJbenYu2/jvh+ZLWrDnn4aytCbIdBf0UjvJiguRxIuVwxg6Capsh85bL/xv
+uQS8CfFomi6+nPl/gTaDq5a6x7KErJn8WB5hF6Byyitlu4kdojXxMJAWTAiTtTpP
+C1umKXYdBNtuASbhGKAkOE2Q7ZLgufN8di+F50i+m1UED4Ruunu0C0wyGUBlBukA
+WyR4SeFmmzshR5PjAwEqVErRgwMwZYluvFXJKA8iCyrpQwmon4g87V0QeBJLHuK7
+RY7ofYDVsw9TJCZiNISts4chEdsvVTKjG16DtbTlGZ8ED2vm1szTup42xBV0a1OL
+yvvfKe1+AtX+Kt2+nyXPWZ2T8zRk9nw9RgMoXlwuqItfzdOwrEJ/bFBTnIUWSRiZ
+HDf6DEbPv7ShFkngmFaUMPSh4X8p3fri4h4QOKR6HLnIlY+TZWv6PJh8ySttYsHs
+nYQL2tq0Q5TeO9cSyKsI+vNsGhHryiBxpOz0sxhH/wPacby+h7eRopRC3IjMfRCV
+IzcGpdwHgZgZbOw2XsMLDEwAe13Q6IUwgHF9AsJCzH5s6fpMRR/UBDqFi3iRf96w
+MytYfTrNeO4G+neuIFDl
+=hrql
-----END PGP SIGNATURE-----
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"
+}