3 Commits
0.0.2 ... 0.0.4

5 changed files with 26 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ The following configuration options are mandatory in each quarantine section:
* **whitelist_type** * **whitelist_type**
One of the whitelist types described below. One of the whitelist types described below.
* **smtp_host** * **smtp_host**
SMTP host to inject original e-mails. This is needed if not all recipients of an e-mail are whitelisted SMTP host used to release original e-mails from the quarantine.
* **smtp_port** * **smtp_port**
SMTP port SMTP port
@@ -97,6 +97,10 @@ The following configuration options are optional in each quarantine section:
Content of a named subgroup, 'subgroup_name' will be replaced by its name. Content of a named subgroup, 'subgroup_name' will be replaced by its name.
The following configuration options are mandatory for this notification type: The following configuration options are mandatory for this notification type:
* **notification_email_smtp_host**
SMTP host used to send notification e-mails.
* **notification_email_smtp_port**
SMTP port.
* **notification_email_envelope_from** * **notification_email_envelope_from**
Notification e-mail envelope from-address. Notification e-mail envelope from-address.
* **notification_email_from** * **notification_email_from**

View File

@@ -88,6 +88,18 @@ reject_reason = Message rejected
# #
notification_type = email notification_type = email
# Option: notification_email_smtp_host
# Notes: Set the SMTP host. It will be used to send notification e-mails.
# Values: [ HOSTNAME | IP_ADDRESS ]
#
notification_email_smtp_host = 127.0.0.1
# Option: notification_email_smtp_port
# Notes: Set the SMTP port.
# Values: [ PORT ]
#
notification_email_smtp_port = 25
# Option: notification_email_envelope_from # Option: notification_email_envelope_from
# Notes: Set the envelope-from address used when sending notification emails. # Notes: Set the envelope-from address used when sending notification emails.
# This option is needed by notification type 'email'. # This option is needed by notification type 'email'.

View File

@@ -26,6 +26,10 @@ process = None
def smtp_send(smtp_host, smtp_port, mailfrom, recipient, mail): def smtp_send(smtp_host, smtp_port, mailfrom, recipient, mail):
s = smtplib.SMTP(host=smtp_host, port=smtp_port) s = smtplib.SMTP(host=smtp_host, port=smtp_port)
s.ehlo()
if s.has_extn("STARTTLS"):
s.starttls()
s.ehlo()
s.sendmail(mailfrom, [recipient], mail) s.sendmail(mailfrom, [recipient], mail)
s.quit() s.quit()

View File

@@ -115,8 +115,8 @@ class EMailNotification(BaseNotification):
# check if mandatory options are present in config # check if mandatory options are present in config
for option in [ for option in [
"smtp_host", "notification_email_smtp_host",
"smtp_port", "notification_email_smtp_port",
"notification_email_envelope_from", "notification_email_envelope_from",
"notification_email_from", "notification_email_from",
"notification_email_subject", "notification_email_subject",
@@ -142,8 +142,8 @@ class EMailNotification(BaseNotification):
if option not in config.keys(): if option not in config.keys():
config[option] = defaults[option] config[option] = defaults[option]
self.smtp_host = self.config["smtp_host"] self.smtp_host = self.config["notification_email_smtp_host"]
self.smtp_port = self.config["smtp_port"] self.smtp_port = self.config["notification_email_smtp_port"]
self.mailfrom = self.config["notification_email_envelope_from"] self.mailfrom = self.config["notification_email_envelope_from"]
self.from_header = self.config["notification_email_from"] self.from_header = self.config["notification_email_from"]
self.subject = self.config["notification_email_subject"] self.subject = self.config["notification_email_subject"]

View File

@@ -1 +1 @@
__version__ = "0.0.2" __version__ = "0.0.4"