mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #132] SMTP relay error when one of multiple recipients doesn't exist #89
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#89
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 @luomoxu on GitHub (Jun 28, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/132
when send mail to multiple recipients,one of them dosn't exist,the reply will faild
@axllent commented on GitHub (Jun 28, 2023):
Maybe I do not understand the problem or question here, or what you expect to happen when an email address is invalid.
When Mailpit "releases" an email, it takes the original email, passes it to the relay SMTP server, and then tells the SMTP server who to send it to (an array of email addresses). Normally the relay server will accept the message, and then bounce and errors "back" to the sender, however I suspect Alibaba (based on your previous reports) immediately rejects the email to the client (Mailpit), and doesn't bounce and emails like other mail servers.
This error is being returned by your relay SMTP server.
Can you please tell me what you expected to happen?
@luomoxu commented on GitHub (Jun 28, 2023):
when I use postfix,the mail will send sucess,the not exist email will be ignore
I don't know It a smtp parameter or postfix auto remove the not exist email ?
@axllent commented on GitHub (Jun 28, 2023):
Yes, that is because postfix handles the email different to Alibaba - Mailpit is not postfix. I think what you need to understand here is the difference between the two. Mailpit acts like an email client when sending email. Postfix and Alibaba are email servers, however they handle errors obviously very differently.
So when you say postfix -> Alibaba works, what is actually happening is postfix accepts your message, and then bounces the error to the sender. If the sender cannot receive a message, then it is auto-deleted internally. If you check the postfix mail log you will see it there.
Again, I cannot change how Alibaba handles emails. If this is an issue for you then you will need to use another SMTP server unfortunately.
@luomoxu commented on GitHub (Jun 28, 2023):
I check the code,when one of recipients rcpt get error,the smtprelay will stop ,can ignore the error ,continue to execute
github.com/axllent/mailpit@70b604e028/server/smtpd/smtp.go (L89-L93)@axllent commented on GitHub (Jun 28, 2023):
In your case yes, changing this would possibly allow the message to be sent (assuming Alibaba allows the rest to go through). The issue I have is this: how would the web UI user know there had been an issue if I don't return an error? Ignoring rejrcted recipients would just mean the message just never arrives. Let me think about it a bit more before making a decision as this change affects everyone, not just you.
Did you check the postfix logs to see what it said about that rejected message? If so, could you please show me that log message?
@luomoxu commented on GitHub (Jun 29, 2023):
postfix log
@axllent commented on GitHub (Jun 29, 2023):
Thanks, this confirms my theory: The emails actually bounce (
status=bounced), except postfix actually deletes them because they cant send to @example.com. So in this case you would never know unless you looked in your postfix logs.I will make the change that will print out the error in the Mailpit log if the RCPT command fails, but it will still try and send anyway. If anything else fails in the SMTP transaction then that will return an error. Please note that there is no guarantee this will fix your issue, as from what I have seen Alibaba's SMTP server likes to close the connection when it doesn't like what it gets. I'll update you later once I have made the change.
@axllent commented on GitHub (Jun 30, 2023):
@luomoxu I have just added this in the latest release (v1.7.0). Please can you test and let me know if it solves your issue? Thank you.
@luomoxu commented on GitHub (Jul 3, 2023):
work fine for me
@axllent commented on GitHub (Jul 3, 2023):
Great, thanks.