Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is generating of the Message-ID necessary? #2961

Closed
bugnumber9 opened this issue Sep 30, 2023 · 1 comment
Closed

Is generating of the Message-ID necessary? #2961

bugnumber9 opened this issue Sep 30, 2023 · 1 comment

Comments

@bugnumber9
Copy link

PHPMailer will generate a Message-ID automatically (unless we send a custom one via $phpmailer->MessageID).
But is this even necessary? The Message-ID is always set by the sending server.
I think it makes sense to either remove this feature or allow passing an empty string via $phpmailer->MessageID to have it generated on the server level.

@Synchro
Copy link
Member

Synchro commented Oct 1, 2023

RFC5322 3.6.4 says that senders should set an ID, but it is indeed optional.
In the majority of cases, PHPMailer is acting as the sending server. For example if you set Host to smtp.gmail.com, your script is the sender and gmail is the receiver. If you omit a message ID, there is no way for you to get it after sending, making it useless for keeping track of message threads. In that situation gmail will generate an ID, however it does so in a way that is identifiable, and spam filters can count that against you.
If you're DKIM signing, you really want the message ID in the signature, as it's the only reliable unique ID.
Overall, I'd say that if you don't care about message ID, then having PHPMailer generate it for you is a non-issue; if you do care, it's right there for you to set. I don't see any advantage in not setting one.

@Synchro Synchro closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants