调试
This commit is contained in:
@@ -43,8 +43,8 @@ class MailStore:
|
||||
logging.info(f"开始保存邮件: 发件人={sender}, 收件人={recipients}")
|
||||
logging.debug(f"原始邮件数据: {raw_data}")
|
||||
if recipients is None:
|
||||
logging.warning("收件人列表为None,将使用空列表")
|
||||
recipients_list = []
|
||||
logging.error("收件人列表为None,无法保存邮件")
|
||||
return False, "收件人列表为None"
|
||||
elif isinstance(recipients, list):
|
||||
recipients_list = recipients # 如果是列表,直接使用
|
||||
else:
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user