Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #49687, comment 12


Ignore:
Timestamp:
08/04/2025 12:02:48 PM (10 months ago)
Author:
SirLouen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #49687, comment 12

    initial v1  
    1 After some research, not having Sender "enabled" doesn't mean that the deliverability is not guaranteed. With proper handling of the `From:` header, things could work as if there was a `Sender`
     1I need to update this report because after some additional research, I can't really figure out which are the problems with a missing Sender
    22
    3 There are multiple workarounds: one is directly using `sendmail` hooking via `phpmailer_init` and adding `$phpmailer->isSendmail()` (which essentially is going to be the same as using the default function, but without the passthrough).
     3Initially I thought that the problem was that, by default, the `wp_mail` takes PHP's default with `isMail`, which is not bad, but by default, PHPMailer doesn't help using the headers as it does with `sendSendMail` (with the `-t` parameter). But it happens that internally, PHP `mail` action is actually passing `-t`.
    44
    5 The problem here is that, by default, the `wp_mail` takes PHP's default with `isMail`, which is not bad, but by default, PHPMailer doesn't help using the headers as it does with `sendSendMail` (with the `-t` parameter).
    6 
    7 I've reported this upstream https://github.com/PHPMailer/PHPMailer/issues/3186 (if this is implemented it might partially alleviate this problem).
     5So at this point, we really need some reproduction test cases for why the absence of `Sender` is causing so much trouble.
    86
    97But still, as many of you have suggested, I can't see a reason not to use `-f` which is the best to ensure the best result, maximizing deliverability in all scenarios. Unfortunately, [38286] doesn't really explain which was the exact reproduction scenario where the problem occurred with `-f` leaving it to pure speculation. Now, most maintainers will be completely afraid of reverting this change, "just in case there is a regression."
    108
    119Personally, what I would suggest here is testing the major systems: `qmail`, `postfix` wrapper, and `sendmail` itself, and seeing whether this is still reproducible or not.
     10
     11Furthermore, another proposal that the PHPMailer maintainer proposed is to switch internally from `isMail` to `isSMTP` which is way more reliable than the internal `mail` function (since we are using `PHPMailer` after all). By default `isSMTP` is going to take localhost anyway (the same as `isMail`), but without the hassle of having to set everything with detail like `Sender` (and without having to deal with shell troubles, which are documented in the PHPMailer docs).
     12
     13For the reports, @kub1x and @jamieburchell, can you send some raw mails (headers) to further review your troubles?