func (mg *Manager) Delete(fname string) (err error) {
	if len(fname) == 0 {
		return fmt.Errorf("email/maildir: Delete: empty file name")
	}
	fdel := filepath.Join(mg.dirCur, fname)
	err = os.Remove(fdel)
	if err != nil {
		return fmt.Errorf("email/maildir: Delete: %s", err.Error())
	}
	return nil
}
Delete email file in "cur".
package maildir
import (
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"time"
	libtime "github.com/shuLhan/share/lib/time"
)
type Manager struct {
	dirCur   string
	dirNew   string
	dirOut   string
	dirTmp   string
	hostname string
	pid      int
	counter  int
}
func New(dir string) (mg *Manager, err error) {
	if len(dir) == 0 {
		return nil, fmt.Errorf("email/maildir: New: empty base directory")
	}
	mg = &Manager{
		pid: os.Getpid(),
	}
	err = mg.initDirs(dir)
	if err != nil {
		return nil, err
	}
	mg.hostname, err = os.Hostname()
	if len(mg.hostname) == 0 && err != nil {
		mg.hostname = os.Getenv("HOST")
		if len(mg.hostname) == 0 {
			mg.hostname = "localhost"
		}
	}
	return mg, nil
}
func (mg *Manager) initDirs(dir string) (err error) {
	mg.dirCur = filepath.Join(dir, "cur")
	err = os.MkdirAll(mg.dirCur, 0750)
	if err != nil {
		return fmt.Errorf("email/maildir: initDirs: %s", err.Error())
	}
	mg.dirNew = filepath.Join(dir, "new")
	err = os.MkdirAll(mg.dirNew, 0750)
	if err != nil {
		return fmt.Errorf("email/maildir: initDirs: %s", err.Error())
	}
	mg.dirOut = filepath.Join(dir, "out")
	err = os.MkdirAll(mg.dirOut, 0700)
	if err != nil {
		return fmt.Errorf("email/maildir: initDirs: %s", err.Error())
	}
	mg.dirTmp = filepath.Join(dir, "tmp")
	err = os.MkdirAll(mg.dirTmp, 0700)
	if err != nil {
		return fmt.Errorf("email/maildir: initDirs: %s", err.Error())
	}
	return nil
}