Support Apple Mail MBOX export format

This commit is contained in:
Michal Horejsek
2020-10-22 13:46:03 +02:00
parent fe5f73d96e
commit 1286e57b63
8 changed files with 105 additions and 6 deletions

View File

@ -67,7 +67,7 @@ func (p *MBOXProvider) TransferTo(rules transferRules, progress *Progress, ch ch
}
func (p *MBOXProvider) getFilePathsPerFolder() (map[string][]string, error) {
filePaths, err := getFilePathsWithSuffix(p.root, ".mbox")
filePaths, err := getAllPathsWithSuffix(p.root, ".mbox")
if err != nil {
return nil, err
}
@ -75,6 +75,12 @@ func (p *MBOXProvider) getFilePathsPerFolder() (map[string][]string, error) {
filePathsMap := map[string][]string{}
for _, filePath := range filePaths {
fileName := filepath.Base(filePath)
filePath, err := p.handleAppleMailMBOXStructure(filePath)
// Skip unsupported MBOX structures. It was already filtered out in configuration step.
if err != nil {
continue
}
folder := strings.TrimSuffix(fileName, ".mbox")
filePathsMap[folder] = append(filePathsMap[folder], filePath)
}