add is_bounce()

This commit is contained in:
Son 2022-01-05 15:22:22 +01:00
parent ffc621596a
commit 6c42872440

View file

@ -1771,6 +1771,14 @@ def is_automatic_out_of_office(msg: Message) -> bool:
return False
def is_bounce(envelope: Envelope, msg: Message):
"""Detect whether an email is a Delivery Status Notification"""
return (
envelope.mail_from == "<>"
and msg.get_content_type().lower() == "multipart/report"
)
def handle_unsubscribe(envelope: Envelope, msg: Message) -> str:
"""return the SMTP status"""
# format: alias_id: