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()
|
s.quit()
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
while True:
|
||||||
s.sendmail(myemailaddr, to, mail.encode('utf-8'))
|
try:
|
||||||
s.quit()
|
s.sendmail(myemailaddr, to, mail.encode('utf-8'))
|
||||||
os.remove(f.name)
|
s.quit()
|
||||||
Logger.normal('Sync request mailed.')
|
os.remove(f.name)
|
||||||
except:
|
Logger.normal('Sync request mailed.')
|
||||||
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