I have postfix installed(should be default install). I only set the relayhost to be the gateway I need to go through. I then use sendmail as a test but the gateway rejects my message and I see that in my postfix logs. The weird thing is in the logs the from email address is incorrect (probably my fault somehow but that is my question).

I have this file

 to: dean.hiller@yyyy.com
 from: dean.hiller@yyyy.com
 subject: hi there
 This is my body of the message

I then run sendmail with

 sendmail -t < email2

The postfix error is

Jan 3 13:38:07 sdi-ci postfix/qmgr[1157]: 41B6BBF88C: from=, size=297, nrcpt=1 (queue active) Jan 3 13:38:07 sdi-ci postfix/smtp[26034]: 41B6BBF88C: to=, relay=mailgate1.nrel.gov[192.666.555.555]:25, delay=590, delays=590/0.08/0.11/0.23, dsn=4.1.8, status=deferred (host mailgate1.nrel.gov[192.666.555.555] said: 450 4.1.8 : Sender address rejected: Domain not found (in reply to RCPT TO command))

EDIT: obviously yyyy.com is not my real domain and that is not my real ip. That is never a good idea to post so I always modify it. I fixed it by config in my below answer.


in /etc/postfix/main.cf, modifying mydomain and myorigin fixed the issue and setting mydomain to yyyy.com and myorigin to $mydomain fixed the issue.

mydomain = yyyy.com
myorigin = $mydomain



Did you literally use yyyy.com as a sender domain? Your postfix is rejecting the message, because the domain of the sender cannot be resolved, which can be read in this log bit:

Sender address rejected: Domain not found (in reply to RCPT TO command)

Other than that, did you alter the output of the log, because the resolved IP address of mailgate1.nrel.gov (192.666.555.555) is an invalid IPv4 address. IPv4 adresses can go no further than 255 per octet. So 666 and 555 are impossible values. It should resolve to

Those two things combined give a strong suspicion that your nameserver configuration is faulty. Make sure your /etc/resolv.conf file lists accessible nameservers to be used for domain name resolution.

  • all of those where fake as it is never a good practice to put your real ips and domain names out there. – Dean Hiller Jan 4 '13 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.