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

@ -3,7 +3,7 @@ initial_command = search tag:inbox
periodic_hook_frequency = 60
edit_headers_blacklist = Content-Type, MIME-Version
attachment_prefix = /data/temporary
prefer_plaintext = False
prefer_plaintext = True
editor_cmd = st -e vis
@ -98,8 +98,7 @@ theme = "mutt"
[[thread]]
a = toggletags inbox ; fold
A = toggletags inbox,muted ; fold
n = nextpart
p = prevpart
n = togglemimepart
r = reply --all
u = pipeto --background selecturl
1 = call hooks.delay(ui,1)

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))