2 // Copyright 2020 Blue Static <https://www.bluestatic.org>
3 // This program is free software licensed under the GNU General Public License,
4 // version 3.0. The full text of the license can be found in LICENSE.txt.
5 // SPDX-License-Identifier: GPL-3.0-only
14 "github.com/uber-go/zap"
18 if len(os.Args) != 2 {
19 fmt.Fprintf(os.Stderr, "Usage: %s config.json\n", os.Args[0])
23 configFile, err := os.Open(os.Args[1])
25 fmt.Fprintf(os.Stderr, "config file: %s\n", err)
30 if err := json.NewDecoder(configFile).Decode(&config); err != nil {
31 fmt.Fprintf(os.Stderr, "config file: %s\n", err)
36 log := zap.New(zap.NewTextEncoder())
38 pop3 := runPOP3Server(config, log)
39 smtp := runSMTPServer(config, log)
44 if cm == ServerControlRestart {
45 pop3 = runPOP3Server(config, log)
50 // smtp never reloads.