LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Postfix: localhost.domain.com (https://www.linuxquestions.org/questions/linux-networking-3/postfix-localhost-domain-com-209092/)

iantri 07-24-2004 09:26 AM

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?

Pcghost 07-24-2004 11:35 AM

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.

iantri 07-24-2004 12:15 PM

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?

WMD 07-24-2004 01:49 PM

Just change your computer's name. Find something that works. ;)

iantri 07-24-2004 01:54 PM

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.

predrag 07-24-2004 02:25 PM

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]

iantri 07-24-2004 06:25 PM

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.

bastard23 07-26-2004 12:21 AM

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 =

iantri 07-27-2004 11:21 AM

That did it. Thanks for your help.


All times are GMT -5. The time now is 02:22 AM.