Reorganize cmd init functions

This commit is contained in:
kolaente 2020-06-13 19:44:45 +02:00
parent d9d00ba60c
commit f5e44d9eb3
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
4 changed files with 22 additions and 7 deletions

View file

@ -30,6 +30,12 @@ var testmailCmd = &cobra.Command{
Use: "testmail [email]",
Short: "Send a test mail using the configured smtp connection",
Args: cobra.ExactArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
lightInit()
// Start the mail daemon
mail.StartMailDaemon()
},
Run: func(cmd *cobra.Command, args []string) {
log.Info("Sending testmail...")
email := args[0]