// Package mode provides a domain-local ACL mode indicator readable by // packages that need to know the current access control mode without // circular dependencies. package mode // ACLMode holds the current ACL mode. Plain variable - single // cooperative thread per domain, no atomic needed. var ACLMode []byte // IsOpenMode reports whether an ACL mode value means an open relay. func IsOpenMode(m []byte) (ok bool) { return len(m) == 4 && m[0] == 'n' && m[1] == 'o' && m[2] == 'n' && m[3] == 'e' } // IsOpen returns true if the current ACL mode is "none" (open relay mode). func IsOpen() (ok bool) { return IsOpenMode(ACLMode) }