From 49e570517ee7ff0aa8e55519f5b8502627e2e986 Mon Sep 17 00:00:00 2001 From: Max Erenberg <> Date: Fri, 25 Feb 2022 00:53:13 -0500 Subject: [PATCH] Fix parsing bug of 'From' headers with no '@' symbol --- csc_milter/main.py | 2 +- debian/changelog | 6 ++++++ debian/source/options | 1 + setup.py | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 debian/source/options diff --git a/csc_milter/main.py b/csc_milter/main.py index 6159512..1691c26 100644 --- a/csc_milter/main.py +++ b/csc_milter/main.py @@ -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): diff --git a/debian/changelog b/debian/changelog index 96ec2d7..3e0cfdb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +csc-milter (0.2.2-1) buster; urgency=medium + + * Fix parsing bug of 'From' headers with no '@' symbol. + + -- Max Erenberg Fri, 25 Feb 2022 05:32:39 +0000 + csc-milter (0.2.1-1) buster; urgency=medium * Add config file. diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..47174e7 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^(dist/|.+\.egg-info/|build/)|__pycache__/|(^|/)\..+" diff --git a/setup.py b/setup.py index fe28f39..0912110 100644 --- a/setup.py +++ b/setup.py @@ -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',