3

I cannot get the mailx -r option to set the sender "From" field correctly.

echo "email text" | mail -s "test 123" -r donotreply@domain.com  user@domain.com

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

Nova
  • 1,234
  • 3
  • 12
  • 25
  • Not sure why I got downvoted - I guess I need to show that I did research. I tried using 'mail -s "test 123" user@domain.com -- -r donotreply@domain.com'. I have tried using 'sendmail. In all cases, no matter what the syntax, if I used "@fakedomain.com", the mail got sent. If I used a "@realdomain.com" (like my company name), the mail did not get sent. There was no error message nor a bounceback email. I do have a linux box where this all works. The /etc/mail.rc looks the same between both boxes. I am just not sure where else to look. – Nova Dec 28 '13 at 19:53
  • I figured it out. I am sitting on a server in a VPC so it does not have access to the real domain's mail server. I will have to convince my customer to use a fake domain, especially since this address is not for receiving emails anyway. – Nova Dec 30 '13 at 19:11

1 Answers1

1

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

Received-SPF: none (google.com: do-not-reply@blahblahfake.com does not designate permitted sender hosts) client-ip=54.201.xx.xx;

Real domain – caught in spam trap

Received-SPF: fail (google.com: domain of do-not-reply@real.com does not designate 54.201.90.208 as permitted sender) client-ip=54.201.xx.xx;

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.

Nova
  • 1,234
  • 3
  • 12
  • 25
  • I am also facing the same issue. is there any workaround for configuring real domain name in 'From' address? – Randhir Aug 18 '16 at 13:00