-
Notifications
You must be signed in to change notification settings - Fork 59
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
Message-Id improperly formatted #41
Comments
@leanne63 Thanks for pointing this out! I tried implementing a fix and have tagged a release. Would you like to give it a try? https://github.com/IBM-Swift/Swift-SMTP/releases/tag/1.1.0 |
Also didn't mean to close the issue--accident. |
So, it does work, @quanvo87 . However, I was thinking of a solution more similar to the following:
That doesn't break the API. It also saves the library user from having to determine/code a separate hostname in the email initialization, when the sender's email domain will work just fine. |
@leanne63 I like that this doesn't break the API. There are some things I am looking into:
|
To answer your questions in short:
The spec doesn't say exactly what we need to put in the right-hand side of the "@" in a message-id.
The spec says the right-hand side of the "@" needs to be a "dot-atom-text" - which means Here are some quotes from the spec to explain in more detail:
This one means that we can put anything there, within the context of our implementation. It doesn't even have to be a domain name, but it's recommended to be. In our context, I only really see two possible domains: the logged in SMTP user and the sender. We have easy access to the sender via the "From:" field; however, it would take more code manipulation to use the logged in SMTP user's domain. Also, I haven't seen any spam filters freak out based on which field is used here during my testing so far.
This is the definition of a Note also that the spec says that Therefore, the |
Awesome, thanks for the breakdown! I see no reason not to go with your implementation then. Were you working on a PR? Otherwise, I'll revert my changes, and add what you have suggested. |
I can do a PR. I'll get it out there sometime today. |
https://github.com/IBM-Swift/Swift-SMTP/releases/tag/v1.1.2 @leanne63 merged and tagged. Thank you! |
Problem:
Based on the current MESSAGE-ID format (as of v1.0.8), messages sent via Swift-SMTP are being marked as spam.
For example, Google changes the MESSAGE-ID value from
C3740F09-A2C0-4A84-A382-85FE08C87556.Swift-SMTP
for Gmail recipients to
<59971d49.8153650a.c8814.4b18SMTPIN_ADDED_BROKEN@mx.google.com>
and sends the message to the spam folder.
The correct format for the MESSAGE-ID field, as specified in RFC 5322, is:
"dot-atom-text" represents text, followed by a ".", followed by more text.
Solution:
To prevent Swift-SMTP messages from being marked as spam due to incorrect formatting, I propose coding the MESSAGE-ID field to contain a value like the following:
<B5B87EC6-683B-4A7D-AC8C-31F85BA01570.Swift-SMTP@senderdomain.com>
The text was updated successfully, but these errors were encountered: