/*
   Syntax
     ARTICLE message-id
     ARTICLE number
     ARTICLE

   Responses

   First form (message-id specified)
     220 0|n message-id    Article follows (multi-line)
     430                   No article with that message-id

   Second form (article number specified)
     220 n message-id      Article follows (multi-line)
     412                   No newsgroup selected
     423                   No article with that number

   Third form (current article number used)
     220 n message-id      Article follows (multi-line)
     412                   No newsgroup selected
     420                   Current article number is invalid

   Parameters
     number        Requested article number
     n             Returned article number
     message-id    Article message-id
*/


Responses

First form (message-id specified)
220 0|n message-id    Article follows (multi-line)
430                   No article with that message-id

Second form (article number specified)
220 n message-id      Article follows (multi-line)
412                   No newsgroup selected
423                   No article with that number

Third form (current article number used)
220 n message-id      Article follows (multi-line)
412                   No newsgroup selected
420                   Current article number is invalid

Parameters
number        Requested article number
n             Returned article number
message-id    Article message-id
/ * Syntax ARTICLE message - id ARTICLE number ARTICLE Responses First form ( message - id specified ) 220 0|n message - id Article follows ( multi - line ) 430 No article with that message - id Second form ( article number specified ) 220 n message - id Article follows ( multi - line ) 412 No newsgroup selected 423 No article with that number Third form ( current article number used ) 220 n message - id Article follows ( multi - line ) 412 No newsgroup selected 420 Current article number is invalid Parameters number Requested article number n Returned article number message - id Article message - id * /
func handleArticle(args []string, s *session, c *textproto.Conn) error {
	article, err := s.getArticle(args)
	if err != nil {
		return err
	}
	c.PrintfLine("220 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)
		}
	}
	fmt.Fprintln(dw, "")
	_, err = io.Copy(dw, article.Body)
	return err
}
func handleArticle ( 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 ) } } fmt . Fprintln ( dw , " " ) _ , err = io . Copy ( dw , article . Body ) return err }