func NewLocalStorage(dir string) (storage Storage, err error) {
	if len(dir) == 0 {
		dir = defDirSpool
	}
	err = os.MkdirAll(dir, 0700)
	if err != nil {
		return nil, err
	}
	dirBounce := filepath.Join(dir, defDirBounce)
	err = os.MkdirAll(dirBounce, 0700)
	if err != nil {
		return nil, err
	}
	fs := &LocalStorage{
		dir: dir,
	}
	fs.enc = gob.NewEncoder(&fs.buff)
	fs.dec = gob.NewDecoder(&fs.buff)
	return fs, nil
}
NewLocalStorage create and initialize new file storage.  If directory is
empty, the default storage is located at "/var/spool/smtp/".
package smtp
import (
	"bytes"
	"encoding/gob"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
)
const (
	defDirBounce = "bounce"
	defDirSpool  = "/var/spool/smtp"
)
type LocalStorage struct {
	dir  string
	buff bytes.Buffer
	enc  *gob.Encoder
	dec  *gob.Decoder
}