You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Multiple regex captures for with field regex
This is captured by const.py:47 using the following regex:
(?:with(?! cipher)\s+(?P.+?)(?:\s*[(]?envelope-from|\s*[(]?envelope-sender|\s+from|\s+by|\s+id|\s+for|\s+via|;))
To Reproduce
Use the following line for testing:
from abc.com 1.1.1.1 by edc.com OK with SMTP id ABCDEF123456 using TLSv1.2 with cipher ABCDEF-123456 Client didn't present a certificate
Resolution
Make the regex greedy in order to match the first with occurrence:
(?:with(?! cipher)\s+(?P.+?)(?:\s*[(]?envelope-from|\s*[(]?envelope-sender|\s+from|\s+by|\s+id|\s+for|\s+via|;)).*
Expected behavior
Match the first with statement
Environment:
OS: Linux
Docker: yes
mail-parser version: 4.1.2
The text was updated successfully, but these errors were encountered:
Describe the bug
Multiple regex captures for with field regex
This is captured by const.py:47 using the following regex:
(?:with(?! cipher)\s+(?P.+?)(?:\s*[(]?envelope-from|\s*[(]?envelope-sender|\s+from|\s+by|\s+id|\s+for|\s+via|;))
To Reproduce
Use the following line for testing:
from abc.com 1.1.1.1 by edc.com OK with SMTP id ABCDEF123456 using TLSv1.2 with cipher ABCDEF-123456 Client didn't present a certificate
Resolution
Make the regex greedy in order to match the first with occurrence:
(?:with(?! cipher)\s+(?P.+?)(?:\s*[(]?envelope-from|\s*[(]?envelope-sender|\s+from|\s+by|\s+id|\s+for|\s+via|;)).*
Expected behavior
Match the first with statement
Environment:
The text was updated successfully, but these errors were encountered: