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: email@example.com from: firstname.lastname@example.org 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: 41B6BBF88C: from=, size=297, nrcpt=1 (queue active) Jan 3 13:38:07 sdi-ci postfix/smtp: 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.