Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hostname being used as domain name

Status
Not open for further replies.

dakio

Technical User
Sep 10, 2003
5
US
I know this is a noob question, but noob I am. How or what do I configure in my sendmail.cf file to designate a specific default domain name? I have to set my hostname to blah.com in order for sendmail to even start. If I change my hostname to 'bingo' after it starts, all e-mails are addressed at me@bingo. I'm sure this is something I overlooked. Any help appreciated.
 
edit /etc/sendmail.cf and look for a line that says:
# who I masquerade as (null for no masquerading)
DMyourserver.yourdomain.tld
and change it into:
# who I masquerade as (null for no masquerading)
DMyourdomain.tld

Restart sendmail as root:
/etc/rc.d/init.d/sendmail restart
 
Tried that to no avail. Maybe it's something near the top...here's what I have from parts of my sendmail.cf file. maybe this will help.

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.dakio.net
Cwdakio.net
CP.

# "Smart" relay host (may be null)
DS
.
.
.
#CL root
CEroot

# who I masquerade as (null for no masquerading) (see also $=M)
DMdakio.net

Does that help? I'm really stuck on this. I know it can be done, I just have !clue on how to do it. Thank you for your response.


 
Dakio, I think you've got to lose the # in front of the Dj$w. Try removing the $w and hardcode in your domain name.

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.mydomainname.COM
Djmydomainname.COM

Hope this works, & anybody else feel free to jump on this.
Keith
 
Nope Keith, that didn't work either. I'm almost ready to give up hope. Tried it that way, even got creative and tried different variations to no avail. After change, restart sendmail, and it doesn't start back up. Break process change hostname back to mydomain.com and it starts up like a champ. Maybe I'm missing something else?

Thank you everybody for your assistance, this has been quite undaunting for me.
-dak-
 
dakio, I'm concerned about the problem with starting sendmail - having to change your hostname, etc. If you look at your /etc/log/maillog before you change your hostname, what is the error?
 
The message I get is this:
Sep 12 12:18:38 deimos sendmail[13260]: My unqualified host name (mail) unknown; sleeping for retry

Ahh, this might be the clue. Changed hostname to mail.domainname.com and appears to be working fine now. Not sure if that's how it's supposed to be or if just the simple domain name (mail) is supposed to suffice.

Let me know if I'm still not doing it right.

Much thanks to you all.

Aloha,
-dak-
 
I use a redhat 7.2 server with sendmail to handle email for my office. My 7.2 sets email 'From:' line fine when I email from my windows machines - me@domain.com.
Sendmail on redhat 8.0 seems to behave diferrent. I setup a redhat 8.0 machine for testing & developement. When I used it's sendmail (with pine) to relay out thru my 7.2 server, I was getting same results as you - me@machine.domain.com. None of the stuff I told worked, but I'm glad your sendmail starts up ok now with the change you made to hostname.
Here's the skinny...
Originaly, on the 8.0 server I used the hostname command:
hostname machinename
and the domainname command:
domainname domain.com
NOW, I've change my hostname to be:
hostname domainname.com
and still use the domainname command:
domainname domain.com

Mail sets the 'From' correctly comming from my 8.0 server!

The only thing I may have done different was to use the domainname command: domainname mydomain.com

Hope this fixes it. Letme know.
Keith
 
Nope, I've already had that set from before. Was one of the first things I checked among many. Still can't start it with a regular hostname listed. Going to give up on the why and just leave the hostname as the domain name as that appears to work. Now if anybody knows why, when I host multiple domain names that smith@domain1.com and smith@domain2.com always sending mail from domain2.com and sendmail converts it all to be from smith@domain2.com, I'd be greatly appreciative.

Aloha,
-dak-
 
Have you tried to edit the MC file?

try these

Cwmydomain.com on 7.2

MASQUERADE_DOMAIN(mydomain.com)dnl on 8.0

PS: /etc/hostname for the hostname works the best if you dont have an alias in it. Alos you can edit /etc/hosts and put your IP and make the first one the name you want to use to send the mail and others as aliases
 
Hello!

I do not know if you ever solved your problem but, if you edited /usr/mmdf/mmdftailor, you should be able to masquerade your domain name.

Change MLNAME and/or MLDOMAIN to suit your needs and see what happens. I remember having same problem once and this was the solution to it.

Good luck!


Jose Lerebours


KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
I am having the same problem as Dakio. I have multiple domains that I want to accept mail from. Some users are in both domains, but their return mail reflects the originating domain. I believe that is because I have a masquerade_as entry (so that the hostname didn't appear in the return address). All accounts are created on a server in domain1.

How can I have a user who sends mail user@domain2.com have his address appear as user@domain2.com. Right now it shows the return address as user@domain1. I also do not want the hostname appearing in the address.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top