LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 07-24-2004, 10:26 AM   #1
iantri
Member
 
Registered: Jul 2003
Posts: 38

Rep: Reputation: 15
Postfix: localhost.domain.com


Hello.

I am having a problem configuring Postfix under CentOS 3.1 (Red Hat Enterprise Linux 3 rebuild).

I have Postfix configured as such:

myhostname = domain.com
mydomain = domain.com
myorigin = $mydomain

and

relayhost = mail.isp.net

... but when I try to send messages it sends them as "localhost.domain.com", which my ISP's server won't relay because "localhost.domain.com" is a non-existant host.

The comments in the postfix config file say this:

# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from.

And myorigin is set to mydomain, so it should come out "domain.com", no? What am I doing wrong?
 
Old 07-24-2004, 12:35 PM   #2
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Ubuntu, Debian, SuSE, UnSlung, Android
Posts: 1,819

Rep: Reputation: 46
What MUA were you using to send the message? Is your machines host name the default linux.localhost.localdomain? It could be that the MUA bypassed postfix and sent the message directly to your ISP. Check the mail log in /var/log and get the details for the message.
 
Old 07-24-2004, 01:15 PM   #3
iantri
Member
 
Registered: Jul 2003
Posts: 38

Original Poster
Rep: Reputation: 15
No; it is being sent through Postfix. They bounce silently, but in my daily logwatch e-mails the Postfix logs indicated that my ISP's server rejected them because they were from a non-existant domain, localhost.domain.com.

If I send an e-mail to another user on the same server, it comes as user@localhost.domain.com.

I honestly have no idea why, when "myorigin" is configured to be domain.com.

Ideas?
 
Old 07-24-2004, 02:49 PM   #4
WMD
Member
 
Registered: Jul 2004
Location: Florida
Distribution: Slackware, Debian
Posts: 484

Rep: Reputation: 30
Just change your computer's name. Find something that works.
 
Old 07-24-2004, 02:54 PM   #5
iantri
Member
 
Registered: Jul 2003
Posts: 38

Original Poster
Rep: Reputation: 15
The computer's hostname is "server".

It is not directly accessable by the outside world -- only by port forwarding through an IPCop box that does NAT.

I have set Postfix to send e-mail as "mydomain.com" (note: this is obviously not really my domain name. I don't want to generate unwanted traffic.) , but it sends it as "localhost.mydomain.com".

Clearly, the system's hostname is not involved in this in any way.

I'm sorry if I sound slightly agitated, but "Find something that works." isn't a very helpful response when you are asking for help from others who may know what DOES work.
 
Old 07-24-2004, 03:25 PM   #6
predrag
Member
 
Registered: Aug 2003
Location: Salzburg, Austria
Distribution: Ubuntu, CentOS, FreeBSD
Posts: 34

Rep: Reputation: 15
Re: Postfix: localhost.domain.com

[QUOTE]Originally posted by iantri
[B]Hello.

I am having a problem configuring Postfix under CentOS 3.1 (Red Hat Enterprise Linux 3 rebuild).

I have Postfix configured as such:

myhostname = domain.com
mydomain = domain.com
myorigin = $mydomain

Change this to your real domain and host name. Also, make sure you set up properly hostname of your system.

relayhost = mail.isp.net

Try using IP address of mail.isp.net in []
e.g. relayhost = [193.168.100.200]
 
Old 07-24-2004, 07:25 PM   #7
iantri
Member
 
Registered: Jul 2003
Posts: 38

Original Poster
Rep: Reputation: 15
The actual values are not "domain.com".

I didn't want to direct unnecessary traffic towards the small-business server at that location.

Let's pretend the domain name is xyzco.com.

Basically, even when I set myorigin explicitly to "xyzco.com", it still comes out as "localhost.xyzco.com".

This is what confuses me.

The hostname of the box is actually "server". It is not directly connected to the Internet, but rather is accessed via port forwarding behind a router doing NAT. "Server" doesn't end up at all anywhere, though, either.
 
Old 07-26-2004, 01:21 AM   #8
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
I suspect that the MUA (which one, you haven't mentioned) is adding the @localhost, and postfix is adding .domain.tld.

A quick fix is set masquerade_domains = $mydomain

$ postconf 'masquerade_domains = $mydomain'
should work.

From sample-rewrite.cf:
# The masquerade_domains parameter specifies an optional list of
# domains that must have their subdomain structure stripped off.
#
# The list is processed left to right, and processing stops at the
# but strips any.thing.else.example.com to example.com.
#
# By default, address masquerading is disabled.
#
#masquerade_domains = $mydomain
masquerade_domains =
 
Old 07-27-2004, 12:21 PM   #9
iantri
Member
 
Registered: Jul 2003
Posts: 38

Original Poster
Rep: Reputation: 15
That did it. 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
Postfix - Sender address includes localhost buskmann Linux - Software 1 05-04-2005 08:56 AM
Localhost and domain wazab Linux - Newbie 0 05-22-2004 11:40 AM
HELP: Postfix SMTP only seems to run for localhost lhoff Mandriva 1 02-29-2004 09:34 AM
Postfix - amavisd (?) localhost.com joseph_1970 Linux - Software 1 02-13-2004 06:42 PM
postfix can't resolve localhost yapp Linux - Networking 2 12-02-2003 02:48 PM


All times are GMT -5. The time now is 01:56 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration