/*
   Syntax
     HEAD message-id
     HEAD number
     HEAD


   First form (message-id specified)
     221 0|n message-id    Headers follow (multi-line)
     430                   No article with that message-id

   Second form (article number specified)
     221 n message-id      Headers follow (multi-line)
     412                   No newsgroup selected
     423                   No article with that number

   Third form (current article number used)
     221 n message-id      Headers follow (multi-line)
     412                   No newsgroup selected
     420                   Current article number is invalid
*/


First form (message-id specified)
221 0|n message-id    Headers follow (multi-line)
430                   No article with that message-id

Second form (article number specified)
221 n message-id      Headers follow (multi-line)
412                   No newsgroup selected
423                   No article with that number

Third form (current article number used)
221 n message-id      Headers follow (multi-line)
412                   No newsgroup selected
420                   Current article number is invalid
/ * Syntax HEAD message - id HEAD number HEAD First form ( message - id specified ) 221 0|n message - id Headers follow ( multi - line ) 430 No article with that message - id Second form ( article number specified ) 221 n message - id Headers follow ( multi - line ) 412 No newsgroup selected 423 No article with that number Third form ( current article number used ) 221 n message - id Headers follow ( multi - line ) 412 No newsgroup selected 420 Current article number is invalid * /
func handleHead(args []string, s *session, c *textproto.Conn) error {
	article, err := s.getArticle(args)
	if err != nil {
		return err
	}
	c.PrintfLine("221 1 %s", article.MessageID())
	dw := c.DotWriter()
	defer dw.Close()
	for k, v := range article.Header {
		kk := correctHeader(k)
		for _,vv := range v {
			fmt.Fprintf(dw, "%s: %s\r\n", kk, vv)
		}
	}
	return nil
}
func handleHead ( args [ ] string , s * session , c * textproto . Conn ) error { article , err := s . getArticle ( args ) if err != nil { return err } c . PrintfLine ( " " , article . MessageID ( ) ) dw := c . DotWriter ( ) defer dw . Close ( ) for k , v := range article . Header { kk := correctHeader ( k ) for _ , vv := range v { fmt . Fprintf ( dw , " \r \n " , kk , vv ) } } return nil }