mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
handle the case some email providers might strip off the = suffix
This commit is contained in:
parent
618d308c22
commit
0f71eff531
1 changed files with 7 additions and 1 deletions
|
@ -749,7 +749,13 @@ def handle_unsubscribe(envelope: Envelope):
|
|||
# format: alias_id:
|
||||
subject = msg["Subject"]
|
||||
try:
|
||||
alias_id = int(subject[:-1])
|
||||
# subject has the format {alias.id}=
|
||||
if subject.endswith("="):
|
||||
alias_id = int(subject[:-1])
|
||||
# some email providers might strip off the = suffix
|
||||
else:
|
||||
alias_id = int(subject)
|
||||
|
||||
alias = Alias.get(alias_id)
|
||||
except Exception:
|
||||
LOG.warning("Cannot parse alias from subject %s", msg["Subject"])
|
||||
|
|
Loading…
Reference in a new issue