author | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-10-03 00:03:55 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-10-09 23:51:05 UTC |
parent | 0e4182177969c2a0dc6df53870442d5c54d85752 |
internal/courier/smtp.go | +5 | -0 |
diff --git a/internal/courier/smtp.go b/internal/courier/smtp.go index 8c5f7f7..43361c6 100644 --- a/internal/courier/smtp.go +++ b/internal/courier/smtp.go @@ -4,6 +4,7 @@ import ( "crypto/tls" "flag" "net" + "os" "time" "github.com/golang/glog" @@ -69,6 +70,10 @@ retry: if err != nil { return tr.Errorf("Sender domain not IDNA compliant: %v", err), true } + if fromDomain == "" { + // This can happen when sending bounces. Last resort. + fromDomain, _ = os.Hostname() + } if err = c.Hello(fromDomain); err != nil { return tr.Errorf("Error saying hello: %v", err), false }