Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Postfix and hostname
PostPosted: Mon May 05, 2008 1:31 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
Hi,

I've a domain foobar.com and I'm "out-sourcing" the email of this account to Google Apps for your Domain. Meaning that the MX records of foobar.com point to Google. user1@foobar.com, user2@foobar.com,... all login to google apps to view and manage their mail.

I've a linode with Ubuntu 8.04 and after install the hostname was "ubuntu" and the beginning of /etc/hosts file was:

Code:
127.0.0.1       localhost
127.0.1.1       ubuntu  ubuntu.linlan


Then I installed Postfix and in the Postfix configuration I set node-n.foobar.com as my destination (because I want my linde to be called node-n). I didn't changed hostname.

Then I tested the instalation with the command sendmail. It sent OK and I checked the header of the sent message:

Code:
Received: from ubuntu.linlan (xxxxxx.members.linode.com [xxx.xxx.xxx.xxx])
        by mx.google.com with ESMTP id 6si13606729ywp.3.2008.05.05.10.07.59;
        Mon, 05 May 2008 10:08:11 -0700 (PDT)


I disliked the "Received: from ubuntu.linlan" because I want it to be node-n or node-n.foobar.com.

So I edited /etc/hostname changing it to node-n and /etc/host changing it to:

Code:
127.0.0.1       localhost
127.0.1.1       node-n  node-n


The problem is... the header keeps ubuntu.linlan as hostname/localdomain. Can I get ride of that?

Thanks for your help.


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 1:36 pm 
Offline
Linode Staff
User avatar

Joined: Fri Oct 17, 2003 12:38 am
Posts: 287
Location: Dr Wierd's Lab, South Jersey Shore
Postfix will need to be restarted after changing the host name for it to see the new name.

Mike


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 1:52 pm 
Offline
Senior Newbie

Joined: Wed Mar 26, 2008 12:42 am
Posts: 6
Website: http://www.lafferty.ca/
Location: Toronto, Canada
Ubuntu puts the hostname used by Postfix in /etc/mailname, IIRC.

You can see what postfix thinks it is with "postconf myhostname" and "postconf myorigin". (I don't have the standard Ubuntu postfix setup on even my Ubuntu machines so I can't remember which of those two points to the other.)


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 1:57 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
Hi Mike, thanks for your attention but it didn't work! :(

First I change my /etc/hosts to

Code:
127.0.0.1     localhost
127.0.0.1     node-n node-n.foobar.com


Then I issued:

Code:
sudo /etc/init.d/postfix reload
sudo /etc/init.d/postfix restart


But no success! The Received: from ubuntu.linlan keeps appearing! I even tried to reboot my server... no luck.

Perhaps this is a setting from Linode and has nothing to do with my machine. :(


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 2:02 pm 
Offline
Senior Newbie

Joined: Wed Mar 26, 2008 12:42 am
Posts: 6
Website: http://www.lafferty.ca/
Location: Toronto, Canada
/etc/mailname :)


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 2:05 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
mendel wrote:
Ubuntu puts the hostname used by Postfix in /etc/mailname, IIRC.

You can see what postfix thinks it is with "postconf myhostname" and "postconf myorigin". (I don't have the standard Ubuntu postfix setup on even my Ubuntu machines so I can't remember which of those two points to the other.)


Yes Mendel... it worked!! Thanks!

I issued "postconf" myhostname and it returned "ubuntu.linlan"... so something was wrong.

Then I edited /etc/postfix/main.cf, the variable myhostname was there. I replaced "ubuntu.linlan" by "node-n.foobar.com", and I restarted postfix.

Now it works like a charm! :)


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 2:08 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
mendel wrote:
/etc/mailname :)


/etc/mailname was right. The problem was in /etc/postfix/main.cf because I installed Postfix prior to the hostname/hosts change and the variable is not redefined.

I love UNIX but sometimes... ggg! ;)


Top
   
 Post subject:
PostPosted: Mon May 05, 2008 2:18 pm 
Offline
Senior Newbie

Joined: Wed Mar 26, 2008 12:42 am
Posts: 6
Website: http://www.lafferty.ca/
Location: Toronto, Canada
ngm wrote:
I love UNIX but sometimes... ggg! ;)


Well, this time you can blame Debian specifically. Postfix as distributed defaults to the machine's hostname for myhostname and myorigin.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group