mailin icon indicating copy to clipboard operation
mailin copied to clipboard

Duplicated params?

Open 2naive opened this issue 11 years ago • 5 comments

Hi!

Could you please explain the difference between envelopeFrom/envelopeTo and from/to?

Thank you!

2naive avatar Jan 07 '15 16:01 2naive

Btw, in case of Russian language I got:

"headers" ... "from":"Александр<[email protected]>"
"from":[{"address":"[email protected]","name":"Александр"}]

but

"envelopeFrom":[{"address":"[email protected]","name":""}]

Why?

2naive avatar Jan 09 '15 07:01 2naive

Actually, these are not duplicated params, they come from the specification of the SMTP protocol itself. Here comes an explanation, shamelessly pasted from utcc.utoronto.ca/usg/technotes/smtp-intro.html:

Just like physical letters, SMTP email has two different sets of address information: the envelope headers, like the addresses on the outside of an envelope, which are used by mail transport software to route and deliver the email, and the normal headers, which are part of the mail message and which are only read and interpreted by the user and his software, just like the address attached to a salutation at the start of a physical letter. Unlike the post office, SMTP usually throws away most of the envelope before it hands the message to the user, so many users are not aware of the envelope headers.

In fact, SMTP never looks at the message headers at all; as far as SMTP is concerned, the email message (headers and all) is just one big blob that it shuttles around. Many SMTP clients are perfectly happy to deliver email with badly broken or entirely nonexistent message headers.

And some handy links: www.pobox.com/helpspot/index.php?pg=kb.page&id=260 stackoverflow.com/questions/4367358/whats-the-difference-between-sender-from-and-return-path

Hope this helps!

Flolagale avatar Jan 12 '15 09:01 Flolagale

Okay, thank you for clarifying, but could you aslo anser to my 2nd post?

https://github.com/Flolagale/mailin/blob/master/lib/mailin.js#L296 Why Cyrillic envelopeFrom.name is not properly parsed, while from.name is?

At the same time if name is latin - everything is OK.

Thanks!

2naive avatar Jan 13 '15 04:01 2naive

This one looks like a bug from the addressparser package because of the missing space between the name and the '<' char.

Flolagale avatar Jan 13 '15 09:01 Flolagale

What would be the solution?

2naive avatar Jan 13 '15 17:01 2naive