These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for postfix received by hostname instead of domain? on the new forum.
Emails sent from postfix have the following headers;
Received: from host.server.com ([x.x.x.x]) by x.x.x with bizsmtp id xxx; Tue, 01 Sep 2015 10:32:53 +0200 Received: by host.server.com (Postfix, from userid 48) id DD575AA; Tue, 1 Sep 2015 04:32:52 -0400 (EDT)
However, I want this to show the domain name instead since this server hosts multiple sites.
I changed the postfix configuration to say :
myorigin = $mydomain
Note that $mydomain is not defined there. In the comments above this it states:
# The myorigin parameter specifies the domain that locally-posted # mail appears to come from. The default is to append $myhostname, # which is fine for small sites. If you run a domain with multiple # machines, you should (1) change this to $mydomain and (2) set up # a domain-wide alias database that aliases each user to # user@that.users.mailhost.
So I added an alias to /etc/aliases:
username: info@mydomain.com
and restarted postfix.
However, mail is still being sent via host.server.com
What am I doing wrong?
I assume that mail sent via PHP is going through the correct username, and not some default one? PHP is set up as CGI, default install as virtualmin defined, nothing changed there.
Any help?
thx
Howdy,
All email will indeed go out on the primary IP address of your server, using the hostname of your server -- and showing the reverse IP of the primary IP address.
You can do something like what you're asking if you have multiple IP addresses though... details on that are here:
https://www.virtualmin.com/documentation/email/dependent