From 07385a6a89513ca349bc37d91f68482c38f81dcf Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 7 May 2024 07:55:22 -0400 Subject: [PATCH] change password file directly --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 2a773d9..25335d6 100644 --- a/main.go +++ b/main.go @@ -154,12 +154,12 @@ func modifyPasswordFile(email, password string) bool { // find the entry with the given email // replace the password with the new password // write the file back - in, err := os.ReadFile("/root/docker/mail/config/postfix-accounts") + in, err := os.ReadFile("/root/docker/mail/config/postfix-accounts.cf") if err != nil { log.Println(err) return false } - out, err := os.Create("/root/docker/mail/config/postfix-accounts.tmp") + out, err := os.Create("/root/docker/mail/config/postfix-accounts.cf.tmp") if err != nil { log.Println(err) return false @@ -174,7 +174,7 @@ func modifyPasswordFile(email, password string) bool { out.WriteString("\n") } out.Close() - os.Rename("/root/docker/mail/config/postfix-accounts.tmp", "/root/docker/mail/config/postfix-accounts") + os.Rename("/root/docker/mail/config/postfix-accounts.cf.tmp", "/root/docker/mail/config/postfix-accounts.cf") return true }