commit postsrsd for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package postsrsd for openSUSE:Factory checked in at 2024-07-25 15:38:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/postsrsd (Old) and /work/SRC/openSUSE:Factory/.postsrsd.new.1882 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "postsrsd" Thu Jul 25 15:38:38 2024 rev:14 rq:1189262 version:2.0.10 Changes: -------- --- /work/SRC/openSUSE:Factory/postsrsd/postsrsd.changes 2024-04-15 20:24:06.097086737 +0200 +++ /work/SRC/openSUSE:Factory/.postsrsd.new.1882/postsrsd.changes 2024-07-25 15:54:17.239582427 +0200 @@ -1,0 +2,6 @@ +Tue Jul 23 12:31:27 UTC 2024 - Jan Engelhardt <jengelh@inai.de> + +- Update to release 2.0.10 + * Allow comments in domains-file + +------------------------------------------------------------------- Old: ---- 2.0.9.tar.gz New: ---- 2.0.10.tar.gz _scmsync.obsinfo build.specials.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ postsrsd.spec ++++++ --- /var/tmp/diff_new_pack.hbPocB/_old 2024-07-25 15:54:17.763603498 +0200 +++ /var/tmp/diff_new_pack.hbPocB/_new 2024-07-25 15:54:17.767603659 +0200 @@ -17,7 +17,7 @@ Name: postsrsd -Version: 2.0.9 +Version: 2.0.10 Release: 0 Summary: Sender Rewriting Support for postfix License: GPL-2.0-only ++++++ 2.0.9.tar.gz -> 2.0.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/.github/workflows/ci.yml new/postsrsd-2.0.10/.github/workflows/ci.yml --- old/postsrsd-2.0.9/.github/workflows/ci.yml 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/.github/workflows/ci.yml 2024-07-23 10:26:27.000000000 +0200 @@ -15,24 +15,25 @@ - main jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - milter: [OFF, ON] - sqlite: [OFF, ON] - redis: [OFF, ON] + milter: [MILTER=OFF, MILTER=ON] + sqlite: [SQLITE=OFF, SQLITE=ON] + redis: [REDIS=OFF, REDIS=ON] + deps: [vendored-deps, system-deps] steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update -qq - sudo apt-get install -y cmake postfix redis + sudo apt-get install -y cmake postfix redis ${{ matrix.deps == 'system-deps' && 'check libconfuse-dev libhiredis-dev libmilter-dev libsqlite3-dev' || '' }} - name: Build PostSRSd run: | mkdir _build cd _build - cmake .. -DDEVELOPER_BUILD=ON -DWITH_MILTER=${{ matrix.milter }} -DWITH_SQLITE=${{ matrix.sqlite }} -DWITH_REDIS=${{ matrix.redis }} - make VERBOSE=ON + cmake .. -DDEVELOPER_BUILD=ON -DWITH_${{ matrix.milter }} -DWITH_${{ matrix.sqlite }} -DWITH_${{ matrix.redis }} ${{ matrix.deps == 'system-deps' && '-DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS' || '' }} + cmake --build . --verbose - name: Run tests run: | cd _build @@ -50,21 +51,3 @@ run: | postmap -q test@otherdomain.com socketmap:unix:/var/spool/postfix/srs:forward | tee /tmp/srs-alias.txt postmap -q "$(cat /tmp/srs-alias.txt)" socketmap:unix:/var/spool/postfix/srs:reverse - packaging: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -y check cmake libconfuse-dev libhiredis-dev libsqlite3-dev redis - - name: Build PostSRSd - run: | - mkdir _build - cd _build - cmake .. -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS -DWITH_SQLITE=ON -DWITH_REDIS=ON - make VERBOSE=ON - - name: Run tests - run: | - cd _build - ctest --output-on-failure diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/.pre-commit-config.yaml new/postsrsd-2.0.10/.pre-commit-config.yaml --- old/postsrsd-2.0.9/.pre-commit-config.yaml 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/.pre-commit-config.yaml 2024-07-23 10:26:27.000000000 +0200 @@ -2,18 +2,18 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.6 + rev: v18.1.6 hooks: - id: clang-format - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/cheshirekow/cmake-format-precommit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/CHANGELOG.rst new/postsrsd-2.0.10/CHANGELOG.rst --- old/postsrsd-2.0.9/CHANGELOG.rst 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/CHANGELOG.rst 2024-07-23 10:26:27.000000000 +0200 @@ -7,6 +7,20 @@ Changelog ######### +2.0.10 +====== + +Changed +------- + +* Allow comments in domains-file + (`#181 <https://github.com/roehling/postsrsd/issues/181>`_) + +Added +----- + +* Support for building against system libmilter library + 2.0.9 ===== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/CMakeLists.txt new/postsrsd-2.0.10/CMakeLists.txt --- old/postsrsd-2.0.9/CMakeLists.txt 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/CMakeLists.txt 2024-07-23 10:26:27.000000000 +0200 @@ -14,10 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # -cmake_minimum_required(VERSION 3.14...3.28) +cmake_minimum_required(VERSION 3.14...3.29) project( postsrsd - VERSION 2.0.9 + VERSION 2.0.10 LANGUAGES C DESCRIPTION "Sender Rewriting Scheme daemon for Postfix" HOMEPAGE_URL "https://github.com/roehling/postsrsd" @@ -141,7 +141,7 @@ FetchContent_Declare( LibMilter GIT_REPOSITORY https://github.com/jons/libmilter - GIT_TAG f3b7aa0336be0d0fdbca25b97e1e7fcb46e3f333 + GIT_TAG 98d481b0fd3ba1e2ca420c7c43fcc50afdae879f ) FetchContent_Declare( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/data/postsrsd.conf.in new/postsrsd-2.0.10/data/postsrsd.conf.in --- old/postsrsd-2.0.9/data/postsrsd.conf.in 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/data/postsrsd.conf.in 2024-07-23 10:26:27.000000000 +0200 @@ -17,7 +17,8 @@ # 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. PostSRSd -# reads this file before it chroots and drops root privileges. +# reads this file before it chroots and drops root privileges. The file format +# is one domain per line. # # Example: # domains-file = "@POSTSRSD_CONFIGDIR@/@PROJECT_NAME@.domains" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/doc/postsrsd.conf new/postsrsd-2.0.10/doc/postsrsd.conf --- old/postsrsd-2.0.9/doc/postsrsd.conf 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/doc/postsrsd.conf 2024-07-23 10:26:27.000000000 +0200 @@ -17,7 +17,8 @@ # 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. PostSRSd -# reads this file before it chroots and drops root privileges. +# reads this file before it chroots and drops root privileges. The file format +# is one domain per line. # # Example: # domains-file = "/usr/local/etc/postsrsd.domains" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/src/config.c new/postsrsd-2.0.10/src/config.c --- old/postsrsd-2.0.9/src/config.c 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/src/config.c 2024-07-23 10:26:27.000000000 +0200 @@ -142,7 +142,7 @@ ); } -cfg_t* config_from_commandline(int argc, char* const* argv) +cfg_t* config_defaults() { static cfg_opt_t opts[] = { CFG_STR("srs-domain", NULL, CFGF_NODEFAULT), @@ -172,6 +172,12 @@ cfg_set_validate_func(cfg, "srs-domain", validate_domain_names); cfg_set_validate_func(cfg, "domains", validate_domain_names); cfg_set_validate_func(cfg, "keep-alive", validate_uint); + return cfg; +} + +cfg_t* config_from_commandline(int argc, char* const* argv) +{ + cfg_t* cfg = config_defaults(); int opt; char* config_file = NULL; char* pid_file = NULL; @@ -340,24 +346,34 @@ if (f) { char buffer[1024]; + char* end; while ((domain = fgets(buffer, sizeof(buffer), f)) != NULL) { domain = strtok(domain, "\r\n"); - if (domain && domain[0]) + if (domain == NULL) + continue; + while (isspace(domain[0])) + ++domain; + end = strchr(domain, '#'); + if (end != NULL) + *end = 0; + end = domain + strlen(domain); + while (end != domain && isspace(*(end - 1))) + *--end = 0; + if (domain[0] == 0) + continue; + if (is_valid_domain_name(domain)) + { + domain_set_add(*local_domains, domain); + if (*srs_domain == NULL) + *srs_domain = + strdup(domain[0] == '.' ? domain + 1 : domain); + } + else { - if (is_valid_domain_name(domain)) - { - domain_set_add(*local_domains, domain); - if (*srs_domain == NULL) - *srs_domain = - strdup(domain[0] == '.' ? domain + 1 : domain); - } - else - { - log_error("invalid domain name '%s' in domains file", - domain); - goto fail; - } + log_error("invalid domain name '%s' in domains file", + domain); + goto fail; } } fclose(f); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/src/config.h new/postsrsd-2.0.10/src/config.h --- old/postsrsd-2.0.9/src/config.h 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/src/config.h 2024-07-23 10:26:27.000000000 +0200 @@ -25,6 +25,7 @@ #include <confuse.h> +cfg_t* config_defaults(); cfg_t* config_from_commandline(int argc, char* const* argv); srs_t* srs_from_config(cfg_t* cfg); bool srs_domains_from_config(cfg_t* cfg, char** srs_domain, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/src/milter.c new/postsrsd-2.0.10/src/milter.c --- old/postsrsd-2.0.9/src/milter.c 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/src/milter.c 2024-07-23 10:26:27.000000000 +0200 @@ -292,7 +292,7 @@ g_srs = srs; g_srs_domain = srs_domain; g_local_domains = local_domains; - smfi_main(NULL); + smfi_main(); if (milter_path != NULL && milter_lock > 0) { release_lock(milter_path, milter_lock); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/tests/unit/CMakeLists.txt new/postsrsd-2.0.10/tests/unit/CMakeLists.txt --- old/postsrsd-2.0.9/tests/unit/CMakeLists.txt 2024-04-14 23:42:09.000000000 +0200 +++ new/postsrsd-2.0.10/tests/unit/CMakeLists.txt 2024-07-23 10:26:27.000000000 +0200 @@ -46,3 +46,8 @@ $<$<BOOL:${WITH_REDIS}>:${HIREDIS_TARGET}> ) add_postsrsd_test(test_srs2 ${SRCDIR}/srs2.c ${SRCDIR}/sha1.c) +add_postsrsd_test( + test_config ${SRCDIR}/config.c ${SRCDIR}/sha1.c ${SRCDIR}/srs2.c + ${SRCDIR}/util.c +) +target_link_libraries(test_config_executable PRIVATE Confuse::Confuse) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/postsrsd-2.0.9/tests/unit/test_config.c new/postsrsd-2.0.10/tests/unit/test_config.c --- old/postsrsd-2.0.9/tests/unit/test_config.c 1970-01-01 01:00:00.000000000 +0100 +++ new/postsrsd-2.0.10/tests/unit/test_config.c 2024-07-23 10:26:27.000000000 +0200 @@ -0,0 +1,76 @@ +/* PostSRSd - Sender Rewriting Scheme daemon for Postfix + * Copyright 2012-2024 Timo Röhling <timo@gaussglocke.de> + * SPDX-License-Identifier: GPL-3.0-only + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "common.h" +#include "config.h" + +#include <check.h> +#include <stdlib.h> +#include <unistd.h> + +static char pwd[500]; +static char tmpdir[sizeof(pwd) + 7]; + +void setup_fs() +{ + ck_assert_ptr_nonnull(getcwd(pwd, sizeof(pwd))); + strcpy(tmpdir, pwd); + strcat(tmpdir, "/XXXXXX"); + ck_assert_ptr_eq(mkdtemp(tmpdir), tmpdir); + ck_assert_int_eq(chdir(tmpdir), 0); +} + +void teardown_fs() +{ + ck_assert_int_eq(chdir(pwd), 0); + ck_assert_int_eq(rmdir(tmpdir), 0); +} + +START_TEST(config_domains_file) +{ + FILE* f = fopen("domains.txt", "w"); + fprintf(f, + "# This is a comment at the beginning of the file\n" + "example.com\n" + " # This is a comment with preceding white space\n" + "\t tabspace.org\n" + "\n" + "commented.de # This is a comment after a domain name\n" + "trailing.net "); + fclose(f); + cfg_t* cfg = config_defaults(); + cfg_setstr(cfg, "domains-file", "domains.txt"); + + domain_set_t* D = NULL; + char* srs_domain = NULL; + ck_assert_int_eq(srs_domains_from_config(cfg, &srs_domain, &D), true); + ck_assert_int_eq(domain_set_contains(D, "commented.de"), true); + ck_assert_int_eq(domain_set_contains(D, "example.com"), true); + ck_assert_int_eq(domain_set_contains(D, "tabspace.org"), true); + ck_assert_int_eq(domain_set_contains(D, "trailing.net"), true); + ck_assert_str_eq(srs_domain, "example.com"); + ck_assert_int_eq(unlink("domains.txt"), 0); + domain_set_destroy(D); + free(srs_domain); + cfg_free(cfg); +} +END_TEST + +BEGIN_TEST_SUITE(config) +ADD_TEST_CASE_WITH_UNCHECKED_FIXTURE(fs, setup_fs, teardown_fs) +ADD_TEST_TO_TEST_CASE(fs, config_domains_file) +END_TEST_SUITE() +TEST_MAIN(config) ++++++ _scmsync.obsinfo ++++++ mtime: 1721738060 commit: a3b87fcb4db08cca33ec75f72c9e6041e4edecb0e8c01ebfadd7bd19aebb703e url: https://src.opensuse.org/jengelh/postsrsd revision: master
participants (1)
-
Source-Sync