Exemple #1
0
func outlookToEmail(outfn, inpfn string) error {
	inp, err := openIn(inpfn)
	if err != nil {
		return err
	}
	out, err := openOut(outfn)
	if err != nil {
		return err
	}
	defer func() {
		if closeErr := out.Close(); closeErr != nil {
			logger.Error("msg", "Close", "error", err)
			if err == nil {
				err = closeErr
			}
		}
	}()
	var r io.ReadCloser
	r, err = converter.NewOLEStorageReader(inp)
	if err != nil {
		return err
	}
	_, err = io.Copy(out, r)
	_ = r.Close()
	return err
}
Exemple #2
0
func outlookToEmailEP(ctx context.Context, request interface{}) (response interface{}, err error) {
	f := request.(reqFile)
	defer f.Close()
	return converter.NewOLEStorageReader(f)
}