这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@emersion
Copy link
Owner

See each commit.

Should we add SetMessageID, or wait till someone needs it?

cc @foxcpp

This allows us to hide the brackets logic away from the library users.

While at it, check rand.Read's return value and make the function
return an error when applicable.

The test is changed to use our Message-Id parser to check the generated
value instead of the regexp.
@foxcpp
Copy link
Collaborator

foxcpp commented Feb 15, 2020

Should we add SetMessageID, or wait till someone needs it?

If it is SetMessageID(id string), then it is not a big deal since it would be literally h.Set("Message-ID", "<" + id + ">"). In fact, I think most users that need it will miss our amazing helper function and just do h.Set!

@emersion
Copy link
Owner Author

emersion commented Feb 15, 2020

Indeed. Header.SetMsgIDList is more helpful since most people would separate each msg-id with a comma instead of a space. It also allows users to easily parse, add a new msg-id, and format a References field.

@emersion emersion merged commit 5cde435 into master Aug 24, 2020
@emersion emersion deleted the msg-id-setters branch August 24, 2020 20:51
@emersion emersion added the breaking Breaking change label Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants