mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 09:13:45 +08:00
return 421 if any unexpected error happen
This commit is contained in:
parent
118862ead0
commit
d738997c4e
1 changed files with 10 additions and 0 deletions
|
@ -1212,6 +1212,16 @@ async def get_spam_score(message: Message) -> float:
|
|||
|
||||
class MailHandler:
|
||||
async def handle_DATA(self, server, session, envelope: Envelope):
|
||||
try:
|
||||
ret = await self._handle(envelope)
|
||||
return ret
|
||||
except Exception:
|
||||
LOG.exception(
|
||||
"email handling fail %s -> %s", envelope.mail_from, envelope.rcpt_tos
|
||||
)
|
||||
return "421 SL Retry later"
|
||||
|
||||
async def _handle(self, envelope: Envelope):
|
||||
start = time.time()
|
||||
LOG.debug(
|
||||
"===>> New message, mail from %s, rctp tos %s ",
|
||||
|
|
Loading…
Reference in a new issue