mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 23:34:05 +08:00
Add OLD_UNSUBSCRIBER and support it
This commit is contained in:
parent
64d2e7804e
commit
eeb24f594a
2 changed files with 5 additions and 1 deletions
|
@ -157,6 +157,9 @@ DISABLE_ALIAS_SUFFIX = "DISABLE_ALIAS_SUFFIX" in os.environ
|
||||||
# the email address that receives all unsubscription request
|
# the email address that receives all unsubscription request
|
||||||
UNSUBSCRIBER = os.environ.get("UNSUBSCRIBER")
|
UNSUBSCRIBER = os.environ.get("UNSUBSCRIBER")
|
||||||
|
|
||||||
|
# due to a typo, both UNSUBSCRIBER and OLD_UNSUBSCRIBER are supported
|
||||||
|
OLD_UNSUBSCRIBER = os.environ.get("OLD_UNSUBSCRIBER")
|
||||||
|
|
||||||
DKIM_SELECTOR = b"dkim"
|
DKIM_SELECTOR = b"dkim"
|
||||||
DKIM_PRIVATE_KEY = None
|
DKIM_PRIVATE_KEY = None
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ from app.config import (
|
||||||
TEMP_DIR,
|
TEMP_DIR,
|
||||||
ALERT_HOTMAIL_COMPLAINT_TRANSACTIONAL,
|
ALERT_HOTMAIL_COMPLAINT_TRANSACTIONAL,
|
||||||
ALERT_HOTMAIL_COMPLAINT_REPLY_PHASE,
|
ALERT_HOTMAIL_COMPLAINT_REPLY_PHASE,
|
||||||
|
OLD_UNSUBSCRIBER,
|
||||||
)
|
)
|
||||||
from app.db import Session
|
from app.db import Session
|
||||||
from app.email import status, headers
|
from app.email import status, headers
|
||||||
|
@ -2015,7 +2016,7 @@ def handle(envelope: Envelope) -> str:
|
||||||
return status.E203
|
return status.E203
|
||||||
|
|
||||||
# unsubscribe request
|
# unsubscribe request
|
||||||
if UNSUBSCRIBER and rcpt_tos == [UNSUBSCRIBER]:
|
if UNSUBSCRIBER and (rcpt_tos == [UNSUBSCRIBER] or rcpt_tos == [OLD_UNSUBSCRIBER]):
|
||||||
LOG.d("Handle unsubscribe request from %s", mail_from)
|
LOG.d("Handle unsubscribe request from %s", mail_from)
|
||||||
return handle_unsubscribe(envelope, msg)
|
return handle_unsubscribe(envelope, msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue