public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/postsrsd] epel10: fix merge
@ 2026-06-14  1:27 David Beveridge
  0 siblings, 0 replies; only message in thread
From: David Beveridge @ 2026-06-14  1:27 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/postsrsd
Branch : epel10
Commit : bcc0e54adb015741da776cd9587175adee42bc01
Author : David Beveridge <dave@bevhost.com>
Date   : 2026-06-07T06:11:52+10:00
Stats  : +91/-57 in 5 file(s)
URL    : https://src.fedoraproject.org/rpms/postsrsd/c/bcc0e54adb015741da776cd9587175adee42bc01?branch=epel10

Log:
fix merge

---
diff --git a/postsrsd.conf b/postsrsd.conf
index 99c67b2..a112c4c 100644
--- a/postsrsd.conf
+++ b/postsrsd.conf
@@ -1,5 +1,5 @@
 # PostSRSd example configuration file
-# Copyright 2022 Timo Röhling
+# Copyright 2022-2023 Timo Röhling
 # SPDX-License-Identifier: FSFUL
 #
 # The copyright holder gives unlimited permission to copy, distribute and modify
@@ -11,17 +11,19 @@
 # Example:
 #     domains = { "example.com", "example.org", "example.net" }
 #
-domains = {}
+#domains = {}
 
 # Local domains (file storage)
 # Instead of listing your local domains directly, you can also write them to a
 # file and have PostSRSd read it. This is particularly useful if you have a
-# large number of domains for which you need to act as mail forwarder.
+# large number of domains for which you need to act as mail forwarder. PostSRSd
+# reads this file before it chroots and drops root privileges. The file format
+# is one domain per line.
 #
 # Example:
 #     domains-file = "/etc/postsrsd.domains"
 #
-#domains-file =
+domains-file = "/etc/postsrsd.domains"
 
 # Dedicated SRS rewrite domain.
 # The local domain which is used to create the ephemeral SRS envelope
@@ -38,7 +40,8 @@ domains = {}
 # Traditionally, PostSRSd interacts with Postfix through the canonicalization
 # lookup tables of the cleanup daemon. If you use a unix socket, be aware that
 # most Postfix instances will jail their cleanup daemon in a /var/spool/postfix
-# chroot, so no other path will be visible to them.
+# chroot, so no other path will be visible to them. Unix sockets are created
+# before PostSRSd chroots and drops root privileges.
 #
 # Examples:
 #     socketmap = unix:/var/spool/postfix/srs
@@ -58,7 +61,8 @@ keep-alive = 30
 
 # Milter endpoint for MTA integration.
 # PostSRSd can act as a milter to rewrite envelope addresses if it has been
-# built with milter support.
+# built with milter support. Unix sockets are created before PostSRSd chroots
+# and drops root privileges.
 #
 # Examples:
 #     milter = unix:/var/spool/postfix/srs_milter
@@ -90,14 +94,14 @@ original-envelope = embedded
 # used. The option is ignored if original-envelope is set to "embedded". Also
 # note that PostSRSd needs to be built with SQLite or Redis support for this.
 #
-# Also note that you need to put the SQLite database into the chroot directory
-# if you jail PostSRSd; otherwise, the database file will not be accessible.
+# PostSRSd reads this database after it chroots and drops root privileges, so
+# the actual filename is the chroot directory joined with this filename.
 #
 # Examples:
+#     envelope-database = "sqlite:./senders.db"
 #     envelope-database = "redis:localhost:6379"
 #
-# Note from the packager:
-#   currently we're using /run to setup the database, but with the above requirement that mean a SQLite database is not possible as /run is not permanent
+#envelope-database = "sqlite:./senders.db"
 
 # Secret keys for signing and verifying SRS addresses.
 # Rewritten addresses are tagged with a truncated HMAC-SHA1 signature, to
@@ -107,7 +111,11 @@ original-envelope = embedded
 # signatures will always be generated with the first configured secret.
 #
 # For security reasons, you should also make sure that the file is owned and
-# only accessible by root (chmod 600).
+# only accessible by root (chmod 600). PostSRSd reads this file before it
+# chroots and drops root privileges.
+#
+# Example:
+#     secrets-file = "/etc/postsrsd.secret"
 #
 secrets-file = "/etc/postsrsd.secret"
 
@@ -149,21 +157,33 @@ hash-minimum = 4
 always-rewrite = off
 
 # Execute PostSRSd as unprivileged user
-# If you set this highly recommended option, PostSRSd will drop root
-# privileges and switch to the configured user before it enters the main loop
-# to handle untrusted input.
+# Drop root privileges and run as this user before entering the main loop and
+# handling untrusted input. To prevent PostSRSd from changing users, set this to
+# the empty string.
+#
+# Example:
+#     unprivileged-user = "nobody"
 #
 unprivileged-user = "nobody"
 
 # Execute PostSRSd in chroot jail
-# If you set this highly recommended option, PostSRSd will jail itself
-# in the given directory, which adds an additional layer of protection
-# against the exploitation of security bugs in PostSRSd.
+# PostSRSd will jail itself in the given directory, which adds an additional
+# layer of protection against the exploitation of security bugs in PostSRSd. To
+# prevent PostSRSd from chrooting, set this to the empty string.
 #
-chroot-dir = "/run/postsrsd"
+# Example:
+#     chroot-dir = "/var/lib/postsrsd"
+#
+chroot-dir = "/var/lib/postsrsd"
 
 # Syslog
 # PostSRSd writes log messages to stderr. If you enable this option, PostSRSd
 # will also send all messages to the syslog mail facility.
 #
 syslog = off
+
+# Debug
+# This option makes PostSRSd more verbose in its logging, which can be useful
+# to hunt down configuration problems.
+#
+debug = off

diff --git a/postsrsd.pp b/postsrsd.pp
new file mode 100644
index 0000000..c4d81dd
Binary files /dev/null and b/postsrsd.pp differ

diff --git a/postsrsd.spec b/postsrsd.spec
index eca3dd7..dd79dcc 100644
--- a/postsrsd.spec
+++ b/postsrsd.spec
@@ -1,31 +1,32 @@
-%global build_options -DGENERATE_SRS_SECRET=OFF -DUSE_SELINUX=ON -DINIT_FLAVOR=systemd
+%global build_options -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DTESTS_WITH_ASAN=OFF
 
 %undefine __cmake_in_source_build
 
 Name:           postsrsd
-Version:        2.0.2
-Release:        7%{?dist}
+Version:        2.0.11
+Release:        1%{?dist}
 Summary:        Sender Rewriting Scheme (SRS) provider
-
-# Automatically converted from old format: GPLv2+ - review is highly recommended.
-License:        GPL-2.0-or-later
+License:        GPL-3.0-only BSD-3-Clause FSFAP FSFUL
 URL:            https://github.com/roehling/postsrsd
 Source0:        https://github.com/roehling/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
-Source1:        postsrsd.conf
+Source1:	postsrsd.conf
+Source2:        postsrsd.pp
 
-BuildRequires: make
+Requires:	libconfuse
+BuildRequires:     make
 BuildRequires:     cmake
 BuildRequires:     gcc
 BuildRequires:     help2man
 BuildRequires:     selinux-policy-devel
 BuildRequires:     libconfuse-devel
+BuildRequires:     check-devel
+BuildRequires:     libasan
 %{?systemd_requires}
 BuildRequires:     systemd
 Requires(post):    policycoreutils
 Requires(preun):   policycoreutils
 Requires(postun):  policycoreutils
 
-
 %description
 PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix.
 SRS is needed if your mail server acts as forwarder.
@@ -33,53 +34,43 @@ SRS is needed if your mail server acts as forwarder.
 
 %prep
 %autosetup -n %{name}-%{version}
-%if (0%{?rhel} && 0%{?rhel} < 8)
-mkdir build
-cd build && %cmake .. %build_options
-%else
 %cmake %build_options
-%endif
 
 
 %build
-%if (0%{?rhel} && 0%{?rhel} < 8)
-%make_build -C build
-%else
 %cmake_build
-%endif
-
+%ctest
 
 %install
-%if (0%{?rhel} && 0%{?rhel} < 8)
-%make_install -C build
-%else
 %cmake_install
-%endif
+
+install -m 644 README.rst CHANGELOG.rst %{buildroot}/%{_docdir}/%{name}/
 
 # %%ghost file requires it is present in the build root
 touch %{buildroot}/%{_sysconfdir}/postsrsd.secret
 
-# proper location for systemd config
-mkdir -p %{buildroot}/%{_unitdir}
-mv %{buildroot}/%{_sysconfdir}/systemd/system/postsrsd.service %{buildroot}/%{_unitdir}/postsrsd.service
-rm -rf %{buildroot}/%{_sysconfdir}/systemd
+# config file can work without modification
+cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/postsrsd.conf
 
-# default configuration and chroot directory
-cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/
-sed -ri -e "s/(\[Install\])/RuntimeDirectory=postsrsd\nRuntimeDirectoryMode=0750\n\n\1/" %{buildroot}/%{_unitdir}/postsrsd.service
+# user nobody already exists
+rm -f %{buildroot}/%{_sysusersdir}/postsrsd.conf
 
+# Runtime Directory
+mkdir -p %{buildroot}/%{_sharedstatedir}/%{name}
+
+# selinux policy
+mkdir -p %{buildroot}/%{_datadir}/selinux/packages/%{name}
+cp %{SOURCE2} %{buildroot}/%{_datadir}/selinux/packages/%{name}/postsrsd.pp
 
 %files
-%license LICENSE
+%license LICENSES/*
 %ghost %{_sysconfdir}/postsrsd.secret
 %config(noreplace) %{_sysconfdir}/postsrsd.conf
 %{_unitdir}/postsrsd.service
 %{_sbindir}/postsrsd
-%{_docdir}/%{name}
-%{_mandir}/man8/postsrsd.8.gz
+%doc %{_docdir}/%{name}
+%{_sharedstatedir}/%{name}
 %{_datadir}/selinux/packages/%{name}/postsrsd.pp
-%{_datadir}/postsrsd/postsrsd-systemd-launcher
-
 
 %post
 if [ "$1" -le "1" ] ; then  # first install
@@ -90,6 +81,11 @@ fi
 # the admin may modify / restore from a backup, so better restore SELinux permissions unconditionally
 restorecon %{_sysconfdir}/postsrsd.secret
 %systemd_post %{name}.service
+# default value of local domain that will not be rewritten by srs and serve as the default domain to write other domains to.
+if [ ! -f /etc/postsrsd.domains ]; then
+hostname > /etc/postsrsd.domains
+chmod 640 /etc/postsrsd.domains
+fi
 
 
 %preun
@@ -110,8 +106,8 @@ fi
 
 
 %changelog
-* Fri Jul 26 2024 Miroslav Suchý <msuchy@redhat.com> - 2.0.2-7
-- convert license to SPDX
+* Sun Jun 07 2026 David Beveridge <dave@bevhost.com> - 2.0.11-1
+- First working 2.x release
 
 * Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

diff --git a/postsrsd.te b/postsrsd.te
new file mode 100644
index 0000000..3b982b4
--- /dev/null
+++ b/postsrsd.te
@@ -0,0 +1,16 @@
+
+module postsrsd 1.0;
+
+require {
+	type postfix_spool_t;
+	type postfix_cleanup_t;
+	type unconfined_service_t;
+	class unix_stream_socket connectto;
+	class sock_file write;
+}
+
+#============= postfix_cleanup_t ==============
+
+#!!!! This avc is allowed in the current policy
+allow postfix_cleanup_t postfix_spool_t:sock_file write;
+allow postfix_cleanup_t unconfined_service_t:unix_stream_socket connectto;

diff --git a/sources b/sources
index a2d7c90..cfb3015 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (postsrsd-2.0.2.tar.gz) = 27d06ab56541ea5d452300c57dd450c47f2ad721641f29b6e79139f8fc335e1ad67338c9966dde332757c4d5e1c8be5273a972d48a231c2eaa47f0d2bd3dfac0
+SHA512 (postsrsd-2.0.11.tar.gz) = d85be04decfcf38ac2aaa3435f804106faf37bd51914184f91ff2f130ff39ce4e1b73e9d0748dc57c940bdbc917dddcd25fc8777fcba65e864a1c6f0066c3995

diff --git a/postsrsd.spec b/postsrsd.spec
index ad4f97d..dd79dcc 100644
--- a/postsrsd.spec
+++ b/postsrsd.spec
@@ -6,7 +6,6 @@ Name:           postsrsd
 Version:        2.0.11
 Release:        1%{?dist}
 Summary:        Sender Rewriting Scheme (SRS) provider
-
 License:        GPL-3.0-only BSD-3-Clause FSFAP FSFUL
 URL:            https://github.com/roehling/postsrsd
 Source0:        https://github.com/roehling/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@@ -110,6 +109,9 @@ fi
 * Sun Jun 07 2026 David Beveridge <dave@bevhost.com> - 2.0.11-1
 - First working 2.x release
 
+* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
+
 * Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-14  1:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-14  1:27 [rpms/postsrsd] epel10: fix merge David Beveridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox