diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 12f05be9b0f9..01da0516fecd 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 d2585104bbcd..4e807958e685 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -1105,11 +1105,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 fc2918f2b3af..e66696aec4aa 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 d437e5361d82..38ebccf5e3f2 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 f0f9922ca172..0f954b3b700a 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)