You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is really a bug, it's probably a common-sense issue, possibly a documentation issue, but I thought I'd raise it because it caused some fun in Ghost (see TryGhost/Ghost#4779).
Essentially, if the sender name contains a comma, then quotes are required.
In the README it says:
from - The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name sender@server.com', see here for details
To, cc and bcc are all explicitly stated as being comma-separated lists.
Under the Address Formatting section, the examples all show the sender name in quotes, E.g. '"Sender Name" sender@server.com', but a little further down in SMTP Envelope, it shows the sender address without quotes:
from: 'Daemon <deamon@kreata.ee>',
A sender name without quotes works perfectly fine, until your sender name includes a comma. To use a common example:
from: 'Wolfe, Hannah <hello@ghost.org>',
It seems at this point, what happens depends on what mail service you're using. Mailgun seems to figure this out as being from: 'Hannah <hello@ghost.org>', but sendmail (I think) seems to get utterly confused and send mail from 'anonymous <127.0.0.1>'.
It's probably not at all sensible to try to do use a dynamic sender name without the quotes, however it might be worth either updating the documentation to make sure all the examples contain the quotes, or perhaps implementing a fix or validation of some sort to prevent others from falling into the same trap.
Thanks for listening :)
The text was updated successfully, but these errors were encountered:
That's a valid point, I added a note about the comma to the Address Formatting section.
I think that mainly this is a cultural issue – in my locale (Estonian) nobody uses comma in their name, so I didn't ever think of it when I first created Nodemailer. In fact, the first Nodemailer cold-heartedly split the address field value on all commas with simple string.split(',') and thus it wasn't even possible to use commas in the name part. The support for commas turned out to be an actually required behavior, so I updated the module to accept commas in quoted strings as well.
Anyway, all address fields are lists, not single values, even from and that's by the standard. There's a separate field called sender to indicate who actually sent out the message if there's multiple from addresses – for example if you still live in the seventies, a bunch of people compose the message (these people are mentioned in the from header) and you send it out (you are on the sender field).
I'm not sure if this is really a bug, it's probably a common-sense issue, possibly a documentation issue, but I thought I'd raise it because it caused some fun in Ghost (see TryGhost/Ghost#4779).
Essentially, if the sender name contains a comma, then quotes are required.
In the README it says:
To, cc and bcc are all explicitly stated as being comma-separated lists.
Under the Address Formatting section, the examples all show the sender name in quotes, E.g. '"Sender Name" sender@server.com', but a little further down in SMTP Envelope, it shows the sender address without quotes:
from: 'Daemon <deamon@kreata.ee>',
A sender name without quotes works perfectly fine, until your sender name includes a comma. To use a common example:
from: 'Wolfe, Hannah <hello@ghost.org>',
It seems at this point, what happens depends on what mail service you're using. Mailgun seems to figure this out as being
from: 'Hannah <hello@ghost.org>',
but sendmail (I think) seems to get utterly confused and send mail from'anonymous <127.0.0.1>'
.It's probably not at all sensible to try to do use a dynamic sender name without the quotes, however it might be worth either updating the documentation to make sure all the examples contain the quotes, or perhaps implementing a fix or validation of some sort to prevent others from falling into the same trap.
Thanks for listening :)
The text was updated successfully, but these errors were encountered: