Fix unbound variable usage
This commit is contained in:
parent
9a5d256e53
commit
16530ada56
|
@ -99,6 +99,9 @@ class MailHandler:
|
|||
|
||||
async def handle_DATA(self, server, session, envelope):
|
||||
address = envelope.rcpt_tos[0]
|
||||
|
||||
mail = email.message_from_bytes(envelope.content,
|
||||
policy=email.policy.SMTP)
|
||||
_from = parseaddr(mail["From"])
|
||||
sender = User.query.filter(User.email == _from[1]).one_or_none()
|
||||
|
||||
|
@ -111,9 +114,6 @@ class MailHandler:
|
|||
print("Rejected, insufficient permissions")
|
||||
return "550 You do not have permission to post on this tracker."
|
||||
|
||||
mail = email.message_from_bytes(envelope.content,
|
||||
policy=email.policy.SMTP)
|
||||
|
||||
body = None
|
||||
for part in mail.walk():
|
||||
if part.is_multipart():
|
||||
|
|
Loading…
Reference in New Issue