# sendmail question (linux)

**URL:** <https://boards.straightdope.com/t/sendmail-question-linux/158565>\
**Category:** Factual Questions\
**Created:** [March 2, 2003, 8:50am UTC](https://boards.straightdope.com/t/sendmail-question-linux/158565 "2003-03-02T08:50:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)\
**Post date:** [March 2, 2003, 8:50am UTC](https://boards.straightdope.com/t/sendmail-question-linux/158565/1 "2003-03-02T08:50:25Z")

</div>

I just configured my sendmail to be able to send & receive mail to/from the internet, and it’s working like a champ except for one thing:

return address is coming up as [user@host.domain.net](mailto:user@host.domain.net) instead of [user@domain.net](mailto:user@domain.net). Yeah, it’s a minor thing, but it’s bugging me to no end.

Relevant information includes the fact that I’m behind a router, with ports 1 to 110 forwarded to the linux machine. I’m running a dns on that machine, which, obviously, is the primary dns for my domain and network. (originally thought this could be it - that sendmail is doing a gethostbyaddress on itself, until I realized that the linux box has an address of 192.168.1.2, being behind the router and all.) After I post this, I’m going to examine my /etc/hosts and see if that has anything to do with it.

Any ideas on how I can get this to stop?

---

<div class="post-metadata">

**Author:** ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)\
**Post date:** [March 2, 2003, 8:53am UTC](https://boards.straightdope.com/t/sendmail-question-linux/158565/2 "2003-03-02T08:53:46Z")

</div>

Ideally, even though the machine has a hostname and domain name, sendmail should be able to use just the domain name, right? After all, having mail sent from [mail.foo.com](http://mail.foo.com) appear as [user@foo.com](mailto:user@foo.com) is pretty common, right?

---

<div class="post-metadata">

**Author:** ![sweepkick](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@sweepkick](https://boards.straightdope.com/u/sweepkick)\
**Post date:** [March 2, 2003, 12:08pm UTC](https://boards.straightdope.com/t/sendmail-question-linux/158565/3 "2003-03-02T12:08:21Z")

</div>

Near the beginning of your sendmail.cf file there should be a line that looks something like:

[Dj$w.Foo.COM](http://Dj%24w.Foo.COM)

Try changing the line to read:

[Dj$yourdomain.com](http://Dj%24yourdomain.com)

Make sure you uncomment it if it is commented.

The O’reilly sendmail book is a good resource to have for these kind of issues.

One other thing, have you checked your server for open relay? Sendmail can be tricky and complicated to set up and it is easy to miss things that would allow spammers and other people of questionable moral character to bounce their stuff off of your server, which could possibly get your server blacklisted. There are many places on the web that allow you to test your server, including the following site which seems to be reasonably comprehensive:

[url=http://abuse.net/relay.html]

HTH,

-sweep

---

<div class="post-metadata">

**Author:** ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)\
**Post date:** [March 2, 2003, 6:35pm UTC](https://boards.straightdope.com/t/sendmail-question-linux/158565/4 "2003-03-02T18:35:36Z")

</div>

Thanks for the reply, but that didn’t do it. So far the only thing that’s working is to manually set the user-domain in the mail client (pine). But I know sendmail can strip out the hostname - I’ve had it working once before, just can’t remember what I did.
