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

View File

@ -12,6 +12,7 @@ async def spam(ui):
message = ui.current_buffer.get_selected_message() message = ui.current_buffer.get_selected_message()
message.add_tags(['spam']) message.add_tags(['spam'])
message.remove_tags(['unread']) message.remove_tags(['unread'])
if 'ugent' in message.get_tags():
envelope = Envelope( envelope = Envelope(
headers=dict( headers=dict(
From=['Felix Van der Jeugt <felix.vanderjeugt@ugent.be>'], From=['Felix Van der Jeugt <felix.vanderjeugt@ugent.be>'],
@ -21,5 +22,15 @@ async def spam(ui):
bodytext='spam', bodytext='spam',
tags=['spam'], tags=['spam'],
account=settings.account_matching_address('felix.vanderjeugt@ugent.be')) 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()) envelope.attach(message.get_filename())
ui.buffer_open(EnvelopeBuffer(ui, envelope)) ui.buffer_open(EnvelopeBuffer(ui, envelope))