func Create(dir string) (Maildir, error) {
	m := Maildir{dir}
	for _, x := range []string{cur, tmp, nw} {
		if err := os.MkdirAll(path.Join(dir, x), 0766); err != nil {
			return m, err
		}
	}
	return m, nil
}
Create creates a maildir rooted at dir.
package maildir
import (
	"fmt"
	"io"
	"io/ioutil"
	"net/mail"
	"os"
	"path"
	"strconv"
	"strings"
	"sync/atomic"
	"time"
)
const (
	cur = "cur"
	tmp = "tmp"
	nw  = "new"
)
var (
	pid      int
	cntr     uint64
	hostname string
)
func init() {
	pid = os.Getpid()
	h, _ := os.Hostname()
	hostname = strings.Replace(strings.Replace(h, "/", "\057", -1), ":", "\072", -1)
}
type Key string
type Maildir struct {
	dir string
}