comparison src/plugins/plugin_misc_account.py @ 1901:faa8427dd032

plugin misc account: fixed handling of None/empty values in sendEmails.sendEmail
author Goffi <goffi@goffi.org>
date Wed, 09 Mar 2016 12:54:26 +0100
parents 31b8a58cfcf5
children 0b748ad46ede
comparison
equal deleted inserted replaced
1900:d1615f79dfe8 1901:faa8427dd032
282 def sendEmail(recipients, msg): 282 def sendEmail(recipients, msg):
283 return sendmail(email_host.encode("utf-8"), 283 return sendmail(email_host.encode("utf-8"),
284 email_from.encode("utf-8"), 284 email_from.encode("utf-8"),
285 [email.encode("utf-8") for email in recipients], 285 [email.encode("utf-8") for email in recipients],
286 msg.as_string(), 286 msg.as_string(),
287 senderDomainName=email_sender_domain.encode("utf-8"), 287 senderDomainName=email_sender_domain.encode("utf-8") if email_sender_domain else None,
288 port=email_port, 288 port=email_port,
289 username=email_username.encode("utf-8"), 289 username=email_username.encode("utf-8") if email_username else None,
290 password=email_password.encode("utf-8"), 290 password=email_password.encode("utf-8") if email_password else None,
291 requireAuthentication=email_starttls, 291 requireAuthentication=email_starttls,
292 requireTransportSecurity=email_auth) 292 requireTransportSecurity=email_auth)
293 293
294 # email to the administrators 294 # email to the administrators
295 admins_emails = self.getConfig('email_admins_list') 295 admins_emails = self.getConfig('email_admins_list')