added IMAP, LetsEncrypt, update layout
This commit is contained in:
@@ -216,6 +216,23 @@ func stripExistingSignature(content string) string {
|
||||
return strings.Join(out, "\n")
|
||||
}
|
||||
|
||||
// VerifyInbound checks whether content carries at least one valid DKIM signature
|
||||
// aligned to domainName (typically the From-header domain), mirroring Sign's
|
||||
// error-swallowing-to-false style. Used only as one signal feeding the inbound spam
|
||||
// heuristic (internal/mailstore) — never blocks delivery by itself.
|
||||
func VerifyInbound(content, domainName string) bool {
|
||||
verifications, err := msgdkim.Verify(strings.NewReader(content))
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
for _, v := range verifications {
|
||||
if v.Err == nil && strings.EqualFold(v.Domain, domainName) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetActiveCustomHeaders mirrors DKIMManager.get_active_custom_headers.
|
||||
func (m *Manager) GetActiveCustomHeaders(domainName string) ([][2]string, error) {
|
||||
dom, err := m.DB.GetDomainByName(domainName)
|
||||
|
||||
Reference in New Issue
Block a user