Challenging unix sendmail question

rneff50

Senior member
Mar 29, 2001
204
0
0
I just installed a route on my network so my linux machines can share internet with my sun solaris machine. I have everything working fine, except sendmail.

Here is the problem. I changes the name of the solaris machine to some new, becasue the router needed the hostname form the isp. So now sendmail on the solais machine uses the hostname that i created for it, and it takes a long time to send each message, and the reply address is wrong. If it temporarily change the hostname of the soalris machine, to that of the router, then it works perfectly.

So i need to find a way that makes sendmail send messages with a different hostname. I looked in the configuration files, and the man pages, but i still could not find it. And many FAQs and how-tos online said that you need to set the hostname of the system and that is it.

I know there must be a solution out there...anyone know?

Any help would be appreciated. Thanks.
 

Abzstrak

Platinum Member
Mar 11, 2000
2,450
0
0
ok, I'm not exactly an expert at sendmail, but I'll try..... but I need some questions answered first.

so U only changed the hostname? or did U change the domain name too? when U say the return address is wrong do U mean its coming to the old name or something else?

lets make up some names to clarify these....

the old name was old.domain.com, new name is new.domain.com

email sending was coming from mailaddy@old.domain.com, and now it will be coming from mailaddy@new.domain.com

Also, what exactly did U change when U say that : I just installed a route on my network so my linux machines can share internet with my sun solaris machine ? do mean that the linux boxs are NATing for the sun box now?
 

Abzstrak

Platinum Member
Mar 11, 2000
2,450
0
0
ok, looked a few things up...

The mail name keyword allows the host part of the outgoing addresses to mask the real hostname of the originating machine. This could be used like this:

mailaddy:mailname mailaddy@new.domain.com

here the canoical name of mailaddy's machine is old.domain.com. The mailname keyword causes outgoing mail from mailaddy to appear as though its from new.domain.com instead.

Now if you want this to be default for all users then use the username default, like this:

: Default:mailname new.domain.com

U can also use this to set the default to one thing, and individually set others back to the original canoical name (or whatever you like), like this:

: Default:mailname new.domain.com
mailaddy:mailname mailaddy@old.domain.com

here mailaddy looks to be coming from old.domain.com, but mailaddy2, mailaddy3, and mailaddy4 are all coming from new.domain.com.

anyways, hope this helps


{EDIT}
these damn forums screwed the formatting up, there is no space between the : and the D in Default, but if I leave the space out I get a :D instead.

Also, there is suppose to be a tab between the mailname and domain entries.

 

rneff50

Senior member
Mar 29, 2001
204
0
0
Thank you very much for looking in to this. It seems like you are on the right track. I think that a typo in my original post may have confused you. I meant that i installed a router, not a new route. Sorry about that.

I will clarify what is happening (although i think you got it anyway).

Before the installation of the router, sendmail was running on the solaris server, with the oldhostname and old.domain.name. This was the only computer on the network to have interset access.

When i installed the router, i changed the oldhostname and old.domain.name because i set the router to that name. So i made the solris machine to newhostname and new.domain.name (note: changing the new.domain.name back to old.domain.name didnt seem to have any effect on this problem or cause any other problems.

Here is the problem. When i mail something from the mail command (which uses sendmail i believe) or from my pop mail server, the from address is username@newhostname and it takes a while to send (like 45 seconds). Also, the people can't reply becasue the address username@newhostname is without a domain name.

If i use the command hostname to change the hostname to oldhostname temporarily, then send a message using the mail command ( echo "test" | mail myphonenumber@vtext.com ) the message goes through really quickly and without any probelms and with the right reply and from address (username@oldhostname.old.domain.name). This is the address that i need to be seen with for the world.

The router recieves the messages for username@oldhostname.old.domain.name and forwards that port to the computer so those messages get through fine. It is only when i send messages, that the computer attaches newhostname for the email address instead of username@oldhostname.old.domain.name. The problem is that (username@newdomainname (since it has no domain name) is not a valid email address for people from the outside world.

If you would like any more information or specific details i would be glad to provide them.

In terms of what you were telling me to try....in which file and where do i put those lines?

Thanks again for you help.