fix: allow empty From address to match with TakeMsg

This commit is contained in:
Carl-Friedrich Braun 2023-01-02 12:11:15 +01:00
parent 01ff37a9c5
commit 7c9138decf

View file

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