Merge pull request #561 from cfbraun/master

fix: allow empty From address to match with TakeMsg
This commit is contained in:
Max Mazurov 2023-01-02 22:47:27 +03:00 committed by GitHub
commit 99a60e5b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,10 +107,15 @@ func (s *Session) Reset() {
} }
func (s *Session) releaseLimits() { func (s *Session) releaseLimits() {
_, domain, err := address.Split(s.mailFrom) domain := ""
if err != nil { if s.mailFrom != "" {
return var err error
_, domain, err = address.Split(s.mailFrom)
if err != nil {
return
}
} }
addr, ok := s.msgMeta.Conn.RemoteAddr.(*net.TCPAddr) addr, ok := s.msgMeta.Conn.RemoteAddr.(*net.TCPAddr)
if !ok { if !ok {
addr = &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1)} addr = &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1)}