Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion arbiter/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,14 @@ def send_email(subject, html_message, to, bcc, sender, image_attachment=None,

# Send the message
if email["bcc"] or email["to"]:
mail_server = cfg.email.mail_server
mail_server = cfg.email.mail_server
smtp_starttls = cfg.email.smtp_starttls
smtp_passwd = cfg.email.smtp_passwd
try:
with smtplib.SMTP(mail_server) as smtp:
if (smtp_starttls == True and smtp_passwd != ''):
smtp.starttls() # Start TLS encryption
smtp.login(email["From"], smtp_passwd) # Login
smtp.send_message(email)
except Exception as err:
logger.debug(err)
Expand Down
2 changes: 2 additions & 0 deletions arbiter/cfgparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ def redacted_url(url):
"email": {
"email_domain": ValidationProtocol(str),
"from_email": ValidationProtocol(str),
"smtp_passwd": ValidationProtocol(str,default_value=""),
"smtp_starttls": ValidationProtocol(bool,default_value=False),
"admin_emails": ValidationProtocol(list, all_are_str),
"mail_server": ValidationProtocol(str, can_ping),
"keep_plots": ValidationProtocol(bool),
Expand Down
2 changes: 2 additions & 0 deletions etc/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ time_to_min_bad = 1800 # 30 minutes
[email]
email_domain = 'organization.edu' # Used for a generic email addr integration in integrations.py
from_email = 'noreply+arbiter@organization.edu'
smtp_passwd = '' # Password used for logging in to the SMTP server with from_email and smtp_passwd.
smtp_starttls = True # If True, enables STARTTLS to secure the SMTP connection. Default is False.
admin_emails = ['john.doe@organization.edu']
mail_server = '0.0.0.0'
keep_plots = false
Expand Down
2 changes: 1 addition & 1 deletion etc/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def email_addr_placeholder(username):
username: str
The username of the user.
"""
return ("{}@" + cfg.email.email_domain).format(username)
return ("v.{}@" + cfg.email.email_domain).format(username)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is really a template, so site specific changes should not be included.



def _get_name(uid):
Expand Down