LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-27-2011, 01:00 AM   #1
musammil123
LQ Newbie
 
Registered: May 2011
Posts: 14

Rep: Reputation: Disabled
Post why localhost adding in the domain name


Hi All,

we have installed the Centos on my server and configured the postfix with our domain (mydomain.com) as example.

If I send any email through squirrel email, Emails are going from user@localhost.mydomain.com instead of user@mydomain.com .

Can anyone please let me know why localhost is adding in the domain name.

With expecting your valuable reply

Thanks
Mohamed
 
Old 05-27-2011, 01:25 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and Welcome to LinuxQuestions,

What do you have configured for the myorigin parameter in your main.cf file, do you have masquerade_domains activated and configured and what's the output of
Code:
hostname -f
Kind regards,

Eric

Last edited by EricTRA; 05-27-2011 at 01:26 AM. Reason: Typo
 
Old 05-27-2011, 01:31 AM   #3
musammil123
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi Eric,

Thanks for the reply. I have assigned myorigin =$mydomain. $mydomain is mydomainname. When I type hostname -f it show my domain name.
what is masquerade_domains activated ? where I have to check it.
Thanks
Mohamed
 
Old 05-27-2011, 01:36 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

If you started from a clean main.cf, not the one that comes with the installation of Postfix, then you will not have that directive in there. If you look at the original file you'll find it. You'll have to put it in the main.cf file like this:
Code:
masquerade_domains = localhost.mydomain.com mydomain.com
where of course you have to substitute mydomain for your real domain name. After the change restart Postfix and try to send a mail to see if it takes effect.

Kind regards,

Eric
 
Old 05-27-2011, 02:05 AM   #5
musammil123
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi
I have added that line and restarted the postfix. Still localhost coming.

Thanks
Mohamed
 
Old 05-27-2011, 02:24 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Can you post your main.cf (changing private information of course)?

Kind regards,

Eric
 
Old 05-27-2011, 02:28 AM   #7
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Just found something. Can you change:
Code:
masquerade_domains = localhost.mydomain.com mydomain.com
to the following:
Code:
masquerade_domains = $mydomain
exactly like that, then restart Postfix and try again.

Kind regards,

Eric
 
1 members found this post helpful.
Old 05-27-2011, 02:42 AM   #8
musammil123
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi Eric,

Thanks for the reply. Now its working fine.

once again thank you.


Thanks
Mohamed.
 
Old 05-27-2011, 02:45 AM   #9
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Glad to here you've got it working! Please mark your thread as solved. Enjoy Linux.

Kind regards,

Eric
 
  


Reply



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
change root@localhost.domain.com when sending email. Ryan@Matraex.com Linux - Newbie 3 07-14-2013 03:05 AM
Email@localhost.domain.com ?? robodeath Linux - Server 2 02-15-2007 10:07 AM
Sendmail--changing domain from localhost.localdomain andrewstr Linux - Software 3 02-21-2006 01:19 PM
Postfix: localhost.domain.com iantri Linux - Networking 8 07-27-2004 11:21 AM
Localhost and domain wazab Linux - Newbie 0 05-22-2004 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration