From 9afcae534bc7d9e8061a510e1145d0a8e7ac777f Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 28 Mar 2020 11:04:58 +0100 Subject: [PATCH] return 550 instead of 510 when alias not exist --- email_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/email_handler.py b/email_handler.py index ef8e176b..71368132 100644 --- a/email_handler.py +++ b/email_handler.py @@ -300,11 +300,11 @@ def handle_forward(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> str: alias = Alias.get_by(email=address) if not alias: - LOG.d("alias %s not exist. Try to see if it can be created on the fly", alias) + LOG.d("alias %s not exist. Try to see if it can be created on the fly", address) alias = try_auto_create(address) if not alias: - LOG.d("alias %s cannot be created on-the-fly, return 510", address) - return "510 Email not exist" + LOG.d("alias %s cannot be created on-the-fly, return 550", address) + return "550 SL Email not exist" mailbox = alias.mailbox mailbox_email = mailbox.email