Closed (won't fix)
Project:
HTML Mail
Version:
7.x-2.x-dev
Component:
Module compatibility
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2015 at 08:14 UTC
Updated:
12 Oct 2015 at 14:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
id.tarzanych commentedComment #3
salvisThank you for your report and patch!
For the sake of completeness, please mention a concrete case where this is an issue and how it manifests itself.
Has anyone seen this issue before?
Any testers/reviewers?
Comment #4
id.tarzanych commentedI'm pretty sure that almost all mail servers support this additional parameter.
But I've got errors on particular corporate mail server. Messages simply were not sent if custom Return-Path parameter had been set.
That's why I decided to provide additional config for HTML Mail module. Maybe that can help somebody else with the same problem
Comment #5
salvisI've looked at https://tools.ietf.org/html/rfc2821 and found that adding a Return-Path header would always be an error.
If a client module tries to set that header, then it violates the standard and needs to be fixed.
Comment #6
id.tarzanych commentedSorry for being stubborn. Return-Path is not sent in headers, but in additional parameters.
Let's look at Drupal Core code
...
So the Return-Path header is set.
Later in DefaultMailSystem class (and in HTMLMailSystem too) Return-Path is moved from headers to additional parameters
In htmlmail.mail.inc we have similar code
Of course to set that parameter, mail sending user needs to be a trusted user for mail system
I tried to contact system administrator to do that, but unsuccessfully
And I had to fix that problem ASAP.
So I decided to provide possibility not to add additional Return-Path
This situation happens rather hardly, but I think that additional option is helpful sometimes
Comment #7
salvisI see, we're not adding a header (although it feels that way), but we're setting the envelope from address.
But why is your site configured to try to set the envelope from address if your mailer chokes on it?
Every additional configuration option is a burden on everyone involved, users, support, and maintainers, and I'm very conservative about adding new options, especially if they serve only very few sites and their benefit could be implemented outside of the module with reasonable effort.
I see two possible approaches outside of HTML Mail:
1. Find out what module is trying to set the envelope from address and why. Reconfigure or fix that module to make that optional.
2. Implement hook_mail_alter() to remove the Return-Path 'header'.
P.S. As system administrator I would be reluctant to allow an application to set the envelope from address, too, especially if you don't don't have a valid reason but just try to satisfy some inconsiderate piece of software.
Comment #8
id.tarzanych commentedReturn-Path is set by Drupal Core, not a custom module
Look at includes/mail.inc, drupal_mail()
Well, I can cut down this param with a hook of course. As you wish.
Comment #9
salvisI see. Having the Return-Path be the same as the From address is probably the default and should be OK if it's a legal sender. That's probably why most mailers accept it.
I understand your reasoning, but I haven't found any similar issue in the queue, so this must be an isolated issue on your site and it doesn't make sense to add features/options for isolated cases.