I cannot get the mailx -r option to set the sender "From" field correctly.
echo "email text" | mail -s "test 123" -r [email protected] [email protected]
The email gets sent if the "-r" field is a fake domain. If it is a real domain, the email does not get sent. The username does not matter, only the domain name.
Where should I check to fix this?
RHEL6.4
The final result... I should have checked my spam folder. All the test emails using the real domain were in there.
Details:
Fake return domain – went through
Real domain – caught in spam trap
The reason is that the "real.com" domain uses a white list and this specific NAT IP was not added to that list. The fake domain was let through, probably because the mail policy is to let through too much instead of too little.