1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

policy: Implement recipient domain policy for #51

- INBUCKET_SMTP_DEFAULTACCEPT
- INBUCKET_SMTP_ACCEPTDOMAINS
- INBUCKET_SMTP_REJECTDOMAINS
This commit is contained in:
James Hillyerd
2018-04-01 18:05:21 -07:00
parent 0b3c18eba9
commit a7d2b00a9c
8 changed files with 143 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"net/mail"
"strings"
)
// HashMailboxName accepts a mailbox name and hashes it. filestore uses this as
@@ -28,3 +29,20 @@ func StringAddressList(addrs []*mail.Address) []string {
}
return s
}
// SliceContains returns true if s is present in slice.
func SliceContains(slice []string, s string) bool {
for _, v := range slice {
if s == v {
return true
}
}
return false
}
// SliceToLower lowercases the contents of slice of strings.
func SliceToLower(slice []string) {
for i, s := range slice {
slice[i] = strings.ToLower(s)
}
}