go-milter icon indicating copy to clipboard operation
go-milter copied to clipboard

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

Open iredmail opened this issue 3 years ago • 4 comments

Dear all,

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

  • Headers() -> EOH() (End of Headers)
  • Body() -> EOM() (End of Message)

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.

iredmail avatar Aug 22 '22 02:08 iredmail

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

emersion avatar Aug 22 '22 08:08 emersion

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.

iredmail avatar Aug 22 '22 10:08 iredmail

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.

emersion avatar Nov 10 '23 10:11 emersion

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.

tdewolff avatar Feb 17 '24 12:02 tdewolff