LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 09-06-2002, 03:41 AM   #1
greenhornet
Member
 
Registered: Mar 2002
Location: Sydney, Australia
Distribution: RHEL, Fedora, Yellow Dog
Posts: 43

Rep: Reputation: 15
Question Changing domain sendmail sends mail with


Hi All,

I have a sendmail server that is working fine.

I have MX records for name.domain.com and domain.com

All mail for username@name.domain.com and username@domain.com is delivered successfully to the user.

The problem I'm having is that unless the user specifies in thier mail client (pop3, imap or PINE) that they want thier reply to address as @domain.com the mail is sent out as coming from username@name.domain.com.

This wasnt a big problem until I setup vacation for autoreplies. Here there is no client and so its all going out as username@name.domain.com

Is there something I can set in the sendmail.cf or sendmail.mc that can specify that I want all mail to go out looking as if its come from username@domain.com

Or is this where you specify the MX preference level on your DNS server???

PS : I have searched this forum and the answers that are here are not working for me. Oh I am also using Red Hat 7.3 and sendmail 8.11.6

thanks for your help,
Craig
 
Old 09-06-2002, 03:54 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
unless you have DNS servers and other such complications running on the server, then i believe you can just fiddle with your standard /etc/hosts file and change the order in which the names are listed for each relevant IP. as you'd expect, they get resolved left to right, so make sure your preferred domain name is first in the list e.g.
Code:
192.168.0.1	thirtythreeandathird.net simon simon.thirtythreeandathird.net
i flipped that around the other day as all the procmail stuff was coming from simon.etc and i needed that not to happen, which should be the exact sme position as you.
 
Old 09-06-2002, 04:14 AM   #3
greenhornet
Member
 
Registered: Mar 2002
Location: Sydney, Australia
Distribution: RHEL, Fedora, Yellow Dog
Posts: 43

Original Poster
Rep: Reputation: 15
hmm, I changed that and it didnt seem to make a difference, is there anything I need to restart after modifying /etc/hosts

My /etc/hosts looks like this now.
xxx.xxx.xx.xx domain.com name.domain.com name 127.0.0.1 localhost

but whats interesting is my machines real name is name2.domain.com, name.domain.com is just a DNS alias for name2.domain.com (a botchy server migration someone did on this) but its the name2 address the mail is going out as.

Is there a way to get sendmail to do this, the same way you setup the reply-to: field on a client or the default-domain in PINE?

thanks,
Craig
 
Old 09-06-2002, 04:57 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
ok so you are going through DNS as well? are you sure that the zone records are set up properly for it?

i think you can just define the actual domain name within sendmail with a line like "DOMAIN(`domain.com')dnl" in the sendmail.mc file (no idea what the real sendail.cf line would be though. This does seem to be forcing it though, and there should be a more natural solution. but there's suerly nothing technically "wrong" with doing this...

Last edited by acid_kewpie; 09-06-2002 at 04:59 AM.
 
Old 09-06-2002, 07:15 PM   #5
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
If you have access to dns server, why don't you just add an mx entry for the 2nd name?. You might also need to put it in local-host-names in your mail server.
--Sarin
 
Old 09-09-2002, 02:42 AM   #6
greenhornet
Member
 
Registered: Mar 2002
Location: Sydney, Australia
Distribution: RHEL, Fedora, Yellow Dog
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks acid, you put me on the right track and I've figured this out now.

To do this you need to have an MX record for mydomain.com and then put the following in your /etc/mail/sendmail.mc file.
MASQUERADE_AS(`mydomain.com')dnl

and then get your new sendmail.cf from the m4 macro-processor (backup old .cf first).
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
then restart sendmail.

thanks for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail - wrong mail sender domain display jika Linux - Newbie 1 05-27-2005 03:29 AM
qmail generating mail that sends to the wrong domain? shadoxity Linux - Software 5 04-16-2005 01:56 AM
Domain Routing to Postfix from Sendmail = Wrong IP information in Mail Logs! dholingw Linux - Networking 2 05-20-2004 11:06 AM
Changing Sendmail Domain On Mandrake 9.1 johnleemk Linux - Software 2 12-23-2003 07:53 AM
How to setting the Virual Domain Mail Server by sendmail? explorer1979 Linux - General 1 06-04-2002 03:26 PM


All times are GMT -5. The time now is 12:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration