Project

General

Profile

Actions

Feature #34833

closed

Allow redmine to provide reply-to email header

Added by Gary Aitken over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid

Description

Redmine outgoing email does not provide a reply-to header. Many email relays which require a user-id/pw login (e.g. smtp.gmail.com) replace the sender@domain with the user-id of the login account. Consequently, when the receiver replies to the email, it goes to the login user-id and domain, rather than the sender user@domain set by redmine where the issue originated.

This patch provides a check-box in the email-notifications settings which, when set, causes redmine to provide a reply-to header identical to the sender (user@domain). This allows replies to be routed to the redmine instance where they originated, and be incorporated into the issue.

The attached tarball of .diff files is for:
redmine-4.1.1
ruby 2.6.6p146 (not relevant)
Rails 5.2.4.2 (provides base mailer, not especially relevant)
mysql 5.7 (not relevant)
plugins: Additionals (not relevant)


Files

reply_to.tar (7.5 KB) reply_to.tar diff files Gary Aitken, 2021-03-04 03:31
Actions #1

Updated by Marius BĂLTEANU over 3 years ago

  • Status changed from New to Needs feedback

You can set in_reply: <address> in email_delivery settings from configuration.yml (source:trunk/config/configuration.yml.example#L15). It's not enough?

https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration

Actions #2

Updated by Gary Aitken over 3 years ago

Marius BALTEANU wrote:

You can set in_reply: <address> in email_delivery settings from configuration.yml (source:trunk/config/configuration.yml.example#L15). It's not enough?

Is that actually possible in all cases? I just tried setting from:, reply_to:, in_reply:, and sender: for a delivery method of :sendmail and got "mapping values are not allowed in this context". So while it may be allowed for a delivery method of :smtp, it doesn't appear to be allowed for a delivery method of :sendmail.

However, even if it were, that raises the question -- why does redmine provide a way to set the sender in the outgoing email settings, when (if it worked in all cases) presumably that could also be set in configuration.yml?

Actions #3

Updated by Marius BĂLTEANU over 3 years ago

Gary Aitken wrote:

Is that actually possible in all cases? I just tried setting from:, reply_to:, in_reply:, and sender: for a delivery method of :sendmail and got "mapping values are not allowed in this context". So while it may be allowed for a delivery method of :smtp, it doesn't appear to be allowed for a delivery method of :sendmail.

Can you show me how your configuration looks (please anonymise your data)? For example, the following works for me:

  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "maildev" 
      port: 25
      enable_starttls_auto: false
    default_options:
      reply_to: noreply@example.com

According to Rails configuration, default_options is not a setting related only to smtp delivery method.

However, even if it were, that raises the question -- why does redmine provide a way to set the sender in the outgoing email settings, when (if it worked in all cases) presumably that could also be set in configuration.yml?

The setting has 14 years old and unfortunately, I cannot say why was made configurable in the Administration.

Actions #4

Updated by Gary Aitken over 3 years ago

Normally, configuration.yml looks like this:

default:
  email_delivery:
    delivery_method: :sendmail

and that's it.
There is no additional smtp configuration.

If I modify it to look like this:

default:
  email_delivery:
    delivery_method: :sendmail
    smtp_settings:
      reply_to: user@domain.com

and send a test mail, there is no reply-to field in the message which is sent.

In this installation, the mail is sent via the postfix (not sendmail) /usr/sbin/sendmail command, which delivers to the local postfix installation, which relays over smtp through a gmail relay using their extra level of authentication. I don't know much about how the postfix sendmail command works, except that you can run it from the command line. In order to get a reply-to header, you have to add it in the output yourself, like so:

$ sendmail user@domain.com
Subject: Test from mydomain.com using "sendmail" 
Reply-to: foo@mydomain.com
some text
.
Actions #5

Updated by Marius BĂLTEANU over 3 years ago

This is incorrect:

default:
  email_delivery:
    delivery_method: :sendmail
    smtp_settings:
      reply_to: user@domain.com

reply_to is not an attribute of smtp_settings, it is of default_options.

Please try with the following:

default:
  email_delivery:
    delivery_method: :sendmail
    default_options:
      reply_to: user@domain.com

Actions #6

Updated by Gary Aitken over 3 years ago

That worked fine.
My appologies for taking up your time.

Actions #7

Updated by Marius BĂLTEANU over 3 years ago

  • Tracker changed from Patch to Feature
  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

Gary Aitken wrote:

That worked fine.
My appologies for taking up your time.

Great! I'm closing this.

Actions

Also available in: Atom PDF