You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
883 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright - 2013-2018 Therp BV <https://therp.nl>.
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. class Base(object):
  5. name = None # Name shown to the user
  6. # Fields on fetchmail_server folder required for this algorithm
  7. required_fields = []
  8. # Fields on fetchmail_server folder readonly for this algorithm
  9. readonly_fields = []
  10. def search_matches(self, folder, mail_message, mail_message_org):
  11. """Returns recordset found for model with mail_message."""
  12. return []
  13. def handle_match(
  14. self, connection, match_object, folder,
  15. mail_message, mail_message_org, msgid):
  16. """Do whatever it takes to handle a match"""
  17. folder.attach_mail(match_object, mail_message)
  18. if folder.delete_matching:
  19. connection.store(msgid, '+FLAGS', '\\DELETED')