commit: f9c49c0666eb8941caa3c5bc70bde931d6512388 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Apr 12 18:29:42 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Apr 12 20:12:18 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9c49c06
mail-filter/postsrsd: add 2.0.11 Closes: https://bugs.gentoo.org/951885 Signed-off-by: Sam James <sam <AT> gentoo.org> mail-filter/postsrsd/Manifest | 1 + .../postsrsd/files/postsrsd-2.0.11-docdir.patch | 13 +++++ mail-filter/postsrsd/files/postsrsd.confd | 62 ++++++++++++++++++++++ mail-filter/postsrsd/postsrsd-2.0.11.ebuild | 61 +++++++++++++++++++++ 4 files changed, 137 insertions(+) diff --git a/mail-filter/postsrsd/Manifest b/mail-filter/postsrsd/Manifest index 80dd3901dc52..41d9aa90a052 100644 --- a/mail-filter/postsrsd/Manifest +++ b/mail-filter/postsrsd/Manifest @@ -1 +1,2 @@ DIST postsrsd-1.12.tar.gz 36860 BLAKE2B 9f760e010c791d993df83d1f55bd02f2f42fe336e4aef9aae87e62aab2ef86354d99ff1b9be2b2a24d33006fe0461887224dad11a03139e7ce24ab23a775d3ad SHA512 9b83d89f8ac26ba0477998c495b0566295e16ae62a661a9edaef430cbc2eea592fe178b3686d0ad0578a808d13c13d526ac44a2360fd6e715d701887086fa51a +DIST postsrsd-2.0.11.tar.gz 64995 BLAKE2B 5958dd3d45ad2181fb46b6bd086b95e6f952309dccacb889fd704994d822ce01f3487e2b8dfa19f7a8627ede58f8f619ae891da053d053cbc4b3a362759a23fe SHA512 d85be04decfcf38ac2aaa3435f804106faf37bd51914184f91ff2f130ff39ce4e1b73e9d0748dc57c940bdbc917dddcd25fc8777fcba65e864a1c6f0066c3995 diff --git a/mail-filter/postsrsd/files/postsrsd-2.0.11-docdir.patch b/mail-filter/postsrsd/files/postsrsd-2.0.11-docdir.patch new file mode 100644 index 000000000000..4640cdd1dfbe --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd-2.0.11-docdir.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 218ae66..c319dce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -362,7 +362,7 @@ configure_file( + + install(TARGETS postsrsd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.conf" +- DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME}" ++ DESTINATION "${CMAKE_INSTALL_DOCDIR}" + ) + if(INSTALL_SYSTEMD_SERVICE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.service" diff --git a/mail-filter/postsrsd/files/postsrsd.confd b/mail-filter/postsrsd/files/postsrsd.confd new file mode 100644 index 000000000000..121fba8a63e9 --- /dev/null +++ b/mail-filter/postsrsd/files/postsrsd.confd @@ -0,0 +1,62 @@ +# Default settings for PostSRSd + +# Local domain name. +# Addresses are rewritten to originate from this domain. The default value +# is taken from `postconf -h mydomain` and probably okay. +# +#SRS_DOMAIN=example.com + +# Exclude additional domains. +# You may list domains which shall not be subjected to address rewriting. +# If a domain name starts with a dot, it matches all subdomains, but not +# the domain itself. Separate multiple domains by space or comma. +# +#SRS_EXCLUDE_DOMAINS=.example.com,example.org + +# First separator character after SRS0 or SRS1. +# Can be one of: -+= +SRS_SEPARATOR== + +# Secret key to sign rewritten addresses. +# When postsrsd is installed for the first time, a random secret is generated +# and stored in /etc/postsrsd.secret. For most installations, that's just fine. +# +SRS_SECRET=/etc/postsrsd.secret + +# Length of hash to be used in rewritten addresses +SRS_HASHLENGTH=4 + +# Minimum length of hash to accept when validating return addresses. +# When increasing SRS_HASHLENGTH, set this to its previous value and +# wait for the duration of SRS return address validity (21 days) before +# increading this value as well. +SRS_HASHMIN=4 + +# Local ports for TCP list. +# These ports are used to bind the TCP list for postfix. If you change +# these, you have to modify the postfix settings accordingly. The ports +# are bound to the loopback interface, and should never be exposed on +# the internet. +# +SRS_FORWARD_PORT=10001 +SRS_REVERSE_PORT=10002 + +# Drop root privileges and run as another user after initialization. +# This is highly recommended as postsrsd handles untrusted input. +# +RUN_AS=nobody + +# Bind to this address +# +SRS_LISTEN_ADDR=127.0.0.1 + +# Jail daemon in chroot environment +# +CHROOT=/var/lib/postsrsd + +# Additional Options +# PostSRSd understands a few rarely needed extra options: +# -A always rewrite email addresses, even from SRS_DOMAIN +# -t<n> set connection timeout to <n> seconds (default: 1800) +# +#SRS_EXTRA_OPTIONS=-A diff --git a/mail-filter/postsrsd/postsrsd-2.0.11.ebuild b/mail-filter/postsrsd/postsrsd-2.0.11.ebuild new file mode 100644 index 000000000000..7e751da2513a --- /dev/null +++ b/mail-filter/postsrsd/postsrsd-2.0.11.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake systemd + +DESCRIPTION="Postfix Sender Rewriting Scheme daemon" +HOMEPAGE="https://github.com/roehling/postsrsd" +SRC_URI="https://github.com/roehling/postsrsd/archive/${PV}.tar.gz -> ${P}.tar.gz" + +# See REUSE.toml; GPL-3 for the main software, BSD for src/sha*. +LICENSE="GPL-3 BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-libs/confuse:=" +DEPEND=" + ${RDEPEND} + test? ( + dev-libs/check + ) +" + +CHROOT_DIR="${EPREFIX}/var/lib/postsrsd" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.11-docdir.patch +) + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTING=$(usex test) + + -DPOSTSRSD_CHROOTDIR="${CHROOT_DIR}" + -DSYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" + + -DINSTALL_SYSTEMD_SERVICE=ON + # https://github.com/roehling/postsrsd/blob/main/doc/packaging.rst#third-party-dependencies + -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS + # We don't want to run tests with sanitizers. They're + # unreliable under sandbox and don't run on all platforms + -DTESTS_WITH_ASAN=OFF + + -DWITH_MILTER=OFF + -DWITH_SQLITE=OFF + -DWITH_REDIS=OFF + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + newinitd "${FILESDIR}"/postsrsd.init-r2 postsrsd + newconfd "${FILESDIR}"/postsrsd.confd postsrsd + keepdir "${CHROOT_DIR}" +}
