Fix parsing bug of 'From' headers with no '@' symbol

This commit is contained in:
Max Erenberg 2022-02-25 00:53:13 -05:00
parent 06d73731d6
commit 49e570517e
4 changed files with 9 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class CSCMilter(Milter.Base):
if field != 'from':
return Milter.CONTINUE
addr = parseaddr(value)[1]
if addr == '':
if '@' not in addr:
return Milter.CONTINUE
domain = addr.split('@')[1].lower()
if not is_in_myorigin(domain):

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
csc-milter (0.2.2-1) buster; urgency=medium
* Fix parsing bug of 'From' headers with no '@' symbol.
-- Max Erenberg <merenber@csclub.uwaterloo.ca> Fri, 25 Feb 2022 05:32:39 +0000
csc-milter (0.2.1-1) buster; urgency=medium
* Add config file.

1
debian/source/options vendored Normal file
View File

@ -0,0 +1 @@
extend-diff-ignore = "^(dist/|.+\.egg-info/|build/)|__pycache__/|(^|/)\..+"

View File

@ -16,7 +16,7 @@ class PyTest(TestCommand):
setup(
name='csc-milter',
version='0.2.1',
version='0.2.2',
description='Custom milter for CSC',
long_description=long_description,
long_description_content_type='text/markdown',