aboutsummaryrefslogtreecommitdiff
blob: a9892380b6abd5c76f10b5ee0d4ff267ffe40b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package importer

import (
	"archives/pkg/config"
	"log"
	"os"
	"path/filepath"
)

func FullImport() {
	err := filepath.Walk(config.MailDirPath(),
		func(path string, info os.FileInfo, err error) error {
			if err != nil {
				return err
			}
			if !info.IsDir() && getDepth(path, config.MailDirPath()) >= 1 {
				importMail(info.Name(), path, config.MailDirPath())
			}
			return nil
		})
	if err != nil {
		log.Println(err)
	}
}