Patch #12493
closedFill the Return-Path email header with the correct email address
Added by Jérôme BATAILLE over 12 years ago. Updated about 8 years ago.
0%
Description
Value to use : Setting.mail_from
Patch made from Rails 1.2.1, I suppose it will work with more recent versions
Files
add_return_path_header.diff (575 Bytes) add_return_path_header.diff | Jérôme BATAILLE, 2012-12-03 17:16 | ||
add_return_path_header.diff (575 Bytes) add_return_path_header.diff | Jérôme BATAILLE, 2012-12-03 17:18 | ||
40-actionmailer_base_patch.rb (1.9 KB) 40-actionmailer_base_patch.rb | Jérôme BATAILLE, 2013-07-23 17:59 | ||
40-actionmailer_base_patch.rb (1.85 KB) 40-actionmailer_base_patch.rb | domain name email address to adapt to your company | Jérôme BATAILLE, 2013-07-23 18:05 |
Updated by Jérôme BATAILLE over 12 years ago
Updated by Jan Niggemann (redmine.org team member) about 12 years ago
RFC2821:
When the delivery SMTP server makes the "final delivery" of a message, it inserts a return-path line at the beginning of the mail data.
http://stackoverflow.com/questions/1235534/what-is-the-behavior-difference-between-return-path-reply-to-and-from:
The Return-Path (sometimes called the Reverse-Path or Envelope-FROM -- all of these terms can be used interchangeably) is the value used during the SMTP session. As you can see, this does not need to be the same value that is actually found in the mail headers. Only the recipient's mail server is supposed to add a Return-Path header to the top of the email. This records the actual Return-Path sender during the SMTP session. If a Return-Path header is already exists in the email, then that header is to be removed, and replaced by the recipient's mail server.
Reading this, I don't think we need to implement this, what do you think?
Updated by Jérôme BATAILLE almost 12 years ago
Hi again, I had to add a Return-Path header in emails send by a Redmine instance.
I think that only the sender can determine a correct (non default) Return-Path.
The case is the following :
E-mails are send with the default email address : admin@yourcompany.com
But we want that the real user initiating the action receives the bounce emails, because he will be the one knowing how to fix wrong recipients emails (and not the application adminstrators that have other cats to whip :-) ).
We use this and it works perfectly well with exim on the application server and zimbra as the final company mail server.
Updated by Jérôme BATAILLE almost 12 years ago
Here is a patch based on ActionMailer (override of actionmailer-2.3.14/lib/action_mailer/base.rb)
to put in config/initializers/
So no need of a Redmine update
Updated by Jérôme BATAILLE almost 12 years ago
Updated by Jérôme BATAILLE almost 11 years ago
We now override the Mailer model initialize method
with :
def initialize_with_return_path(*args)
initialize_without_return_path(*args)
# Specific : Return-path changed for the user making the change
# Only for company members (*@[country_iso_code.]smile[-<country>].[extension])
if (
User.current.mail.present? &&
(
# A regexp to identify your company users by their email
# You can use something else
/@([a-z]+\.)?smile(-[a-zA-Z1-9]+|)?\.[a-z]+$/.match(User.current.mail)
)
)
headers['Return-Path'] = User.current.mail
# Rails.logger.debug "==>mail Return-Path=#{headers['Return-Path']} (#{User.current.mail})"
end
# END -- Specific
end
Updated by Jérôme BATAILLE almost 11 years ago
- Status changed from New to Resolved
This patch is specific to each company, so it can't be integrated to the code core.
Updated by Toshi MARUYAMA almost 11 years ago
- Status changed from Resolved to Closed
Updated by Jérôme BATAILLE about 8 years ago
Hi, you can indicate in the Resolution that's it Won't be Fixed, if you have the time to, thanks a lot.
Updated by Toshi MARUYAMA about 8 years ago
Jérôme BATAILLE wrote:
Hi, you can indicate in the Resolution that's it Won't be Fixed, if you have the time to, thanks a lot.
"Patch" tracker does not have "Resolution" filed.