14
0
2025-06-10 09:06:16 +00:00
committed by Git OBS Bridge
commit 1fa2f20d42
7 changed files with 245 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,65 @@
From 1ead9028fc63ae3ec6ea3b0c438e6ed088a2b20e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?=
<jaime.marquinez.ferrandiz@fastmail.net>
Date: Tue, 5 Mar 2024 19:14:30 +0100
Subject: [PATCH] Remove calls to the deprecated method "assertEquals"
Reference: https://github.com/sdgathman/pymilter/pull/57
It has been removed in python 3.12
---
testsample.py | 6 +++---
testutils.py | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/testsample.py b/testsample.py
index 100d1a6..70222bf 100644
--- a/testsample.py
+++ b/testsample.py
@@ -31,7 +31,7 @@ class BMSMilterTestCase(unittest.TestCase):
count = 10
while count > 0:
rc = ctx._connect(helo='milter-template.example.org')
- self.assertEquals(rc,Milter.CONTINUE)
+ self.assertEqual(rc,Milter.CONTINUE)
with open('test/'+fname,'rb') as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
@@ -46,7 +46,7 @@ class BMSMilterTestCase(unittest.TestCase):
ctx._setsymval('{auth_type}','batcomputer')
ctx._setsymval('j','mailhost')
rc = ctx._connect()
- self.assertEquals(rc,Milter.CONTINUE)
+ self.assertEqual(rc,Milter.CONTINUE)
with open('test/'+fname,'rb') as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
@@ -69,7 +69,7 @@ class BMSMilterTestCase(unittest.TestCase):
milter = ctx.getpriv()
# self.assertTrue(milter.user == 'batman',"getsymval failed: "+
# "%s != %s"%(milter.user,'batman'))
- self.assertEquals(milter.user,'batman')
+ self.assertEqual(milter.user,'batman')
self.assertTrue(milter.auth_type != 'batcomputer',"setsymlist failed")
self.assertTrue(rc == Milter.ACCEPT)
self.assertTrue(ctx._bodyreplaced,"Message body not replaced")
diff --git a/testutils.py b/testutils.py
index 56ec161..93e078c 100644
--- a/testutils.py
+++ b/testutils.py
@@ -24,11 +24,11 @@ class AddrCacheTestCase(unittest.TestCase):
self.assertTrue(cache.has_key('foo@bar.com'))
self.assertTrue(not cache.has_key('hello@bar.com'))
self.assertTrue('baz@bar.com' in cache)
- self.assertEquals(cache['temp@bar.com'],'testing')
+ self.assertEqual(cache['temp@bar.com'],'testing')
s = open(self.fname).readlines()
self.assertTrue(len(s) == 2)
self.assertTrue(s[0].startswith('foo@bar.com '))
- self.assertEquals(s[1].strip(),'baz@bar.com')
+ self.assertEqual(s[1].strip(),'baz@bar.com')
# check that new result overrides old
cache['temp@bar.com'] = None
self.assertTrue(not cache['temp@bar.com'])
--
2.44.0

3
pymilter-1.0.5.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8093032829ddd53261dbe2991959514156767f3785dfb095ed9b17f3fba965e1
size 1030610

53
python-pymilter.changes Normal file
View File

@@ -0,0 +1,53 @@
-------------------------------------------------------------------
Tue Jun 10 09:04:00 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Tue Mar 5 18:22:42 UTC 2024 - Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
- Actually run the correct tests
- Fix the fdupes call
- Add 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch
-------------------------------------------------------------------
Sat Jan 7 23:24:10 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.0.5:
* fix deprecation warnings
-------------------------------------------------------------------
Sat Feb 13 00:04:30 UTC 2021 - Neal Gompa <ngompa13@gmail.com>
- Fix dependency on py3dns so that flavor builds generate correctly
-------------------------------------------------------------------
Fri Feb 12 13:10:10 UTC 2021 - Markéta Machová <mmachova@suse.com>
- Drop py{2.3}-only parts as py2 is skipped
-------------------------------------------------------------------
Wed Dec 11 08:19:51 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Require full python for sqlite module
-------------------------------------------------------------------
Thu Apr 25 08:37:53 UTC 2019 - pgajdos@suse.com
- version update to 1.0.4
- cleanup unused files, additional platform support
- Minor doc updates
- patch step for python3 no longer required in build
- turn the test suite on
- deleted patches
- pymilter-dns_dsn.patch (upstreamed)
-------------------------------------------------------------------
Thu Sep 6 12:54:13 UTC 2018 - Jan Engelhardt <jengelh@inai.de>
- Fix grammar issues in description. Fix RPM group.
-------------------------------------------------------------------
Thu Sep 6 02:33:45 UTC 2018 - Neal Gompa <ngompa13@gmail.com>
- Initial packaging

99
python-pymilter.spec Normal file
View File

@@ -0,0 +1,99 @@
#
# spec file for package python-pymilter
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2018 Neal Gompa <ngompa13@gmail.com>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# we don't want to provide private python extension libs
%global __provides_exclude_from ^(%{python2_sitearch}/.*\\.so|%{python3_sitearch}/.*\\.so)$
# Python 2 module isn't building properly and we don't really need it right now anyway...
Name: python-pymilter
Version: 1.0.5
Release: 0
Summary: Python interface to the sendmail milter API
License: GPL-2.0-or-later
URL: https://www.bmsi.com/python/milter.html
Source0: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz
Source1: tmpfiles-python-pymilter.conf
# PATCH-FIX-UPSTREAM: https://github.com/sdgathman/pymilter/pull/57
Patch1: 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch
BuildRequires: %{python_module bsddb3}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: sendmail-devel >= 8.13
BuildRequires: systemd-rpm-macros
# Common subpackage named as such to avoid creating flavor packages
Requires: pymilter-common = %{version}-%{release}
Requires: python
Requires: python-bsddb3
Requires: python-py3dns
%python_subpackages
%description
This is a Python extension module to enable python scripts to attach to
sendmail's libmilter functionality. Additional Python modules provide for
navigation and modification of MIME parts, sending DSNs, and doing CBV.
%package -n pymilter-common
Summary: Common files for pymilter
Requires(post): systemd
BuildArch: noarch
%description -n pymilter-common
This package contains the common files used for pymilter.
%prep
%autosetup -n pymilter-pymilter-%{version} -p1
%build
%pyproject_wheel
%install
%pyproject_install
mkdir -p %{buildroot}%{_localstatedir}/log/milter
mkdir -p %{buildroot}%{_libexecdir}/milter
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
%python_expand %fdupes %{buildroot}/%{$python_sitearch}
%check
# remove tests that don't work
rm test.py testpolicy.py
%pyunittest_arch -v
%files %{python_files}
%doc README.md ChangeLog NEWS TODO CREDITS sample.py template.py
%license COPYING
%{python_sitearch}/Milter
%{python_sitearch}/pymilter-%{version}*-info
%files -n pymilter-common
%license COPYING
%{_libexecdir}/milter
%dir %attr(0755,mail,mail) %{_localstatedir}/log/milter
%{_tmpfilesdir}/%{name}.conf
%post -n pymilter-common
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%changelog

View File

@@ -0,0 +1 @@
D /var/run/milter 0755 mail mail -