This commit is contained in:
Aine
2022-09-05 17:02:00 +03:00
parent fda0d62087
commit 12a2d4c6f9
7 changed files with 163 additions and 5 deletions

View File

@@ -11,7 +11,9 @@ const acBotSettingsKey = "cc.etke.postmoogle.config"
// bot options keys
const (
botOptionUsers = "users"
botOptionUsers = "users"
botOptionDKIMSignature = "dkim.pub"
botOptionDKIMPrivateKey = "dkim.pem"
)
type botSettings map[string]string
@@ -40,6 +42,16 @@ func (s botSettings) Users() []string {
return []string{value}
}
// DKIMSignature (DNS TXT record)
func (s botSettings) DKIMSignature() string {
return s.Get(botOptionDKIMSignature)
}
// DKIMPrivateKey keep it secret
func (s botSettings) DKIMPrivateKey() string {
return s.Get(botOptionDKIMPrivateKey)
}
func (b *Bot) initBotUsers() ([]string, error) {
config := b.getBotSettings()
cfgUsers := config.Users()