func (q *mailQueue) Pop() (msg mailstore.Message, has bool) {
	msgs, err := q.md.listDir("new")
	if err == nil && len(msgs) > 0 {
		for _, m := range msgs {
			q.md.ProcessNew(m)
		}
	}
	msgs, err = q.md.ListCur()
	if err == nil && len(msgs) > 0 {
		if msgs[0].Filepath() == q.last {
			return
		}
		msg = msgs[0]
		q.last = msg.Filepath()
		has = true
	}
	return
}
move all new messages into cur pop one from cur
package maildir
import (
	"github.com/majestrate/bdsmail/lib/mailstore"
	"io"
	"os"
)
type mailQueue struct {
	md   MailDir
	last string
}
func (q *mailQueue) Ensure() error {
	return q.md.Ensure()
}
func (q *mailQueue) Offer(msg mailstore.Message) (err error) {
	var f io.ReadCloser
	f, err = os.Open(msg.Filepath())
	if err == nil {
		_, err = q.md.Deliver(f)
		f.Close()
	}
	return
}