Skip to content

Commit

Permalink
Merge pull request #3140 from natefoo/activation-from
Browse files Browse the repository at this point in the history
Ensure a From: address is set for user activation emails
  • Loading branch information
blankenberg committed Nov 8, 2016
2 parents 3d69a2d + 1e142dd commit 00edc47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/galaxy/webapps/galaxy/controllers/user.py
Expand Up @@ -842,6 +842,9 @@ def send_verification_email( self, trans, email, username ):
username = trans.user.username
activation_link = self.prepare_activation_link( trans, escape( email ) )

host = trans.request.host.split( ':' )[ 0 ]
if host in [ 'localhost', '127.0.0.1', '0.0.0.0' ]:
host = socket.getfqdn()
body = ("Hello %s,\n\n"
"In order to complete the activation process for %s begun on %s at %s, please click on the following link to verify your account:\n\n"
"%s \n\n"
Expand All @@ -855,7 +858,7 @@ def send_verification_email( self, trans, email, username ):
trans.app.config.error_email_to,
trans.app.config.instance_resource_url))
to = email
frm = trans.app.config.email_from
frm = trans.app.config.email_from or 'galaxy-no-reply@' + host
subject = 'Galaxy Account Activation'
try:
util.send_mail( frm, to, subject, body, trans.app.config )
Expand Down

0 comments on commit 00edc47

Please sign in to comment.