mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #421] Regression: Can no longer send To: headers with addresse names #271
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @navarr on GitHub (Jan 8, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/421
From: wardenenv/warden#830
When sending SMTP emails to Mailpit where the From address is in
Display Name <user@hostname>format (or"Display Name" <user@hostname>format, the email now fails to send.Such format complies with RFC 2822 Address Format
I believe this may be a regression from #409
@axllent commented on GitHub (Jan 8, 2025):
Potentially yes, but I'm not sure it's a bug in Mailpit but rather that it is more RFC compliant in the SMTP transactions. What changed in Mailpit is how it validates the SMTP transaction's
RCPT TO:command, which is typically sent fromsendmailto Mailpit.The first thing that stands out to me is the syntax being used here in the PHP
mail()command. The first parameter ($to) should be just an email address (or comma-separated email addresses), not the fullName <email>syntax. Nowhere could I find any examples of the name & email being used. The documentation is a bit vague though. I suspect that whatever sendmail implementation you are using is just using this string 1:1 for theRCPT TO:value, for instanceRCPT TO:<Test <me@navarr.me>>which is incorrect and non-RFC compliant. The only way to know for sure is to run Mailpit in verbose mode (eg:mailpit -v), however I don't know how it's implemented in warden. If you are able to, could you please configure the mailpit server to run with-vand then check the logs which will show you what is being transmitted when runningmail('Test <me@navarr.me>','Test Subject','Test Message',"From: me@navarr.me\r\n");?Secondly, I'm not able to replicate this locally, however I am using Mailpit's sendmail implementation which is far more forgiving - I don't know how warden's PHP
sendmail_pathis configured. Could you please shed some light on what sendmail implementation is being used by PHP to send to Mailpit?@navarr commented on GitHub (Jan 9, 2025):
Thank you @axllent for your in-depth response! I was able to confirm what you anticipated; which was that the sendmail program Warden was using was sending the To as-is to Mailpit. I have converted Warden from its current sendmail to using the Mailpit sendmail program and this solves the issue for PHP users who expect to be able to send To addresses in such a maner.
For reference, the sendmail program Warden was using was Mailhog's sendmail program. (We had accepted a PR to swap out Mailhog for Mailpit, but the sendmail program was left alone as it was working without issue).