commit 7efdecef7fecf38257ca5f9d8eae435b16e37e24 from: Oliver Lowe date: Thu Apr 14 01:39:15 2022 UTC cmd/mailmux: create aliases file if it doesn't already exist commit - 83ecec5237b3e6799dff09be2f7a88f5ca49a3b8 commit + 7efdecef7fecf38257ca5f9d8eae435b16e37e24 blob - 2268c0bbc3a4bc267fa190f33f09466256ae4928 blob + 5373d46e3aabb175b56ac070c0b75feb61afa2ce --- cmd/mailmux/mailmux.go +++ cmd/mailmux/mailmux.go @@ -151,6 +151,9 @@ func main() { srv.aliaspath = path.Join(cdir, "/mailmux/aliases") srv.aliases, err = aliases.Load(srv.aliaspath) + if errors.Is(err, fs.ErrNotExist) { + _, err = os.Create(path.Join(cdir, "/mailmux/aliases")) + } if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1)