Skip to content

Little confuse about msg's encoder #162

Answered by wneessen
RandalTeng asked this question in Q&A
Discussion options

You must be logged in to vote

I had notice that, every header (like subject) set in msg, will be encoded by msg.encoder, I want to know why do this? Is there any vulnerability about use origin content? If there is a image, I can get why need encoder, it can't be set to subject though...

That's basically how email works. Email only supports 7bit US-ASCII (with some exceptions in which mail servers support 8bit too). If you only use US-ASCII for your subjects and stuff, there is no need to encode it, but since go-mail supports full UTF-8, we need to encode the headers accordingly so that mail servers and clients can transfer and understand the content.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@wneessen
Comment options

@RandalTeng
Comment options

@wneessen
Comment options

Comment options

You must be logged in to vote
2 replies
@RandalTeng
Comment options

@wneessen
Comment options

Answer selected by RandalTeng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants