retry sending mail if TimeoutError
This commit is contained in:
parent
d8f7323b95
commit
9e019ae98a
|
@ -822,10 +822,9 @@ def forward_email_to_mailbox(
|
||||||
envelope.rcpt_options,
|
envelope.rcpt_options,
|
||||||
is_forward=True,
|
is_forward=True,
|
||||||
)
|
)
|
||||||
except (SMTPServerDisconnected, SMTPRecipientsRefused):
|
except (SMTPServerDisconnected, SMTPRecipientsRefused, TimeoutError):
|
||||||
# that means the mailbox is maybe invalid
|
|
||||||
LOG.w(
|
LOG.w(
|
||||||
"SMTPServerDisconnected or SMTPRecipientsRefused during forward phase %s -> %s -> %s",
|
"Postfix error during forward phase %s -> %s -> %s",
|
||||||
contact,
|
contact,
|
||||||
alias,
|
alias,
|
||||||
mailbox,
|
mailbox,
|
||||||
|
@ -834,7 +833,7 @@ def forward_email_to_mailbox(
|
||||||
if should_ignore_bounce(envelope.mail_from):
|
if should_ignore_bounce(envelope.mail_from):
|
||||||
return True, status.E207
|
return True, status.E207
|
||||||
else:
|
else:
|
||||||
# can be Postfix intermittent "Temporary lookup failure" error
|
# so Postfix can retry
|
||||||
return False, status.E407
|
return False, status.E407
|
||||||
else:
|
else:
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
Loading…
Reference in New Issue