aboutsummaryrefslogtreecommitdiff
blob: 379332c6483b0a752bb2419f129492c5c7b50480 (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
25
26
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 {
				if isPublicList(path) {
					importMail(info.Name(), path, config.MailDirPath())
				}
			}
			return nil
		})
	if err != nil {
		log.Println(err)
	}
}