Bug 6420 - [PATCH] Extend fetchmail parsing restart to cover other mail fetchers
Summary: [PATCH] Extend fetchmail parsing restart to cover other mail fetchers
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: 3.3.1
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: Dave Jones
URL:
Whiteboard:
Keywords:
: 6935 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-20 09:17 UTC by Peter Alfredsen
Modified: 2017-12-29 18:40 UTC (History)
4 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Fixup mail fetcher detection logic to be more generic application/octet-stream None Peter Alfredsen [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Alfredsen 2010-04-20 09:17:39 UTC
Created attachment 4751 [details]
Fixup mail fetcher detection logic to be more generic

Currently, we only restart parsing of headers when encountering a Fetchmail marker. This patch extends that to any mail received via POP3 or IMAP, which can be assumed to have been fetched when we're in trusted_networks.

Also, initialize $self->{allow_fetchmail_markers} to 1 so we don't tell the user in dbg that the first header is untrusted, if it is generated by a mail fetcher.

Furthermore, remove already obsolete Received: parsing try which would have been caught by the test this patch replaces, and is certainly caught by this patch.
Comment 1 Kevin A. McGrail 2011-10-29 02:57:19 UTC
Can anyone who uses getmail or fetchmail with SA confirm this patch works?  It looks like it has promise but I can't confirm it much.
Comment 2 Karsten Bräckelmann 2013-05-16 19:30:49 UTC
*** Bug 6935 has been marked as a duplicate of this bug. ***
Comment 3 RW 2013-05-16 22:03:39 UTC
The patch works for me.

Funny thing is that I had to dig-out an old POP3 retrieval to test the behaviour with and without the patch. It turns out that without this patch there is no support for "with IMAP" headers. For all these years my internal/trusted networks would have worked correctly without any configuration because the getmail header wasn't parsable.
Comment 4 Dave Jones 2017-12-12 15:47:31 UTC
Recent mention on the SA users list.  I will commit this if there are no objections.  I reviewed the patch and the code changes look OK to make it more of a general header parsing that works with both fetchmail and getmail.
Comment 5 Kevin A. McGrail 2017-12-12 15:52:29 UTC
+1 for you to commit.  I hate received.pm hacks :-)
Comment 6 Dave Jones 2017-12-12 15:56:01 UTC
It's such an old patch against 3.3.1 so I will try to figure out if there are any changes that conflict with newer SA versions and adjust the patch file if needed.  If there are conflicts and I have to adjust the patch file, I will setup a test environment and test the changes against 3.4.1 before committing.
Comment 7 Kevin A. McGrail 2017-12-12 16:09:29 UTC
Thanks.  And it's considered you run make test before committing and that right now any changes are committed to trunk (4.0) and 3.4 branch.
Comment 8 Giovanni Bechis 2017-12-12 17:54:58 UTC
Patch seems legit, +1 for commit if regression tests still passes.
 Thanks
  Giovanni
Comment 9 Dave Jones 2017-12-29 18:40:57 UTC
Committed to trunk and 3.4 branch.