func (c *Client) Auth(username, password string) (err error) {
	err = c.User(username)
	if err != nil {
		return
	}
	err = c.Pass(password)
	return
}
Auth sends the given username and password to the server, calling the User
and Pass methods as appropriate.
package pop3
import (
	"bufio"
	"crypto/tls"
	"errors"
	"fmt"
	"net"
	"strconv"
	"strings"
)
type Client struct {
	conn net.Conn
	bin  *bufio.Reader
}
func Dial(addr string) (*Client, error) {
	conn, err := net.Dial("tcp", addr)
	if err != nil {
		return nil, err
	}
	return NewClient(conn)
}
func DialTLS(addr string) (*Client, error) {
	conn, err := tls.Dial("tcp", addr, nil)
	if err != nil {
		return nil, err
	}
	return NewClient(conn)
}
func NewClient(conn net.Conn) (*Client, error) {
	client := &Client{
		bin:  bufio.NewReader(conn),
		conn: conn,
	}
	_, err := client.Cmd("")
	if err != nil {
		return nil, err
	}
	return client, nil
}
func (c *Client) Cmd(format string, args ...interface{}) (string, error) {
	fmt.Fprintf(c.conn, format, args...)
	line, _, err := c.bin.ReadLine()
	if err != nil { return "", err }
	l := string(line)
	if l[0:3] != "+OK" {
		err = errors.New(l[5:])
	}
	if len(l) >= 4 {
		return l[4:], err
	}
	return "", err
}
func (c *Client) ReadLines() (lines []string, err error) {
	lines = make([]string, 0)
	l, _, err := c.bin.ReadLine()
	line := string(l)
	for err == nil && line != "." {
		if len(line) > 0 && line[0] == '.' {
			line = line[1:]
		}
		lines = append(lines, line)
		l, _, err = c.bin.ReadLine()
		line = string(l)
	}
	return
}
func (c *Client) User(username string) (err error) {
	_, err = c.Cmd("USER %s\r\n", username)
	return
}
func (c *Client) Pass(password string) (err error) {
	_, err = c.Cmd("PASS %s\r\n", password)
	return
}