mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Also allow retry if recipient got rejected
This commit is contained in:
parent
12030d99e9
commit
d18a35c449
@ -200,10 +200,18 @@ Content-Type: text/plain; charset=UTF-8
|
||||
s.quit()
|
||||
return
|
||||
|
||||
while True:
|
||||
try:
|
||||
s.sendmail(myemailaddr, to, mail.encode('utf-8'))
|
||||
s.quit()
|
||||
os.remove(f.name)
|
||||
Logger.normal('Sync request mailed.')
|
||||
except:
|
||||
Logger.error('Unknown error while sending the mail.')
|
||||
break
|
||||
except smtplib.SMTPRecipientsRefused, smtperror:
|
||||
smtp_code, smtp_message = smtperror.recipients[to]
|
||||
Logger.error('Error while sending: %i, %s', smtp_code, smtp_message)
|
||||
if smtp_code == 450:
|
||||
confirmation_prompt(message='This is a temporary error, press '
|
||||
'[Enter] to retry. Press [Ctrl-C] to abort now.')
|
||||
else:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user