-
Notifications
You must be signed in to change notification settings - Fork 18
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
abusehelper.core.mail: Generalized mail parsing #6
Conversation
The current
would know magically to apply a suitable IMAP filter. Currently the IMAP runner can be explicitly configured with a filter, but this doesn't happen automatically based on the handler. Should the handler even be bothered with such things, though? Also the separation of concerns would be clearer is the Handler could just concentrate on parsing mails that get thrown at it, while the runners can concentrate on fetching the mails. Currently the Maildir runner just assumes that all mails in a mailbox should be processed. Maybe the IMAP runner could do the same. |
I always specify filters manually for imap bots, so fine by me. |
Also add the option to handle single lines with abusehelper.core.mail.tester.
Removed the backwards compatibility layer task, as it should not be a blocker for merging this pull request. This pull request doesn't touch |
This pull request adds the subpackage
abusehelper.core.mail
, which provides the capability to write a generic handler for a mail feed. The trick is that the same handlers can then used parse mails fetched over IMAPv4 or read from a Maildir directory. The handlers can also be tested from the command line and in automated unit tests.The included README.md aims to document the functionality while giving a short tutorial how to use the code.
The goal is to offer a replacement the current mail feed related code such as
abusehelper.core.imapbot
andabusehelper.core.shadowservermail
. This pull request doesn't remove any old functionality though, and should therefore be fully backwards compatible.Tasks