Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one match found for domains regex #129

Open
ItayBenAvi opened this issue Feb 5, 2025 · 0 comments
Open

More than one match found for domains regex #129

ItayBenAvi opened this issue Feb 5, 2025 · 0 comments

Comments

@ItayBenAvi
Copy link

Describe the bug
mail-parser fails to run regex on domains that ends with ".id"
My scraper fails on them specifically

To Reproduce
Change domain to end with .id

Change in const.py:51 the regex to negative lookbehind with whitespace and dot:
(
r"[^\w](?:id\s+(?P.+?)(?:\s*[(]?envelope-from|\s*"
r"[(]?envelope-sender|\s+from|\s+by|\s+with"
r"(?! cipher)|\s+for|\s+via|;))"
)
(
r"(?<![^\w\.])(?:id\s+(?P.+?)(?:\s*[(]?envelope-from|\s*"
r"[(]?envelope-sender|\s+from|\s+by|\s+with"
r"(?! cipher)|\s+for|\s+via|;))"
)

Expected behavior
ID extracted correctly and only once

Environment:

  • OS: Linux
  • Docker: yes
  • mail-parser version 4.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant