diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
commit | b7ebc951da8800f711142f69d9d958bde67a112d (patch) | |
tree | e318514216845acb8f2e49fff7a5cba4027e9d91 /mail-filter/opendkim | |
parent | dc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff) |
gentoo resync : 28.04.2019
Diffstat (limited to 'mail-filter/opendkim')
-rw-r--r-- | mail-filter/opendkim/Manifest | 7 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim-2.10.3-openrc.patch | 295 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim-2.10.3-openssl-1.1.1.patch.r2 | 170 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim-r1.service | 15 | ||||
-rw-r--r-- | mail-filter/opendkim/files/opendkim.init.r3 | 55 | ||||
-rw-r--r-- | mail-filter/opendkim/opendkim-2.10.3-r10.ebuild | 227 | ||||
-rw-r--r-- | mail-filter/opendkim/opendkim-2.10.3-r12.ebuild | 228 | ||||
-rw-r--r-- | mail-filter/opendkim/opendkim-2.10.3-r3.ebuild | 204 |
8 files changed, 924 insertions, 277 deletions
diff --git a/mail-filter/opendkim/Manifest b/mail-filter/opendkim/Manifest index 6a9c5bfeaf1d..334b1189f0dc 100644 --- a/mail-filter/opendkim/Manifest +++ b/mail-filter/opendkim/Manifest @@ -1,16 +1,17 @@ AUX opendkim-2.10.3-gnutls-3.4.patch 1555 BLAKE2B 17a74a6487a514b967d35e77a0a6bb22733648b561b8eac31d95eed16b0faef82a047a1444626bd560b27bc8ed67dd17f9cadc82449d169fdfb6ed45b50644b1 SHA512 f159f7ef3dffe876ccb01cff5b8fbb599357765ff028ef1db28b7f3dba5e13579c7e9bac305fc36fc324fdad0697224f8caa66d27dd3a1085b5fca133365f4ef +AUX opendkim-2.10.3-openrc.patch 10203 BLAKE2B e365ba4c0782dc03d8b5a32413b11b691fafe6859123f8da7daf882540b644069e1792a2b91743e8b00c85af2ba63c9556a4c7f90de4103ea712fe2a096e2b44 SHA512 97342811b4ce4957c4c375cda0edffc056a301348ee4e5dcf94d7425e69f4a91c1897a2e2b7219791fafa6eb731f8e3308aac2f3e1280738eb1d2e5b7d563e56 AUX opendkim-2.10.3-openssl-1.1.1.patch 5889 BLAKE2B 288900a8cba7b4ccf376240485234a0d01720b96a874ac73a7b2f5f5a63f00a67f5a940d5657a702fc7c058989764fe52d17e6625ce96c7cf390cee6c9a29ed9 SHA512 63d0b27e4cde4aadc72320f3ea6b2ea3e45357c019b4fe0e473eb6010c0c6ed3e4ec9541448325848cdd52955943d2ba2527f9819f5e10d5953f085ba4663f85 -AUX opendkim-r1.service 516 BLAKE2B 738fd145b6e6c62d76bdb45a6f782c1dfacb1623a658c648b924366fb0ec56d15fdaf0137d3cd3cfb777c563d6967c1272755db1bf4f02fef91ecb2f7d575c91 SHA512 ad0f95ee60628319f3e8f316984f2bee0fd278cebd52bf1c662cc0d38ff09e5bc5df76349e8aeb2918cdf44a92b05b2d5df2ed11738e86a6a5a64c86004fd971 +AUX opendkim-2.10.3-openssl-1.1.1.patch.r2 5966 BLAKE2B c0dcb757f1195e8a3fc055f5162b805bf5bb2fe7a6a7c24317cfc1f0ed05491803f2fefbc22e96409a339f9741cac5344044a1efadec1f3e3c87084b2c221ed6 SHA512 e532d0411bc6cf1f55bf2de1bad54dc29d19558b2c4ea27aa72f17738688d48f111c3662e88064169a78347144eae289b362bfa4849ab4d3b06ff97d439cce47 AUX opendkim-r3.service 540 BLAKE2B ff968ae27fc0333dd2938e2990306df213b58debfbbce2ba4b267f4f17ea657fe55697e987b252d0f019ca5b0725d2f92a22ae583a24e273a39d905aed0d5304 SHA512 11b6efb1ab8bde75ce494cffc84ba4fa2f7ef8dc7f00b96172a43c5e35b14cea0e1cd712eb9a6caca8005e2c9f2e464de2f2b7ab1502394708224b116f195235 AUX opendkim.confd 742 BLAKE2B 4061bd542c3993b1a1e4a24e7f51992b51380403490a5d0e011e5f0146f9785ebb521fcf5cb2f7731e0037d198a349b44866dd78d73e776112f3364d26368244 SHA512 db103c23d03bcc5919e795cd0bb6e9cfa6a0b8b65c55476fce8aaedfa539a707f0e2b7e10fc493e8a18ef9743b1f80bb97c1b3aaa8b6dc51646898ffdc0fff65 -AUX opendkim.init.r3 1430 BLAKE2B a09484ef2123f9d7096211c1539eab5fda14ff1f36a291c2f6366781ad868d43028bae60eb4e3676380f3c830a350cf53c6cb42837f56160c5b9c59d1f7e261b SHA512 d0a5985ffac171774664d4f619924f25c462d5829e8281b8ff643c22918295d513cf6e0e3a335c550c378b6d4739604539585f2ca809172a090f15d5c1294cf4 AUX opendkim.init.r5 2200 BLAKE2B d617879b128d5de97cc7239865400ea0d12e438c5f13ac97fc663b33b3ce24a4fb8798d287cb4e7a932e2005226c38b4a0a83a4a10d6e047103a19102f625790 SHA512 220ba494b83189aceba304534d1538cc38414c82a522a9fa8211f9277bf22ae8787581b3913e2a267b766ad33bfa4ee005780ee744633f2c765d15696f5bd0cb AUX opendkim.init.r6 2295 BLAKE2B 3ce426713b88e714e3f25a4d33ce1f6602ef2ae7546bfe1802d9615202ecd84295b7a469836535a6ecad1c191604e96ee336ec5b6a988dd473fc312cdce43f5c SHA512 8267610aa10bf2cf1c72baf6fd010cdfcaa8f11ffd10ab42e781bfb4e0e992a758d3f198b4caf2a8f1d66672d5ce797da16f1518abed1b3af31bb7ed61c887ea AUX opendkim.service 439 BLAKE2B 203f8d5a55f9f08069eec0bac8b9af743e3c0414a927c47ae67533a94c67371aa12963c347361056939cc18492612f067102eca09166de6aa83d1b0541d4a8e6 SHA512 308edc70fdb0bd57b424e739412217fd8017b017e9b27bc0954dec55294d10d8b7713f6f191836b94aa49bf578bfb391dca748af0c8d9b72e14ebe1eae21e834 AUX opendkim.service.conf 60 BLAKE2B 797a3947c9c984378955701252cc9d956c8398f1bba7696e7d5c052dd8103355dbf147ac05ae5b7f372867f2b330aaaf160e83709e440a9fc942e9069dbe7c2e SHA512 635e474464f81abe8444030b3cdc6e747298fc463bd02e4292e914ad622761f354b92921cd380387c8e9272435e1660de1a1cf8dbe34ded870e728ecc9e00246 AUX opendkim.service.r4 629 BLAKE2B 9d2fe74576a4085b1c2f4c74c319e490d332d34cb32206bf6ccbd8001600c63cc6fdb193900ca70f5d83e77694da126f15c86a6391d6835f843bd1c3a1dd413c SHA512 a41dbb8e14a4fae7f314935f9f6aedb66efe2ad6ca95eefdf92244ce0c577b8b18fe90266bd38437d6a033040195db46b02c595f958d6b59850974ccc98a9dda DIST opendkim-2.10.3.tar.gz 1210224 BLAKE2B affd4526568431fa1afee93a167c5569912c9344ea4e6eee3281a035bd0c76d2be5d2e8e144bbebabd681a73388a37ac56d9a2e4daf00af9baadad14ffb42265 SHA512 97923e533d072c07ae4d16a46cbed95ee799aa50f19468d8bc6d1dc534025a8616c3b4b68b5842bc899b509349a2c9a67312d574a726b048c0ea46dd4fcc45d8 -EBUILD opendkim-2.10.3-r3.ebuild 6086 BLAKE2B f1473a7605c8ebb73170498ce826ce0b6a630c5109a0661a6a3226aa25d06fad04fc621b9b8c3931f47f497bbaae1cf2273fdb101c2c805aef6921283ee5f8e4 SHA512 4601d56f81230dca6753b3793b0392c1b05365706d1f97961f6bbe5172cbeebb2fa4b914390460b7872e9aca72e44c6b89ba6ea71c2c40504a1e8343d84bf74d +EBUILD opendkim-2.10.3-r10.ebuild 7426 BLAKE2B a41072224c47d95fb7bd01d659df5ef3ccd2b65dcff22cc3f71b061310d936f26085f72e57a9c0142799817cf0d3f6504f9121ae3104822ac8c6e5c2cc9c96eb SHA512 d6b0f2dc00afb6caebb1dedf6a2bef12168eee05e9ae030bc32ef19634a2e17d687827f75ed6328a0064b80ca3b3e24df9fada28f9530a514f0c39ade8c3548f +EBUILD opendkim-2.10.3-r12.ebuild 7399 BLAKE2B bf56fff18ddf7d4f931906e00df4c2b39d9447eb42c38624f6010b3da816bd2a9c6f25f9019fe667fd17aed86a84b3c518c591bb92e0389b6557ba99e5864540 SHA512 483f07a5fa2373b57d819e0401cc7d3171417e8eb373d0098ca4cd3883db8a02d0900d243f90a7509034596b0cc8fd68f66994267ea248fa9a752fbbe894e1ff EBUILD opendkim-2.10.3-r8.ebuild 7233 BLAKE2B 81c780d136560365a2a4eebf31901448cadec91616388ab9851c0bbd24dfff965c517cec5af73fd3adc4507708aba1c24d13d8905f7e5499c09ef4e6751171ee SHA512 385e2da6c53900a98f35a9839007f5dd7caa65fb9138599e1ced1639759fbb674223ecd2ccf8bddd4341334934440476112b07f280efabf345af8e0b77098815 EBUILD opendkim-2.10.3-r9.ebuild 7490 BLAKE2B f929abefd9ce34340562040786fcd390b9b879e5b91e342c679fd955e32281f8f2578eeadc418d4448f3c536ed7be69efdf06dc192bfc906a4f5706e6abed166 SHA512 10844c172845ad2c52e64d5fb8ffd0262d6dfebc60a4053f8d8b5ba5d6e53c2927ac25848cf2783aed60a091d96fd3149d6e5280b438f050b652a776ac6e6040 MISC metadata.xml 1988 BLAKE2B 14cc3bed4822cd17ff675b16aba8a973476b78da8fcd73953ecc419778498c7d8e2b6837c7bacf7a0221086ec740ffbac6900cfb8d50143f995c6f8ddcb72752 SHA512 dea34aca15c223d2195de689333b98c23abb18830a64f73e602405d36b5ca7f46b065533f116307075ab2d01570e52e8352a394efae39a6e5d1af51c56b91543 diff --git a/mail-filter/opendkim/files/opendkim-2.10.3-openrc.patch b/mail-filter/opendkim/files/opendkim-2.10.3-openrc.patch new file mode 100644 index 000000000000..9b645ba0f0ce --- /dev/null +++ b/mail-filter/opendkim/files/opendkim-2.10.3-openrc.patch @@ -0,0 +1,295 @@ +diff --git a/Makefile.am b/Makefile.am +index ee2d21ab..b085b988 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -39,6 +39,52 @@ DISTCLEANFILES = opendkim-@VERSION@.tar.gz + # though. + DISTCHECK_CONFIGURE_FLAGS=--enable-vbr --with-lua --enable-stats --with-odbx --with-db --with-openssl=/usr/local --enable-atps --enable-replace_rules + ++ ++# ++# Handle some scripts and configuration files that need @VARIABLE@ ++# replacements here, so that we can share the rules (which are ++# identical) between all of the targets. ++# ++ ++# We want to *build and install* these on the target machine. ++nodist_doc_DATA = contrib/OpenRC/opendkim.openrc \ ++ contrib/systemd/opendkim.service \ ++ contrib/systemd/opendkim.tmpfiles \ ++ opendkim/opendkim.conf.simple \ ++ opendkim/opendkim.conf.simple-verify ++ ++# Custom variable to keep the rule below as sane as possible. ++doc_DATA_intermediate = contrib/OpenRC/opendkim.openrc.in ++ ++# We want to *ship* these. ++EXTRA_DIST = contrib/OpenRC/opendkim.openrc.in.in \ ++ contrib/systemd/opendkim.service.in \ ++ contrib/systemd/opendkim.tmpfiles.in \ ++ opendkim/opendkim.conf.simple.in \ ++ opendkim/opendkim.conf.simple-verify.in ++ ++# The next rule allow us to replace bindir, libdir, etc. within ++# files. The example is taken from the autoconf documentation and can ++# be found in the "Installation Directory Variables" section. ++edit = sed -e 's|@DOMAIN[@]|$(DOMAIN)|g' \ ++ -e 's|@RUNSTATEDIR[@]|$(runstatedir)|g' \ ++ -e 's|@SBINDIR[@]|$(sbindir)|g' \ ++ -e 's|@SYSCONFDIR[@]|$(sysconfdir)|g' ++ ++# This rule includes EVERY source/intermediate file as a dependency of ++# EVERY output file, which is clearly wrong, but it may be the best we ++# can do without duplication. At least it's the right kind of wrong, ++# and rebuilds too often rather than not often enough. ++$(nodist_doc_DATA): $(doc_DATA_intermediate) $(EXTRA_DIST) Makefile ++ rm -f $@ $@.tmp ++ srcdir=''; \ ++ test -f ./$@.in || srcdir=$(srcdir)/; \ ++ $(edit) $${srcdir}$@.in > $@.tmp ++ mv $@.tmp $@ ++ ++ ++ ++ + $(DIST_ARCHIVES): distcheck + + $(DIST_ARCHIVES).md5: $(DIST_ARCHIVES) +diff --git a/configure.ac b/configure.ac +index 76914fd9..a478bb83 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,9 @@ AC_PROG_CC_C99 + AM_PROG_CC_C_O + AC_PROG_LIBTOOL + ++# Used by the OpenRC service script, at least. ++AC_PROG_GREP ++ + PKG_PROG_PKG_CONFIG + + # +@@ -2628,6 +2631,11 @@ AC_SUBST(SPECCONFIGURE) + AC_SUBST(SPECREQUIRES) + AC_SUBST(SPECBUILDREQUIRES) + ++# Autoconf 2.70 will support this, and many distros patch it in, ++# but Autoconf 2.70 hasn't actually been released yet. ++AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run']) ++AC_SUBST([runstatedir]) ++ + # + # Finish up + # +@@ -2639,6 +2647,7 @@ AC_OUTPUT([ Makefile + contrib/docs/Makefile + contrib/init/Makefile + contrib/init/generic/Makefile ++ contrib/OpenRC/opendkim.openrc.in + contrib/init/redhat/Makefile + contrib/init/redhat/opendkim + contrib/init/redhat/opendkim-default-keygen +@@ -2650,8 +2659,6 @@ AC_OUTPUT([ Makefile + contrib/spec/Makefile + contrib/spec/opendkim.spec + contrib/stats/Makefile +- contrib/systemd/Makefile +- contrib/systemd/opendkim.service + libopendkim/opendkim.pc libopendkim/Makefile + libopendkim/docs/Makefile + libopendkim/tests/Makefile +@@ -2664,8 +2671,6 @@ AC_OUTPUT([ Makefile + opendkim/opendkim-lua.3 + opendkim/opendkim-testkey.8 opendkim/opendkim-stats.8 + opendkim/opendkim-testmsg.8 opendkim/opendkim.conf.5 +- opendkim/opendkim.conf.simple +- opendkim/opendkim.conf.simple-verify + opendkim/opendkim-atpszone.8 opendkim/opendkim-spam.1 + opendkim/tests/Makefile + stats/Makefile stats/opendkim-importstats.8 +diff --git a/contrib/Makefile.am b/contrib/Makefile.am +index 76df01cd..401130bb 100644 +--- a/contrib/Makefile.am ++++ b/contrib/Makefile.am +@@ -3,6 +3,6 @@ + + #AUTOMAKE_OPTIONS = foreign + +-SUBDIRS = convert docs init ldap lua patches repute spec stats systemd ++SUBDIRS = convert docs init ldap lua patches repute spec stats + + dist_doc_DATA = README +diff --git a/contrib/OpenRC/opendkim.openrc.in.in b/contrib/OpenRC/opendkim.openrc.in.in +new file mode 100644 +index 00000000..4b783615 +--- /dev/null ++++ b/contrib/OpenRC/opendkim.openrc.in.in +@@ -0,0 +1,54 @@ ++#!/sbin/openrc-run ++# Copyright 1999-2019 Gentoo Authors ++# Distributed under the terms of the GNU General Public License v2 ++ ++CONFFILE="@SYSCONFDIR@/${RC_SVCNAME}.conf" ++required_files="${CONFFILE}" ++ ++command="@SBINDIR@/opendkim" ++pidfile="@RUNSTATEDIR@/${RC_SVCNAME}.pid" ++command_args="-P ${pidfile} -x ${CONFFILE}" ++extra_commands="checkconfig" ++ ++depend() { ++ use dns logger net ++ before mta ++} ++ ++checkconfig() { ++ # ++ # The opendkim.conf man page says, ++ # ++ # For parameters that are Boolean in nature, only the first byte ++ # of the value is processed... For negative values, the following ++ # are accepted: "F", "f", "N", "n", "0".' ++ # ++ if @GREP@ '^[[:space:]]*Background[[:space:]]\+[FfNn0]' "${CONFFILE}" \ ++ >/dev/null 2>&1; then ++ eend 1 "${RC_SVCNAME} cannot run in the foreground!" ++ fi ++ if ! "${command}" -n "${command_args}"; then ++ eend 1 "${RC_SVCNAME} configuration check failed" ++ fi ++} ++ ++start_pre() { ++ # If this isn't a restart, make sure that the user's config isn't ++ # busted before we try to start the daemon (this will produce ++ # better error messages than if we just try to start it blindly). ++ # ++ # If, on the other hand, this *is* a restart, then the stop_pre ++ # action will have ensured that the config is usable and we don't ++ # need to do that again. ++ if [ "${RC_CMD}" != "restart" ]; then ++ checkconfig || return $? ++ fi ++} ++ ++stop_pre() { ++ # If this is a restart, check to make sure the user's config ++ # isn't busted before we stop the running daemon. ++ if [ "${RC_CMD}" = "restart" ]; then ++ checkconfig || return $? ++ fi ++} +diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am +deleted file mode 100644 +index 2ffc88cc..00000000 +--- a/contrib/systemd/Makefile.am ++++ /dev/null +@@ -1,3 +0,0 @@ +-# Copyright (c) 2013, The Trusted Domain Project. All rights reserved. +- +-dist_doc_DATA = opendkim.service +diff --git a/contrib/systemd/opendkim.service.in b/contrib/systemd/opendkim.service.in +index f7665f43..236f8a06 100644 +--- a/contrib/systemd/opendkim.service.in ++++ b/contrib/systemd/opendkim.service.in +@@ -1,20 +1,28 @@ +-# If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers. +-# For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to: +-# After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service ++# If you are using OpenDKIM with SQL datasets, you should start ++# OpenDKIM after your database server. For example, when using ++# PostgreSQL, you should create a supplementary ".conf" file in the ++# appropriate directory containing, ++# ++# [Unit] ++# After=postgresql.service ++# + + [Unit] + Description=DomainKeys Identified Mail (DKIM) Milter +-Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html ++Documentation=man:opendkim(8) \ ++ man:opendkim.conf(5) \ ++ man:opendkim-genkey(8) \ ++ man:opendkim-genzone(8) \ ++ man:opendkim-testkey(8) \ ++ http://www.opendkim.org/docs.html + After=network.target nss-lookup.target syslog.target + + [Service] + Type=forking +-PIDFile=@localstatedir@/run/opendkim/opendkim.pid +-EnvironmentFile=-@sysconfdir@/sysconfig/opendkim +-ExecStart=@sbindir@/opendkim $OPTIONS ++ExecStart=@SBINDIR@/opendkim -P @RUNSTATEDIR@/opendkim.pid ++ExecStartPre=@SBINDIR@/opendkim -P @RUNSTATEDIR@/opendkim.pid -n -f + ExecReload=/bin/kill -USR1 $MAINPID +-User=opendkim +-Group=opendkim ++PIDFile=@RUNSTATEDIR@/opendkim.pid + + [Install] + WantedBy=multi-user.target +diff --git a/contrib/systemd/opendkim.tmpfiles.in b/contrib/systemd/opendkim.tmpfiles.in +new file mode 100644 +index 00000000..a9118974 +--- /dev/null ++++ b/contrib/systemd/opendkim.tmpfiles.in +@@ -0,0 +1,5 @@ ++# We allow everyone to read/traverse this directory because if it ++# contains a local socket, then (for example) your MTA will want to ++# look in there. Permissions on the socket itself are controlled ++# by the "UserID" and "UMask" directives in the daemon's configuration. ++d @RUNSTATEDIR@/opendkim 0755 opendkim opendkim +diff --git a/opendkim/Makefile.am b/opendkim/Makefile.am +index 4aa615c1..7d514771 100644 +--- a/opendkim/Makefile.am ++++ b/opendkim/Makefile.am +@@ -16,9 +16,11 @@ endif + sbin_PROGRAMS += opendkim-stats + endif + ++ + dist_sbin_SCRIPTS = opendkim-genkey +-dist_doc_DATA = opendkim.conf.sample opendkim.conf.simple \ +- opendkim.conf.simple-verify README.SQL ++ ++dist_doc_DATA = opendkim.conf.sample README.SQL ++ + + if BUILD_FILTER + sbin_PROGRAMS += opendkim +diff --git a/opendkim/opendkim.conf.simple-verify.in b/opendkim/opendkim.conf.simple-verify.in +index 2224b64f..463048ab 100644 +--- a/opendkim/opendkim.conf.simple-verify.in ++++ b/opendkim/opendkim.conf.simple-verify.in +@@ -17,5 +17,5 @@ Mode v + + # ADSPDiscard no + +-# PidFile /var/run/opendkim/opendkim.pid ++# PidFile @RUNSTATEDIR@/opendkim.pid + +diff --git a/opendkim/opendkim.conf.simple.in b/opendkim/opendkim.conf.simple.in +index 735b924b..b70bfb46 100644 +--- a/opendkim/opendkim.conf.simple.in ++++ b/opendkim/opendkim.conf.simple.in +@@ -12,6 +12,12 @@ KeyFile /var/db/dkim/@DOMAIN@.private + + Socket inet:8891@localhost + ++# To use a local socket instead, specify a path here. The "standard" ++# location is under @runstatedir@/opendkim, and it's best to agree ++# on that directory so that various init systems can configure its ++# permissions and ownership automatically. ++#Socket local:@RUNSTATEDIR@/opendkim/opendkim.sock ++ + ReportAddress postmaster@@DOMAIN@ + SendReports yes + +@@ -25,4 +31,4 @@ SendReports yes + # + # PeerList X.X.X.X + +-# PidFile /var/run/opendkim/opendkim.pid ++# PidFile @RUNSTATEDIR@/opendkim.pid diff --git a/mail-filter/opendkim/files/opendkim-2.10.3-openssl-1.1.1.patch.r2 b/mail-filter/opendkim/files/opendkim-2.10.3-openssl-1.1.1.patch.r2 new file mode 100644 index 000000000000..cc8f48bae2db --- /dev/null +++ b/mail-filter/opendkim/files/opendkim-2.10.3-openssl-1.1.1.patch.r2 @@ -0,0 +1,170 @@ +From FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223568 +--- a/configure.ac 2015-05-12 18:43:09 UTC ++++ b/configure.ac +@@ -860,26 +860,28 @@ then + AC_SEARCH_LIBS([ERR_peek_error], [crypto], , + AC_MSG_ERROR([libcrypto not found])) + +- AC_SEARCH_LIBS([SSL_library_init], [ssl], , +- [ +- if test x"$enable_shared" = x"yes" +- then +- AC_MSG_ERROR([Cannot build shared opendkim +- against static openssl libraries. +- Configure with --disable-shared +- to get this working or obtain a +- shared libssl library for +- opendkim to use.]) +- fi + +- # avoid caching issue - last result of SSL_library_init +- # shouldn't be cached for this next check +- unset ac_cv_search_SSL_library_init +- LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl" +- AC_SEARCH_LIBS([SSL_library_init], [ssl], , +- AC_MSG_ERROR([libssl not found]), [-ldl]) +- ] +- ) ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], ++ [[SSL_library_init();]])], ++ [od_have_ossl="yes";], ++ [od_have_ossl="no";]) ++ if test x"$od_have_ossl" = x"no" ++ then ++ if test x"$enable_shared" = x"yes" ++ then ++ AC_MSG_ERROR([Cannot build shared opendkim ++ against static openssl libraries. ++ Configure with --disable-shared ++ to get this working or obtain a ++ shared libssl library for ++ opendkim to use.]) ++ fi ++ ++ LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl" ++ AC_SEARCH_LIBS([SSL_library_init], [ssl], , ++ AC_MSG_ERROR([libssl not found]), [-ldl]) ++ fi + + AC_CHECK_DECL([SHA256_DIGEST_LENGTH], + AC_DEFINE([HAVE_SHA256], 1, +--- a/libopendkim/tests/Makefile.in 2015-05-12 18:43:48 UTC ++++ b/libopendkim/tests/Makefile.in +@@ -1108,8 +1108,10 @@ am__nobase_list = $(am__nobase_strip_setup); \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' + am__base_list = \ +- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ +- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' ++ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\ ++/ /g' | \ ++ sed '$$!N;$$!N;$$!N;$$!N;s/\ ++/ /g' + am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ +@@ -4131,16 +4133,19 @@ uninstall-am: uninstall-dist_docDATA + @LCOV_TRUE@description.txt: $(check_PROGRAMS) $(check_SCRIPTS) + @LCOV_TRUE@ rm -f $@ + @LCOV_TRUE@ for i in $(check_PROGRAMS); do \ +-@LCOV_TRUE@ testname=$${i/t-}; \ +-@LCOV_TRUE@ testname=$${testname//-/_}; \ ++@LCOV_TRUE@ testname=$${i#t-}; \ ++@LCOV_TRUE@ testname=$$(echo $${testname} | sed -e 's/-/_/g'); \ + @LCOV_TRUE@ fgrep '***' $$i.c | tail -n 1 | \ +-@LCOV_TRUE@ (echo $${testname} ; sed -e 's/[^*]*\*\*\*\(.*\)\\n.*/\t\1\n/g' ) >> $@; \ ++@LCOV_TRUE@ (echo $${testname} ; sed -e 's/[^*]*\*\*\*\(.*\)\\ ++@LCOV_TRUE@.*/ \1\ ++@LCOV_TRUE@/g' ) >> $@; \ + @LCOV_TRUE@ done + @LCOV_TRUE@ for i in $(check_SCRIPTS); do \ +-@LCOV_TRUE@ testname=$${i/t-}; \ +-@LCOV_TRUE@ testname=$${testname//-/_}; \ ++@LCOV_TRUE@ testname=$${i#t-}; \ ++@LCOV_TRUE@ testname=$$(echo $${testname} | sed -e 's/-/_/g'); \ + @LCOV_TRUE@ grep '^#' $$i | tail -n 1 | \ +-@LCOV_TRUE@ (echo $${testname} ; sed -e 's/^# \(.*\)/\t\1\n/g' ) >> $@; \ ++@LCOV_TRUE@ (echo $${testname} ; sed -e 's/^# \(.*\)/ \1\ ++@LCOV_TRUE@/g' ) >> $@; \ + @LCOV_TRUE@ done + + @LCOV_TRUE@description.html: description.txt +--- a/libopendkim/dkim-canon.c 2015-05-11 03:56:13 UTC ++++ b/libopendkim/dkim-canon.c +@@ -388,7 +388,7 @@ dkim_canon_header_string(struct dkim_dstring *dstr, dk + } + + /* skip all spaces before first word */ +- while (*p != '\0' && DKIM_ISWSP(*p)) ++ while (*p != '\0' && DKIM_ISLWSP(*p)) + p++; + + space = FALSE; /* just saw a space */ +--- a/opendkim/tests/Makefile.in 2015-05-12 18:43:49 UTC ++++ b/opendkim/tests/Makefile.in +@@ -139,8 +139,10 @@ am__nobase_list = $(am__nobase_strip_setup); \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' + am__base_list = \ +- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ +- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' ++ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\ ++/ /g' | \ ++ sed '$$!N;$$!N;$$!N;$$!N;s/\ ++/ /g' + am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ +@@ -1298,14 +1300,16 @@ uninstall-am: uninstall-dist_docDATA + @LCOV_TRUE@description.txt: $(check_SCRIPTS) + @LCOV_TRUE@ rm -f $@ + @LCOV_TRUE@ for test in $? ; do \ +-@LCOV_TRUE@ testname=$${test/t-}; \ +-@LCOV_TRUE@ testname=$${testname//-/_}; \ ++@LCOV_TRUE@ testname=$${test#t-}; \ ++@LCOV_TRUE@ testname=$$(echo $${testname} | sed -e 's/-/_/g'); \ + @LCOV_TRUE@ grep ^# $$test | tail -n 1 | \ +-@LCOV_TRUE@ sed -e "s/^#\(.*\)/$${testname}\n\t\1\n/g" >> $@; \ ++@LCOV_TRUE@ sed -e "s/^#\(.*\)/$${testname}\ ++@LCOV_TRUE@ \1\ ++@LCOV_TRUE@/g" >> $@; \ + @LCOV_TRUE@ done + + @LCOV_TRUE@description.html: description.txt +-@LCOV_TRUE@ gendesc --output $@ $< ++@LCOV_TRUE@ gendesc --output $@ $? + + @LCOV_TRUE@maintainer-clean-local: + @LCOV_TRUE@ -rm -rf lcov/[^C]* +--- a/opendkim/opendkim-crypto.c 2013-02-25 21:02:41 UTC ++++ b/opendkim/opendkim-crypto.c +@@ -222,7 +222,11 @@ dkimf_crypto_free_id(void *ptr) + { + assert(pthread_setspecific(id_key, ptr) == 0); + ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined (LIBRESSL_VERSION_NUMBER) ++ OPENSSL_thread_stop(); ++#else + ERR_remove_state(0); ++#endif + + free(ptr); + +@@ -392,11 +396,15 @@ dkimf_crypto_free(void) + { + if (crypto_init_done) + { ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined (LIBRESSL_VERSION_NUMBER) ++ OPENSSL_thread_stop(); ++#else + CRYPTO_cleanup_all_ex_data(); + CONF_modules_free(); + EVP_cleanup(); + ERR_free_strings(); + ERR_remove_state(0); ++#endif + + if (nmutexes > 0) + { + diff --git a/mail-filter/opendkim/files/opendkim-r1.service b/mail-filter/opendkim/files/opendkim-r1.service deleted file mode 100644 index f2e937a6bf16..000000000000 --- a/mail-filter/opendkim/files/opendkim-r1.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=DomainKeys Identified Mail (DKIM) Milter -Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html -After=network.target nss-lookup.target syslog.target - -[Service] -ExecStart=/usr/sbin/opendkim -f -x /etc/opendkim/opendkim.conf -ExecReload=/bin/kill -USR1 $MAINPID -RuntimeDirectory=opendkim -RuntimeDirectoryMode=0750 -User=milter -Group=milter - -[Install] -WantedBy=multi-user.target diff --git a/mail-filter/opendkim/files/opendkim.init.r3 b/mail-filter/opendkim/files/opendkim.init.r3 deleted file mode 100644 index bb8ac96f0570..000000000000 --- a/mail-filter/opendkim/files/opendkim.init.r3 +++ /dev/null @@ -1,55 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -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.10.3-r10.ebuild b/mail-filter/opendkim/opendkim-2.10.3-r10.ebuild new file mode 100644 index 000000000000..8cba8ef61703 --- /dev/null +++ b/mail-filter/opendkim/opendkim-2.10.3-r10.ebuild @@ -0,0 +1,227 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools db-use eutils systemd user + +DESCRIPTION="A milter providing DKIM signing and verification" +HOMEPAGE="http://opendkim.org/" +SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz" + +# The GPL-2 is for the init script, bug 425960. +LICENSE="BSD GPL-2 Sendmail-Open-Source" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+berkdb ldap libressl lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound" + +DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) + dev-libs/libbsd + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + berkdb? ( >=sys-libs/db-3.2:* ) + opendbx? ( >=dev-db/opendbx-1.4.0 ) + lua? ( dev-lang/lua:* ) + ldap? ( net-nds/openldap ) + lmdb? ( dev-db/lmdb ) + memcached? ( dev-libs/libmemcached ) + sasl? ( dev-libs/cyrus-sasl ) + unbound? ( >=net-dns/unbound-1.4.1:= net-dns/dnssec-root ) + !unbound? ( net-libs/ldns )" + +RDEPEND="${DEPEND} + sys-process/psmisc + selinux? ( sec-policy/selinux-dkim ) +" + +REQUIRED_USE="sasl? ( ldap )" + +PATCHES=( + "${FILESDIR}/${P}-openssl-1.1.1.patch" +) + +pkg_setup() { + # This user can read your private keys, and must therefore not be + # shared with any other package. + enewgroup opendkim + enewuser opendkim -1 -1 -1 opendkim +} + +src_prepare() { + default + + # We delete the "Socket" setting because it's overridden by our + # conf.d file. + sed -e 's:/var/db/dkim:/var/lib/opendkim:g' \ + -e '/^[[:space:]]*Socket/d' \ + -i opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \ + stats/opendkim-reportstats{,.in} || die + + sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \ + || die + + # TODO: what purpose does this serve, do the tests even get run? + sed -e "/sock.*mt.getcwd/s:mt.getcwd():${T}:" \ + -i opendkim/tests/*.lua || die + + eautoreconf +} + +src_configure() { + local myconf=() + if use berkdb ; then + myconf+=( + $(db_includedir) + --with-db-incdir=${myconf#-I} + --enable-popauth + --enable-query_cache + --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_with lmdb) \ + $(use_enable poll) \ + $(use_enable static-libs static) \ + $(use_with memcached libmemcached) \ + "${myconf[@]}" \ + --enable-filter \ + --enable-atps \ + --enable-identity_header \ + --enable-rate_limit \ + --enable-resign \ + --enable-replace_rules \ + --enable-default_sender \ + --enable-sender_macro \ + --enable-vbr \ + --disable-live-testing +} + +src_install() { + default + prune_libtool_files + + dosbin stats/opendkim-reportstats + + newinitd "${FILESDIR}/opendkim.init.r6" opendkim + newconfd "${FILESDIR}/opendkim.confd" opendkim + systemd_newunit "${FILESDIR}/opendkim.service.r4" opendkim.service + systemd_install_serviced "${FILESDIR}/${PN}.service.conf" "${PN}.service" + + dodir /etc/opendkim + keepdir /var/lib/opendkim + + # The OpenDKIM data (particularly, your keys) should be read-only to + # the UserID that the daemon runs as. + fowners root:opendkim /var/lib/opendkim + fperms 750 /var/lib/opendkim + + # Strip the comments out of the "simple" example configuration... + grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \ + > "${T}/opendkim.conf" || die + + # and tweak it a bit before installing it unconditionally. + echo "# For use with unbound" >> "${T}/opendkim.conf" || die + echo "#TrustAnchorFile /etc/dnssec/root-anchors.txt" \ + >> "${T}/opendkim.conf" || die + echo "UserID opendkim" >> "${T}/opendkim.conf" || die + + # The UMask is really only used for the PID file (root:root) and the + # local UNIX socket, if you're using one. It should be 0117 for the + # socket, so we might as well set that unconditionally here. + echo "UMask 0117" >> "${T}/opendkim.conf" || die + + insinto /etc/opendkim + doins "${T}/opendkim.conf" +} + +pkg_postinst() { + if [[ -z ${REPLACING_VERSION} ]]; then + 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." + + # TODO: This is tricky, we really need a good wiki page showing + # how to share a local socket with an MTA! + elog "If you are using a local (UNIX) socket, then you will" + elog "need to make sure that your MTA has read/write access" + elog "to the socket file. This is best accomplished by creating" + elog "a completely-new group with only your MTA user and the " + elog "\"opendkim\" user in it. You would then set \"UMask 0112\"" + elog "in your opendkim.conf, and switch the primary group of your" + elog "\"opendkim\" user to the group that you just created. The" + elog "last step is necessary for the socket to be created as the" + elog "new group (and not as group \"opendkim\")". + else + ewarn "The user account for the OpenDKIM daemon has changed" + ewarn "from \"milter\" to \"opendkim\" to prevent unrelated services" + ewarn "from being able to read your private keys. You should" + ewarn "adjust your existing configuration to use the \"opendkim\"" + ewarn "user and group, and change the permissions on" + ewarn "${ROOT}var/lib/opendkim to root:opendkim with mode 0750." + ewarn "The owner and group of the files within that directory" + ewarn "will likely need to be adjusted as well." + fi +} + +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}var/lib/opendkim/${selector}.private" ]]; then + ewarn "The private key for this selector already exists." + else + keysize=1024 + # Generate the private and public keys. Note that opendkim-genkeys + # sets umask=077 on its own to keep these safe. However, we want + # them to be readable (only!) to the opendkim user, and we manage + # that by changing their groups and making everything group-readable. + opendkim-genkey -b ${keysize} -D "${ROOT}"var/lib/opendkim/ \ + -s "${selector}" -d '(your domain)' && \ + chgrp --no-dereference opendkim \ + "${ROOT}var/lib/opendkim/${selector}".{private,txt} || \ + { eerror "Failed to create private and public keys." ; + return 1; } + chmod g+r "${ROOT}var/lib/opendkim/${selector}".{private,txt} + fi + + # opendkim selector configuration + echo + einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:" + einfo " Keyfile /var/lib/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:/run/opendkim/opendkim.sock" + einfo " non_smtpd_milters = unix:/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}var/lib/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" +} diff --git a/mail-filter/opendkim/opendkim-2.10.3-r12.ebuild b/mail-filter/opendkim/opendkim-2.10.3-r12.ebuild new file mode 100644 index 000000000000..ee5908da59c4 --- /dev/null +++ b/mail-filter/opendkim/opendkim-2.10.3-r12.ebuild @@ -0,0 +1,228 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools db-use eutils systemd tmpfiles user + +DESCRIPTION="A milter providing DKIM signing and verification" +HOMEPAGE="http://opendkim.org/" +SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz" + +# The GPL-2 is for the init script, bug 425960. +LICENSE="BSD GPL-2 Sendmail-Open-Source" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+berkdb ldap libressl lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound" + +DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) + dev-libs/libbsd + sys-apps/grep + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + berkdb? ( >=sys-libs/db-3.2:* ) + opendbx? ( >=dev-db/opendbx-1.4.0 ) + lua? ( dev-lang/lua:* ) + ldap? ( net-nds/openldap ) + lmdb? ( dev-db/lmdb ) + memcached? ( dev-libs/libmemcached ) + sasl? ( dev-libs/cyrus-sasl ) + unbound? ( >=net-dns/unbound-1.4.1:= net-dns/dnssec-root ) + !unbound? ( net-libs/ldns )" + +RDEPEND="${DEPEND} + sys-process/psmisc + selinux? ( sec-policy/selinux-dkim )" + +REQUIRED_USE="sasl? ( ldap )" + +PATCHES=( + "${FILESDIR}/${P}-openrc.patch" + "${FILESDIR}/${P}-openssl-1.1.1.patch.r2" +) + +pkg_setup() { + # This user can read your private keys, and must therefore not be + # shared with any other package. + enewgroup opendkim + enewuser opendkim -1 -1 -1 opendkim +} + +src_prepare() { + default + sed -i -e 's:/var/db/dkim:/var/lib/opendkim:g' \ + opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in || die + sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am || die + # TODO: what purpose does this serve? + sed -i -e "/sock.*mt.getcwd/s:mt.getcwd():${T}:" \ + opendkim/tests/*.lua || die + eautoreconf +} + +src_configure() { + local myconf=() + if use berkdb ; then + myconf+=( + $(db_includedir) + --with-db-incdir=${myconf#-I} + --enable-popauth + --enable-query_cache + --enable-stats + ) + fi + if use unbound; then + myconf+=( --with-unbound ) + else + myconf+=( --with-ldns ) + fi + if use ldap; then + myconf+=( $(use_with sasl) ) + fi + + # We install the our configuration filed under e.g. /etc/opendkim, + # so the next line is necessary to point the daemon and all of its + # documentation to the right location by default. + myconf+=( --sysconfdir="${EPREFIX}/etc/${PN}" ) + + econf \ + $(use_with berkdb db) \ + $(use_with opendbx odbx) \ + $(use_with lua) \ + $(use_enable lua rbl) \ + $(use_with ldap openldap) \ + $(use_with lmdb) \ + $(use_enable poll) \ + $(use_enable static-libs static) \ + $(use_with memcached libmemcached) \ + "${myconf[@]}" \ + --enable-filter \ + --enable-atps \ + --enable-identity_header \ + --enable-rate_limit \ + --enable-resign \ + --enable-replace_rules \ + --enable-default_sender \ + --enable-sender_macro \ + --enable-vbr \ + --disable-live-testing +} + +src_compile() { + emake runstatedir=/run +} + +src_install() { + default + find "${D}" -name '*.la' -type f -delete || die + + dosbin stats/opendkim-reportstats + + newinitd "${S}/contrib/OpenRC/opendkim.openrc" "${PN}" + systemd_newtmpfilesd "${S}/contrib/systemd/opendkim.tmpfiles" "${PN}.conf" + systemd_newunit "contrib/systemd/opendkim.service" "${PN}.service" + + dodir /etc/opendkim + keepdir /var/lib/opendkim + + # The OpenDKIM data (particularly, your keys) should be read-only to + # the UserID that the daemon runs as. + fowners root:opendkim /var/lib/opendkim + fperms 750 /var/lib/opendkim + + # Tweak the "simple" example configuration a bit before installing + # it unconditionally. + local cf="${T}/opendkim.conf" + # Some MTAs are known to break DKIM signatures with "simple" + # canonicalization [1], so we choose the "relaxed" policy + # over OpenDKIM's current default settings. + # [1] https://wordtothewise.com/2016/12/dkim-canonicalization-or-why-microsoft-breaks-your-mail/ + sed -E -e 's:^(Canonicalization)[[:space:]]+.*:\1\trelaxed/relaxed:' \ + "${S}/opendkim/opendkim.conf.simple" >"${cf}" || die + cat >>"${cf}" <<EOT || die + +# The UMask is really only used for the PID file (root:root) and the +# local UNIX socket, if you're using one. It should be 0117 for the +# socket. +UMask 0117 +UserID opendkim + +# For use with unbound +#TrustAnchorFile /etc/dnssec/root-anchors.txt +EOT + insinto /etc/opendkim + doins "${cf}" +} + +pkg_postinst() { + tmpfiles_process "${PN}.conf" + if [[ -z ${REPLACING_VERSION} ]]; then + 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." + + elog "If you are using a local (UNIX) socket, then you will" + elog "need to make sure that your MTA has read/write access" + elog "to the socket file. This is best accomplished by creating" + elog "a completely-new group with only your MTA user and the" + elog "\"opendkim\" user in it. Step-by-step instructions can be" + elog "found on our Wiki, at https://wiki.gentoo.org/wiki/OpenDKIM ." + else + ewarn "The user account for the OpenDKIM daemon has changed" + ewarn "from \"milter\" to \"opendkim\" to prevent unrelated services" + ewarn "from being able to read your private keys. You should" + ewarn "adjust your existing configuration to use the \"opendkim\"" + ewarn "user and group, and change the permissions on" + ewarn "${ROOT}var/lib/opendkim to root:opendkim with mode 0750." + ewarn "The owner and group of the files within that directory" + ewarn "will likely need to be adjusted as well." + fi +} + +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}var/lib/opendkim/${selector}.private" ]]; then + ewarn "The private key for this selector already exists." + else + keysize=1024 + # Generate the private and public keys. Note that opendkim-genkeys + # sets umask=077 on its own to keep these safe. However, we want + # them to be readable (only!) to the opendkim user, and we manage + # that by changing their groups and making everything group-readable. + opendkim-genkey -b ${keysize} -D "${ROOT}"var/lib/opendkim/ \ + -s "${selector}" -d '(your domain)' && \ + chgrp --no-dereference opendkim \ + "${ROOT}var/lib/opendkim/${selector}".{private,txt} || \ + { eerror "Failed to create private and public keys."; return 1; } + chmod g+r "${ROOT}var/lib/opendkim/${selector}".{private,txt} + fi + + # opendkim selector configuration + echo + einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:" + einfo " Keyfile /var/lib/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:/run/opendkim/opendkim.sock" + einfo " non_smtpd_milters = unix:/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}var/lib/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" +} diff --git a/mail-filter/opendkim/opendkim-2.10.3-r3.ebuild b/mail-filter/opendkim/opendkim-2.10.3-r3.ebuild deleted file mode 100644 index 4b39b476cb33..000000000000 --- a/mail-filter/opendkim/opendkim-2.10.3-r3.ebuild +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit autotools db-use eutils systemd user - -# for betas -#MY_P=${P/_b/.B} -#S=${WORKDIR}/${PN}-2.8.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 ~arm x86" -IUSE="+berkdb gnutls ldap libressl lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound" - -DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) - dev-libs/libbsd - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) - ) - berkdb? ( >=sys-libs/db-3.2:* ) - opendbx? ( >=dev-db/opendbx-1.4.0 ) - lua? ( dev-lang/lua:* ) - ldap? ( net-nds/openldap ) - lmdb? ( dev-db/lmdb ) - memcached? ( dev-libs/libmemcached ) - sasl? ( dev-libs/cyrus-sasl ) - unbound? ( >=net-dns/unbound-1.4.1:= net-dns/dnssec-root ) - !unbound? ( net-libs/ldns ) - gnutls? ( >=net-libs/gnutls-3.3 )" - -RDEPEND="${DEPEND} - sys-process/psmisc - selinux? ( sec-policy/selinux-dkim ) -" - -REQUIRED_USE="sasl? ( ldap )" - -PATCHES=( - "${FILESDIR}/${P}-gnutls-3.4.patch" -) - -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() { - default - - 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 /run/opendkim/opendkim.pid:' \ - opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \ - stats/opendkim-reportstats{,.in} || die - - sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \ - || die - - sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua - sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua - - eautoreconf -} - -src_configure() { - local myconf=() - if use berkdb ; then - myconf+=( - $(db_includedir) - --with-db-incdir=${myconf#-I} - --enable-popauth - --enable-query_cache - --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_with lmdb) \ - $(use_enable poll) \ - $(use_enable static-libs static) \ - $(use_with gnutls) \ - $(use_with memcached libmemcached) \ - "${myconf[@]}" \ - --enable-filter \ - --enable-atps \ - --enable-identity_header \ - --enable-rate_limit \ - --enable-resign \ - --enable-replace_rules \ - --enable-default_sender \ - --enable-sender_macro \ - --enable-vbr \ - --disable-live-testing - #--with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S - #--disable-rpath -} - -src_install() { - default - prune_libtool_files - - dosbin stats/opendkim-reportstats - - newinitd "${FILESDIR}/opendkim.init.r3" opendkim - systemd_newunit "${FILESDIR}/opendkim-r1.service" opendkim.service - - 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 TrustAnchorFile /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 -} - -pkg_postinst() { - if [[ -z ${REPLACING_VERSION} ]]; then - 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." - fi -} - -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" -} |