2020-10-17 12:46:09 +02:00
|
|
|
class InMailbox < ApplicationMailbox
|
|
|
|
def process
|
2021-01-22 14:50:56 +01:00
|
|
|
email_importer = EmailImporter.new
|
2020-12-28 00:53:14 +01:00
|
|
|
repository = EmailRepository.new
|
2020-10-28 23:53:42 +01:00
|
|
|
|
2020-12-31 11:56:13 +01:00
|
|
|
email = email_importer.import(mail)
|
2021-01-22 14:50:56 +01:00
|
|
|
|
2021-01-25 14:32:26 +01:00
|
|
|
processor = RuleSetProcessor.new(email: email)
|
|
|
|
email = processor.process_all(RuleSet.enabled)
|
2021-01-22 14:50:56 +01:00
|
|
|
|
2020-12-31 11:56:13 +01:00
|
|
|
repository.save(email)
|
2020-10-28 23:53:42 +01:00
|
|
|
end
|
2020-10-17 12:46:09 +02:00
|
|
|
end
|