summaryrefslogtreecommitdiff
path: root/mail-filter/opendkim
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-04 12:02:00 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-04 12:02:00 +0100
commiteab5731cdf11d4ae8cdf111461d46fd96c5bdd37 (patch)
treece35c6d01b5ff5de95c3a20fef853b9a6518ad2e /mail-filter/opendkim
parentb7ebc951da8800f711142f69d9d958bde67a112d (diff)
gentoo resync : 04.05.2019
Diffstat (limited to 'mail-filter/opendkim')
-rw-r--r--mail-filter/opendkim/Manifest4
-rw-r--r--mail-filter/opendkim/opendkim-2.10.3-r10.ebuild227
-rw-r--r--mail-filter/opendkim/opendkim-2.10.3-r13.ebuild (renamed from mail-filter/opendkim/opendkim-2.10.3-r12.ebuild)24
-rw-r--r--mail-filter/opendkim/opendkim-2.10.3-r9.ebuild229
4 files changed, 15 insertions, 469 deletions
diff --git a/mail-filter/opendkim/Manifest b/mail-filter/opendkim/Manifest
index 334b1189f0dc..c1aee006234b 100644
--- a/mail-filter/opendkim/Manifest
+++ b/mail-filter/opendkim/Manifest
@@ -10,8 +10,6 @@ AUX opendkim.service 439 BLAKE2B 203f8d5a55f9f08069eec0bac8b9af743e3c0414a927c47
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-r10.ebuild 7426 BLAKE2B a41072224c47d95fb7bd01d659df5ef3ccd2b65dcff22cc3f71b061310d936f26085f72e57a9c0142799817cf0d3f6504f9121ae3104822ac8c6e5c2cc9c96eb SHA512 d6b0f2dc00afb6caebb1dedf6a2bef12168eee05e9ae030bc32ef19634a2e17d687827f75ed6328a0064b80ca3b3e24df9fada28f9530a514f0c39ade8c3548f
-EBUILD opendkim-2.10.3-r12.ebuild 7399 BLAKE2B bf56fff18ddf7d4f931906e00df4c2b39d9447eb42c38624f6010b3da816bd2a9c6f25f9019fe667fd17aed86a84b3c518c591bb92e0389b6557ba99e5864540 SHA512 483f07a5fa2373b57d819e0401cc7d3171417e8eb373d0098ca4cd3883db8a02d0900d243f90a7509034596b0cc8fd68f66994267ea248fa9a752fbbe894e1ff
+EBUILD opendkim-2.10.3-r13.ebuild 7406 BLAKE2B faf1df82130ec9edeaff68c11b5dc2619b206af3001d5142083189c58bb6e73cac66785cc0ed983a0ddb194dd0a9cfb211e5f19ea3fb4333e35254fad4756161 SHA512 cd67d66da191109f40089bcbc0c9d959ce762003d1d773febb30bb3ee44f5e211eb2637cc40481d742a5ebfd626a0bf61a1a5f60ee87985bdce2cab00048b9fc
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/opendkim-2.10.3-r10.ebuild b/mail-filter/opendkim/opendkim-2.10.3-r10.ebuild
deleted file mode 100644
index 8cba8ef61703..000000000000
--- a/mail-filter/opendkim/opendkim-2.10.3-r10.ebuild
+++ /dev/null
@@ -1,227 +0,0 @@
-# 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-r13.ebuild
index ee5908da59c4..037a1b0f98cd 100644
--- a/mail-filter/opendkim/opendkim-2.10.3-r12.ebuild
+++ b/mail-filter/opendkim/opendkim-2.10.3-r13.ebuild
@@ -13,9 +13,9 @@ SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
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"
+IUSE="+berkdb ldap libressl lmdb lua memcached opendbx poll sasl selinux +ssl static-libs test unbound"
-DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+COMMON_DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
dev-libs/libbsd
sys-apps/grep
ssl? (
@@ -32,7 +32,10 @@ DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
unbound? ( >=net-dns/unbound-1.4.1:= net-dns/dnssec-root )
!unbound? ( net-libs/ldns )"
-RDEPEND="${DEPEND}
+DEPEND="${COMMON_DEPEND}
+ test? ( dev-lang/lua:* )"
+
+RDEPEND="${COMMON_DEPEND}
sys-process/psmisc
selinux? ( sec-policy/selinux-dkim )"
@@ -52,12 +55,12 @@ pkg_setup() {
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
+ sed -e 's:/var/db/dkim:/var/lib/opendkim:g' \
+ -i opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ || die
+ sed -e 's:dist_doc_DATA:dist_html_DATA:' \
+ -i libopendkim/docs/Makefile.am \
+ || die
eautoreconf
}
@@ -106,7 +109,8 @@ src_configure() {
--enable-default_sender \
--enable-sender_macro \
--enable-vbr \
- --disable-live-testing
+ --disable-live-testing \
+ --with-test-socket="${T}/opendkim.sock"
}
src_compile() {
diff --git a/mail-filter/opendkim/opendkim-2.10.3-r9.ebuild b/mail-filter/opendkim/opendkim-2.10.3-r9.ebuild
deleted file mode 100644
index 9a9ff14612ae..000000000000
--- a/mail-filter/opendkim/opendkim-2.10.3-r9.ebuild
+++ /dev/null
@@ -1,229 +0,0 @@
-# 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 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"
- "${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.
- enewuser 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 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
-}
-
-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"
-}