I've got sendmail running on a linux box. Let's say the hostname of the box is bar.com. If I run the following command, I don't receive the email (which is hosted with a third party), presumably due to the hostname pointing to the local machine.
echo "Test Body" | mail -s "Test Subject" firstname.lastname@example.org
Is there any way to get this to work so that I can receive emails at my third party email address even though it has the same hostname? Do I have to change the hostname of this server (not preferred)?
It may be worth noting that I created a user "foo" on my machine and noticed that the mailbox for that account is empty.
I noticed these log entries, which may or may not be relevant:
Jun 28 01:09:48 bar sendmail: p5S59min014338: from=apache, size=80, class=0, nrcpts=1, msgid=<201106280509.p5S59min014338@bar.com>, relay=apache@localhost Jun 28 01:09:48 bar sendmail: p5S59mIA014339: from=<email@example.com>, size=293, class=0, nrcpts=1, msgid=<201106280509.p5S59min014338@bar.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.$ Jun 28 01:09:48 bar sendmail: p5S59min014338: firstname.lastname@example.org, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30080, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p5S59mIA$ Jun 28 01:09:48 bar sendmail: p5S59mIA014339: to=<email@example.com>, ctladdr=<firstname.lastname@example.org> (48/48), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30495, dsn=2.0.0, stat=Sent