emersion / go-milter

Go library to write mail filters
BSD 2-Clause "Simplified" License
42 stars 19 forks source link

Suggestion: Rename 2 methods: Headers -> EOH, Body -> EOM #25

Open iredmail opened 2 years ago

iredmail commented 2 years ago

Dear all,

After read the Sendmail Milter document, i think 2 interface methods are not clear enough and i suggest renaming them:

Both Sendmail and Postfix documents use "EOH" and "EOM", and their meanings are clearer. If this suggestion is accepted, i will send a new PR to rename them.

emersion commented 2 years ago

These 3-letter codes are pretty cryptic TBH. Maybe EndOfHeader/EndOfMessage would be more appropriate...

iredmail commented 2 years ago

These 3-letter codes are pretty cryptic TBH.

Agree. But since this library is all about milter, and "EOH", "EOM" are used by milter doc, it should be clear enough in our situation.

But i'm ok with EndOfHeader and EndOfMessage too. Just give me the final decision. :) By the way, we should use EndOfHeaders (ends with a s) instead of EndOfHeader.

emersion commented 11 months ago

By the way, we should use EndOfHeaders (ends with a s) instead of EndOfHeader.

The RFC folks say that it's an abuse to use "headers" (plural) when referring to a single message. Each message has exactly one header and multiple header fields.

tdewolff commented 8 months ago

Agreed with renaming the methods, it was confusing when reading about milters in other places.

Another confusion is that you can't modify headers from the HeaderField (currently Header) nor EndOfHeader (currently Headers) functions, but they do supply a Modifier argument, why? Same for Connect, Helo, RcptTo, MailFrom, and BodyChunk functions.