@ -55,6 +55,9 @@ def send(message, email_to, test=None):
email_from = test . get ( ' email_from ' )
email_from = test . get ( ' email_from ' )
email_account = test . get ( ' email_account ' )
email_account = test . get ( ' email_account ' )
email_pwd = test . get ( ' email_pwd ' )
email_pwd = test . get ( ' email_pwd ' )
if email_pwd and not email_pwd . replace ( ' * ' , ' ' ) :
# If all stars, get stored password instead
email_pwd = cfg . email_pwd ( )
else :
else :
email_server = cfg . email_server ( )
email_server = cfg . email_server ( )
email_from = cfg . email_from ( )
email_from = cfg . email_from ( )
@ -113,8 +116,14 @@ def send(message, email_to, test=None):
if ( email_account != " " ) and ( email_pwd != " " ) :
if ( email_account != " " ) and ( email_pwd != " " ) :
try :
try :
mailconn . login ( email_account , email_pwd )
mailconn . login ( email_account , email_pwd )
except smtplib . SMTPHeloError :
return errormsg ( T ( " The server didn ' t reply properly to the helo greeting " ) )
except smtplib . SMTPAuthenticationError :
return errormsg ( T ( " Failed to authenticate to mail server " ) )
except smtplib . SMTPException :
return errormsg ( T ( " No suitable authentication method was found " ) )
except :
except :
return errormsg ( T ( ' Failed to authenticate to mail server ' ) )
return errormsg ( T ( " Unknown authentication failure in mail server " ) )
try :
try :
mailconn . sendmail ( email_from , email_to , message )
mailconn . sendmail ( email_from , email_to , message )