Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
... 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?
Distribution: Fedora, Debian, OpenSuSE and Android
Posts: 1,820
Rep:
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.
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.
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.
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.
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 =
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.