Skip to content

Commit

Permalink
modify/dkim: Remove require_sender_match from code
Browse files Browse the repository at this point in the history
  • Loading branch information
foxcpp authored and shift committed Jul 5, 2022
1 parent 51184e2 commit 79488ed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
12 changes: 0 additions & 12 deletions internal/modify/dkim/dkim.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ type Modifier struct {
bodyCanon dkim.Canonicalization
sigExpiry time.Duration
hash crypto.Hash
senderMatch map[string]struct{}
multipleFromOk bool
signSubdomains bool

Expand Down Expand Up @@ -145,7 +144,6 @@ func (m *Modifier) Init(cfg *config.Map) error {
hashName string
keyPathTemplate string
newKeyAlgo string
senderMatch []string
)

cfg.Bool("debug", true, false, &m.log.Debug)
Expand All @@ -165,8 +163,6 @@ func (m *Modifier) Init(cfg *config.Map) error {
[]string{"sha256"}, "sha256", &hashName)
cfg.Enum("newkey_algo", false, false,
[]string{"rsa4096", "rsa2048", "ed25519"}, "rsa2048", &newKeyAlgo)
cfg.EnumList("require_sender_match", false, false,
[]string{"envelope", "auth_domain", "auth_user", "off"}, []string{"envelope", "auth"}, &senderMatch)
cfg.Bool("allow_multiple_from", false, false, &m.multipleFromOk)
cfg.Bool("sign_subdomains", false, false, &m.signSubdomains)

Expand All @@ -184,14 +180,6 @@ func (m *Modifier) Init(cfg *config.Map) error {
return errors.New("sign_domain: only one domain is supported when sign_subdomains is enabled")
}

m.senderMatch = make(map[string]struct{}, len(senderMatch))
for _, method := range senderMatch {
m.senderMatch[method] = struct{}{}
}
if _, off := m.senderMatch["off"]; off && len(senderMatch) != 1 {
return errors.New("sign_domain: require_sender_match: 'off' should not be combined with other methods")
}

m.hash = hashFuncs[hashName]
if m.hash == 0 {
panic("modify.dkim.Init: Hash function allowed by config matcher but not present in hashFuncs")
Expand Down
4 changes: 0 additions & 4 deletions internal/modify/dkim/dkim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ func newTestModifier(t *testing.T, dir, keyAlgo string, domains []string) *Modif
Name: "key_path",
Args: []string{filepath.Join(dir, "{domain}.key")},
},
{
Name: "require_sender_match",
Args: []string{"off"},
},
{
Name: "newkey_algo",
Args: []string{keyAlgo},
Expand Down

0 comments on commit 79488ed

Please sign in to comment.