Skip to content
Snippets Groups Projects

fix requests not being sent to the cc recipients

Closed Frederik Schwan requested to merge freswa/aurweb:master into master
2 files
+ 23
32
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 23
31
@@ -87,38 +87,30 @@ class Notification:
for key, value in self.get_headers().items():
msg[key] = value
sendmail = aurweb.config.get('notifications', 'sendmail')
if sendmail:
# send email using the sendmail binary specified in the
# configuration file
p = subprocess.Popen([sendmail, '-t', '-oi'],
stdin=subprocess.PIPE)
p.communicate(msg.as_bytes())
# send email using smtplib; no local MTA required
server_addr = aurweb.config.get('notifications', 'smtp-server')
server_port = aurweb.config.getint('notifications', 'smtp-port')
use_ssl = aurweb.config.getboolean('notifications', 'smtp-use-ssl')
use_starttls = aurweb.config.getboolean('notifications', 'smtp-use-starttls')
user = aurweb.config.get('notifications', 'smtp-user')
passwd = aurweb.config.get('notifications', 'smtp-password')
if use_ssl:
server = smtplib.SMTP_SSL(server_addr, server_port)
else:
# send email using smtplib; no local MTA required
server_addr = aurweb.config.get('notifications', 'smtp-server')
server_port = aurweb.config.getint('notifications', 'smtp-port')
use_ssl = aurweb.config.getboolean('notifications', 'smtp-use-ssl')
use_starttls = aurweb.config.getboolean('notifications', 'smtp-use-starttls')
user = aurweb.config.get('notifications', 'smtp-user')
passwd = aurweb.config.get('notifications', 'smtp-password')
if use_ssl:
server = smtplib.SMTP_SSL(server_addr, server_port)
else:
server = smtplib.SMTP(server_addr, server_port)
if use_starttls:
server.ehlo()
server.starttls()
server.ehlo()
if user and passwd:
server.login(user, passwd)
server.set_debuglevel(0)
server.sendmail(sender, to, msg.as_bytes())
server.quit()
server = smtplib.SMTP(server_addr, server_port)
if use_starttls:
server.ehlo()
server.starttls()
server.ehlo()
if user and passwd:
server.login(user, passwd)
server.set_debuglevel(0)
server.sendmail(sender, to, msg.as_bytes())
server.quit()
class ResetKeyNotification(Notification):
Loading