Update alot and a hook to report spam to posteo

This commit is contained in:
Felix Van der Jeugt 2020-05-15 15:20:12 +02:00
parent db4d7de220
commit e071340930
No known key found for this signature in database
GPG key ID: 58B209295023754D
2 changed files with 22 additions and 12 deletions

View file

@ -12,14 +12,25 @@ async def spam(ui):
message = ui.current_buffer.get_selected_message()
message.add_tags(['spam'])
message.remove_tags(['unread'])
envelope = Envelope(
headers=dict(
From=['Felix Van der Jeugt <felix.vanderjeugt@ugent.be>'],
To=['spam@ugent.be'],
Subject=['spam'],
References=['<' + message.get_message_id() + '>']),
bodytext='spam',
tags=['spam'],
account=settings.account_matching_address('felix.vanderjeugt@ugent.be'))
if 'ugent' in message.get_tags():
envelope = Envelope(
headers=dict(
From=['Felix Van der Jeugt <felix.vanderjeugt@ugent.be>'],
To=['spam@ugent.be'],
Subject=['spam'],
References=['<' + message.get_message_id() + '>']),
bodytext='spam',
tags=['spam'],
account=settings.account_matching_address('felix.vanderjeugt@ugent.be'))
else:
envelope = Envelope(
headers=dict(
From=['Felix Van der Jeugt <felix.vanderjeugt@posteo.net>'],
To=['spamreport@posteo.de'],
Subject=['spam'],
References=['<' + message.get_message_id() + '>']),
bodytext='',
tags=['spam'],
account=settings.account_matching_address('felix.vanderjeugt@posteo.net'))
envelope.attach(message.get_filename())
ui.buffer_open(EnvelopeBuffer(ui, envelope))