Return-Path is set to blank even if it is already set. As per the code comment, it is relying on MTA to rewrite the Return-Path.
And the Return-Path set by MTA is causing spf=temperror on gmail.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | mimemail-return-path-3089331-11.patch | 1.23 KB | chewi3 |
| #10 | mimemail-return-path-3089331-10.patch | 1.3 KB | ki |
| #2 | mimemail-return-path-3089331-2.patch | 1.25 KB | gbisht |
Issue fork mimemail-3089331
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gbisht commentedHere is a patch D8 from https://www.drupal.org/project/mimemail/issues/2463583
Comment #3
gbisht commentedComment #4
rivimeyThe code comment about the MTA is actually noting (correctly) that the local MTA (sendmail / postfix et al) might rewrite any value set in this code, so this value could be ignored. The code is left there because it is also true that the MTA might not do that.
I see the intent of your patch is to stop mimemail overriding the From/Sender/Return-Path headers unless their value is the default value, which is IMO a useful improvement. I would, however, think that a version that overrode whichever of those headers were actually set would be better.
I have triggered a new build, hoping that it doesn't fall over again. It would be good to take this patch forward or close it out.
Comment #5
rivimeyI see the build passed, which is good, but I do think this patch needs more thought. While it may well be good for particular use-cases, it is important to know it is good for all use-cases.
I think the next step should be to describe what the desired behavior of the module is with respect to the Return-Path setting.
Comment #6
imclean commented@rivimey,
We're using MIME Mail in a few of our projects and I'm actually wondering why MIME Mail sets certain headers at all. I'm interested in the history of why they were included, but presumably it was to help make sure email works out of the box in earlier versions of Drupal.
I see
mimeMailHeaders()can modifyFrom,SenderandReturn-Pathheaders. These aren't related to MIME and could potentially interfere with email generated by another module.If these headers need to modified further downstream then the relevant sending/SMTP module would be the place to do it.
See IANA's list of Message Headers for what protocol is responsible for what headers.
In the case of Drupal, the
Return-Pathheader shouldn't be set at all, but Drupal core does set it and has done for some time therefore most modules will try to maintain compatibility.Comment #7
tr commentedWe actually already have a Kernel test for MimeMailFormatHelper::mimeMailHeaders(), so that test should be modified to demonstrate the problem in this issue and thereby demonstrate that the proposed solution fixes the problem. Doing this is going to be the fastest way to get any changes put into the code.
Comment #8
tr commentedComment #9
tr commentedComment #10
ki commentedThe same patch working for 8.x-1.0-alpha4.
Comment #11
chewi3 commentedThe same patch rerolled for 2.0.1, in case anyone else needs it.
Comment #13
mark_fullmerComment #15
mark_fullmerBased on the direction indicated in Drupal core on #3055296: Setting the "Return-Path" header doesn't follow RFC 5321, it seems to me that the business logic regarding the Return-Path in mimemail should be as follows:
1. If the headers already have a Return-Path, make sure that is passed along unmodified.
2. If the headers do not have a Return-Path, do not generate one.
The merge request implements this logic and adds test coverage, demonstrating that an existing Return-Path is preserved and an absent one does not result in generation of a Return-Path. This second assertion matches the exact test assertion in #3055296: Setting the "Return-Path" header doesn't follow RFC 5321
Comment #17
mark_fullmer