Compare commits

...

7 Commits

Author SHA1 Message Date
Sandro 20751ea706 Set C standard to C17 explicitely (#70)
GCC 15 uses C23 by default. But `libmilter` is not compatible, yet.
This breaks the build as `bool` is a keyword in C23 (issue #68).
2025-03-12 20:05:10 -04:00
dotlambda 7197b82ed6 thread module has been renamed to _thread in Python 3 (#64) 2025-03-12 20:00:12 -04:00
Stuart D. Gathman 39a1fc78d8 Merge branch 'master' of github.com:sdgathman/pymilter 2024-10-15 19:43:54 -04:00
Stuart D. Gathman 5ad23e468d bsddb changed nulls in access file policy 2024-10-15 19:42:05 -04:00
Sandro 6eedaf7717 Python 3.13: Replace deprecated makeSuite() (#65)
The function has been deprecated in Python 3.11 and is no longer
available in Python 3.13.
2024-10-14 14:36:04 -04:00
Jean-Yves 4a8018c2de Welcome __NetBSD__ to the required header include. (#60)
Same rule applies for NetBSD as FreeBSD, <arpa/inet.h> include is
needed to provide inet_nto*() prototypes.
2024-06-05 08:18:15 -04:00
Stuart D. Gathman 1212a0ef59 Forgot to bump internal tags 2024-05-29 18:45:09 -04:00
12 changed files with 25 additions and 16 deletions
+3
View File
@@ -1,8 +1,11 @@
*.pyc *.pyc
*.tar.gz
build/ build/
test/*.out test/*.out
test/*.tstout test/*.tstout
test/*.log test/*.log
test/*.db
test.db test.db
dist dist
log
MANIFEST MANIFEST
+1 -1
View File
@@ -9,7 +9,7 @@
# This code is under the GNU General Public License. See COPYING for details. # This code is under the GNU General Public License. See COPYING for details.
from __future__ import print_function from __future__ import print_function
__version__ = '1.0.5' __version__ = '1.0.6'
import os import os
import re import re
+4 -1
View File
@@ -1,7 +1,10 @@
from __future__ import print_function from __future__ import print_function
import time import time
import shelve import shelve
import thread try:
import thread
except:
import _thread as thread
import logging import logging
import urllib import urllib
+1 -1
View File
@@ -4,7 +4,7 @@ web:
rsync -ravKk doc/html/ pymilter.org:/var/www/html/milter/pymilter rsync -ravKk doc/html/ pymilter.org:/var/www/html/milter/pymilter
cd doc/html; zip -r ../../doc . cd doc/html; zip -r ../../doc .
VERSION=1.0.5 VERSION=1.0.6
PKG=pymilter-$(VERSION) PKG=pymilter-$(VERSION)
SRCTAR=$(PKG).tar.gz SRCTAR=$(PKG).tar.gz
+1 -1
View File
@@ -72,7 +72,7 @@ $ python setup.py help
* published. Unfortunately I know of no good way to do this * published. Unfortunately I know of no good way to do this
* other than with OS-specific tests. * other than with OS-specific tests.
*/ */
#if defined(__FreeBSD__) || defined(__linux__) || defined(__sun__) || defined(__GLIBC__) || (defined(__APPLE__) && defined(__MACH__)) #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) || defined(__sun__) || defined(__GLIBC__) || (defined(__APPLE__) && defined(__MACH__))
#define HAVE_IPV6_RFC2553 #define HAVE_IPV6_RFC2553
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
+4 -1
View File
@@ -36,7 +36,10 @@ setup(name = "pymilter", version = '1.0.5',
# set MAX_ML_REPLY to 1 for sendmail < 8.13 # set MAX_ML_REPLY to 1 for sendmail < 8.13
define_macros = [ ('MAX_ML_REPLY',32) ], define_macros = [ ('MAX_ML_REPLY',32) ],
# save lots of debugging time testing rfc2553 compliance # save lots of debugging time testing rfc2553 compliance
extra_compile_args = [ "-Werror=implicit-function-declaration" ] extra_compile_args = [
"-Werror=implicit-function-declaration",
"-std=gnu17",
]
), ),
], ],
keywords = ['sendmail','milter'], keywords = ['sendmail','milter'],
+1 -1
View File
@@ -11,7 +11,7 @@ class ConfigTestCase(unittest.TestCase):
miltersrs = cp.getboolean('srsmilter','miltersrs') miltersrs = cp.getboolean('srsmilter','miltersrs')
self.assertFalse(miltersrs) self.assertFalse(miltersrs)
def suite(): return unittest.makeSuite(ConfigTestCase,'test') def suite(): return unittest.TestLoader().loadTestsFromTestCase(ConfigTestCase)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
+3 -3
View File
@@ -35,7 +35,7 @@ class GreylistTestCase(unittest.TestCase):
# new one past expire # new one past expire
rc = grey.check('1.2.3.5','foo@bar.com','baz@spat.com',timeinc=6*3600) rc = grey.check('1.2.3.5','foo@bar.com','baz@spat.com',timeinc=6*3600)
self.assertEqual(rc,0) self.assertEqual(rc,0)
# original past retain # original past retain
rc = grey.check('1.2.3.4','foo@bar.com','baz@spat.com',timeinc=37*24*3600) rc = grey.check('1.2.3.4','foo@bar.com','baz@spat.com',timeinc=37*24*3600)
self.assertEqual(rc,0) self.assertEqual(rc,0)
# new one for testing expire # new one for testing expire
@@ -48,8 +48,8 @@ class GreylistTestCase(unittest.TestCase):
self.assertEqual(rc,1) self.assertEqual(rc,1)
grey.close() grey.close()
def suite(): def suite():
s = unittest.makeSuite(GreylistTestCase,'test') s = unittest.TestLoader().loadTestsFromTestCase(GreylistTestCase)
return s return s
if __name__ == '__main__': if __name__ == '__main__':
+2 -2
View File
@@ -71,7 +71,7 @@ class MimeTestCase(unittest.TestCase):
self.fail('should get boundary error parsing bad rfc822 attachment') self.fail('should get boundary error parsing bad rfc822 attachment')
except errors.BoundaryError: except errors.BoundaryError:
pass pass
def testDefang(self,vname='virus1',part=1, def testDefang(self,vname='virus1',part=1,
fname='LOVE-LETTER-FOR-YOU.TXT.vbs'): fname='LOVE-LETTER-FOR-YOU.TXT.vbs'):
try: try:
@@ -234,7 +234,7 @@ class MimeTestCase(unittest.TestCase):
#print(msg + filter.msg) #print(msg + filter.msg)
self.assertTrue(result.getvalue() == msg + filter.msg) self.assertTrue(result.getvalue() == msg + filter.msg)
def suite(): return unittest.makeSuite(MimeTestCase,'test') def suite(): return unittest.TestLoader().loadTestsFromTestCase(MimeTestCase)
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) < 2: if len(sys.argv) < 2:
+2 -2
View File
@@ -25,7 +25,7 @@ class PolicyTestCase(unittest.TestCase):
def testPolicy(self): def testPolicy(self):
self.config.access_file_colon = False self.config.access_file_colon = False
self.config.access_file_nulls = True self.config.access_file_nulls = False # FIXME: test old and new bsddb
with MTAPolicy('good@example.com',conf=self.config) as p: with MTAPolicy('good@example.com',conf=self.config) as p:
pol = p.getPolicy('smtp-auth') pol = p.getPolicy('smtp-auth')
self.assertEqual(pol,'OK') self.assertEqual(pol,'OK')
@@ -42,7 +42,7 @@ class PolicyTestCase(unittest.TestCase):
pol = p.getPolicy('smtp-test') pol = p.getPolicy('smtp-test')
self.assertEqual(pol,'WILDCARD') self.assertEqual(pol,'WILDCARD')
def suite(): return unittest.makeSuite(PolicyTestCase,'test') def suite(): return unittest.TestLoader().loadTestsFromTestCase(PolicyTestCase)
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) < 2: if len(sys.argv) < 2:
+1 -1
View File
@@ -142,7 +142,7 @@ class BMSMilterTestCase(unittest.TestCase):
f.write(fp.getvalue()) f.write(fp.getvalue())
milter.close() milter.close()
def suite(): return unittest.makeSuite(BMSMilterTestCase,'test') def suite(): return unittest.TestLoader().loadTestsFromTestCase(BMSMilterTestCase)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
+2 -2
View File
@@ -53,8 +53,8 @@ class AddrCacheTestCase(unittest.TestCase):
s = Milter.utils.parseaddr('a(WRONG)@b') s = Milter.utils.parseaddr('a(WRONG)@b')
self.assertEqual(s,('WRONG', 'a@b')) self.assertEqual(s,('WRONG', 'a@b'))
def suite(): def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test') s = unittest.TestLoader().loadTestsFromTestCase(AddrCacheTestCase)
s.addTest(doctest.DocTestSuite(Milter.utils)) s.addTest(doctest.DocTestSuite(Milter.utils))
s.addTest(doctest.DocTestSuite(Milter.dynip)) s.addTest(doctest.DocTestSuite(Milter.dynip))
s.addTest(doctest.DocTestSuite(Milter.pyip6)) s.addTest(doctest.DocTestSuite(Milter.pyip6))