Mail/mailx use UUCP from line to determine sender, it should use the From: header only. To achieve this you can use the undocumented "from" mail variable in your .mailrc: "set from".
To make this the default behavior, add "set from" to /etc/mail/mailx.rc.