mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 04:04:55 +08:00
add is_bounce()
This commit is contained in:
parent
ffc621596a
commit
6c42872440
1 changed files with 8 additions and 0 deletions
|
@ -1771,6 +1771,14 @@ def is_automatic_out_of_office(msg: Message) -> bool:
|
||||||
return False
|
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:
|
def handle_unsubscribe(envelope: Envelope, msg: Message) -> str:
|
||||||
"""return the SMTP status"""
|
"""return the SMTP status"""
|
||||||
# format: alias_id:
|
# format: alias_id:
|
||||||
|
|
Loading…
Reference in a new issue