Fix: Proper handling of "Auto-Submitted: no" mail header

This commit is contained in:
s3lph 2021-10-19 02:47:47 +02:00
parent d68e826495
commit daee1654d3

View file

@ -128,7 +128,7 @@ def process_mail(mail: bytes):
raise EasyWksError('Sender mail is not a valid mail address') raise EasyWksError('Sender mail is not a valid mail address')
if sender_domain not in Config.domains: if sender_domain not in Config.domains:
raise EasyWksError(f'Domain {sender_domain} not supported') raise EasyWksError(f'Domain {sender_domain} not supported')
if msg.get('x-loop', '') == XLOOP_HEADER or 'auto-submitted' in msg: if msg.get('x-loop', '') == XLOOP_HEADER or msg.get('auto-submitted', 'no') != 'no':
# Mail has somehow looped back to us, discard # Mail has somehow looped back to us, discard
return return
submission_address: str = Config[sender_domain].submission_address submission_address: str = Config[sender_domain].submission_address