mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
Do not rely on revert to delete EmailLog object when pgp fails
This commit is contained in:
parent
f03bde1d8d
commit
93503d4cd3
@ -841,6 +841,7 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
||||
is_reply=True,
|
||||
user_id=contact.user_id,
|
||||
mailbox_id=mailbox.id,
|
||||
commit=True
|
||||
)
|
||||
|
||||
# Spam check
|
||||
@ -909,11 +910,11 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str):
|
||||
"Cannot encrypt message %s -> %s. %s %s", alias, contact, mailbox, user
|
||||
)
|
||||
# to not save the email_log
|
||||
db.session.rollback()
|
||||
EmailLog.delete(email_log.id)
|
||||
db.session.commit()
|
||||
# return 421 so the client can retry later
|
||||
return False, "421 SL E13 Retry later"
|
||||
|
||||
# save the email_log to DB
|
||||
db.session.commit()
|
||||
|
||||
# make the email comes from alias
|
||||
|
Loading…
Reference in New Issue
Block a user