diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 38a9a93bc211..7ee4d6243cd8 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1620,18 +1620,6 @@ :Type: str -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``error_email_reply_to_user`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:Description: - When sending email reports for tool errors, include the user's - email address in the Reply-to SMTP header (used by some ticketing - systems to identify the appropriate response address). -:Default: ``None`` -:Type: bool - - ~~~~~~~~~~~~~~ ``email_from`` ~~~~~~~~~~~~~~ diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index 25c9979dc782..8d1149c1e445 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -1111,11 +1111,6 @@ galaxy: # user may encounter. #error_email_to: null - # When sending email reports for tool errors, include the user's email - # address in the Reply-to SMTP header (used by some ticketing systems - # to identify the appropriate response address). - #error_email_reply_to_user: false - # Email address to use in the 'From' field when sending emails for # account activations, workflow step notifications, password resets, # and tool error reports. We recommend using a string in the diff --git a/lib/galaxy/config/schemas/config_schema.yml b/lib/galaxy/config/schemas/config_schema.yml index bffbe9800f05..52456679891c 100644 --- a/lib/galaxy/config/schemas/config_schema.yml +++ b/lib/galaxy/config/schemas/config_schema.yml @@ -1159,14 +1159,6 @@ mapping: set. Also this email is shown as a contact to user in case of Galaxy misconfiguration and other events user may encounter. - error_email_reply_to_user: - type: bool - required: false - desc: | - When sending email reports for tool errors, include the user's email address - in the Reply-to SMTP header (used by some ticketing systems to identify the - appropriate response address). - email_from: type: str required: false diff --git a/lib/galaxy/tools/errors.py b/lib/galaxy/tools/errors.py index 2d63853344d9..38a74e2914b9 100644 --- a/lib/galaxy/tools/errors.py +++ b/lib/galaxy/tools/errors.py @@ -253,7 +253,7 @@ def _send_report(self, user, email=None, message=None, **kwd): except Exception: pass - reply_to = user.email if self.app.config.error_email_reply_to_user else None + reply_to = user.email if user else None return util.send_mail( self.app.config.email_from, to, diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index b49b82a106df..35e675cf1147 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -1543,6 +1543,9 @@ def send_mail(frm, to, subject, body, config, html=None, reply_to=None): msg["From"] = frm msg["Subject"] = subject + if reply_to: + msg["Reply-To"] = reply_to + if config.smtp_server is None: log.error("Mail is not configured for this Galaxy instance.") log.info(msg) @@ -1554,9 +1557,6 @@ def send_mail(frm, to, subject, body, config, html=None, reply_to=None): msg.attach(mp_text) msg.attach(mp_html) - if reply_to: - msg["Reply-To"] = reply_to - smtp_ssl = asbool(getattr(config, "smtp_ssl", False)) if smtp_ssl: s = smtplib.SMTP_SSL(config.smtp_server)