This commit is contained in:
huangzhenpc
2025-02-26 15:05:03 +08:00
parent 40d20ada9f
commit 35937ce9ea
2 changed files with 7 additions and 4 deletions

View File

@@ -44,8 +44,11 @@ class EmailHandler(Message):
# 检查收件人列表是否有效
if not envelope.rcpt_tos:
logging.warning("到邮件但没有有效收件人,将拒绝")
return '550 无效的收件人'
logging.error("件人列表无效,无法保存邮件")
return '550 收件人列表无效'
elif not isinstance(envelope.rcpt_tos, (list, str)):
logging.error("收件人列表格式不正确,无法保存邮件")
return '550 收件人列表格式不正确'
# 保存原始邮件数据
raw_data = envelope.content.decode('utf-8', errors='replace')