Email Domains For Virtual domain Owners appearing to be mest up.

Hi, folks:
Instead of reflecting in any sent emails user@VirtualHostDomain.com, where VirtualHostDomain.com is the actual domain name of the Virtualmin hosted webspace, I’m getting User@localdomain addresses all over the place with every virtual host for some reason that I create.
I don’t know why.
The emails actually come through successfully to accounts outside of my system like hotmail, etc, but the domains are wrong.
Why is this situation occuring?
As an example, my primary system emails should be ending in keithnet.us vs “localdomain”.
But they don’t.

I configured everything to my knoledge properly that I’m aware of otherwise.
If anyone can get back to me on how I can change this odd behavior so things reflect as they’re designed to, I’d appreciate it.

Let me show you guys one thing.
Right now, Postfix shows this when I send email from my system out to anyone in the received headers:
Received: from server1.localdomain (server1.keithnet.us. FOllowed by the public Ip of mys erver.
I don’t get this.
Why is that showing up in email headers/
I adjusted the adio button in the webmin postfix servers module from “hostname” to “use domain name” so now that seems better, and then I adjusted the second option fo delivering email to “use hole domain” at this point.
Where is the localdomain stuff coming from?
As this still is confusing me a bit.
Or do you more experienced mail users than myself believe this is just fine, and nothing to worry about, considering that my SPF for keithnet.us actually works and is permitted in Gmail in this example (as the destination)?
Thanks!

Can you please clarify what the exact problem is? Do emails to your addresses not get through? Where exactly are you seeing the @localdomain addresses? Please post relevant excerpts from /var/log/mail.log.

Virtualmin uses the “Virtual Domain” feature of Postfix to set up email addresses for your virtual servers, redirecting them either to any external forwarding target you specified, or otherwise to local mailboxes if so configured.

I’m using “full domain names” and the @ symbol to separate user and domain part. An example delivery log entry looks like so:

May 11 09:39:44 orion postfix/smtpd[25164]: connect from remotehost.net[11.22.33.44] May 11 09:39:44 orion postgrey[3260]: action=pass, reason=triplet found, delay=630, client_name=remotehost.net, client_address=11.22.33.44, sender=remotehost May 11 09:39:44 orion postfix/smtpd[25164]: 7858B1A1CBE: client=remotehost.net[11.22.33.44] May 11 09:39:44 orion postfix/cleanup[25168]: 7858B1A1CBE: message-id=<0.1.26.E34.1CD2F47634AE72A.0@remotehost.net> May 11 09:39:44 orion postfix/qmgr[3964]: 7858B1A1CBE: from=<remote-email-address@remotehost.net>, size=32333, nrcpt=1 (queue active) May 11 09:39:44 orion postfix/smtpd[25164]: disconnect from remotehost.net[11.22.33.44] May 11 09:39:44 orion spamd[16969]: spamd: connection from localhost [127.0.0.1] at port 43682 May 11 09:39:44 orion spamd[16969]: spamd: setuid to local.user@targetdomain.de succeeded May 11 09:39:44 orion spamd[16969]: spamd: processing message <0.1.26.E34.1CD2F47634AE72A.0@remotehost.net> for local.user@targetdomain.de:1025 May 11 09:39:45 orion spamd[16969]: spamd: clean message (-5.0/5.0) for local.user@targetdomain.de:1025 in 0.7 seconds, 31985 bytes. May 11 09:39:45 orion spamd[16969]: spamd: result: . -4 - HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_SAFE,SPF_PASS,T_DKIM_INVALID,T_FRT_CONTACT,T_RP_MATCHES_R May 11 09:39:45 orion postfix/local[25169]: 7858B1A1CBE: to=<local.user-targetdomain.de@orion.tianet.de>, orig_to=<local.user@targetdomain.de>, relay=local, delay=0.95, delays May 11 09:39:45 orion postfix/qmgr[3964]: 7858B1A1CBE: removed

Emails are being sent just fine.
The example I posted where the localdomain information was showing up, was in the actual email headers sent out by my own system to the remtoe destination such as say Gmail, Hotmail, etc.
So when I viewed the origenal message with full headers just to see, that’s when I’d see details like:

 Received: from server1.localdomain (server1.keithnet.us. 

Note that after that the IP of my server then showed in those GMail headers.
Before I changed Postfix to use domains/hole domains primarily, while the first option of general settings was set primarily on “hostnames” I used to see headers whenever I’d receive email to say my Gmail account etc such as:

Return-Path: <khinton@server1.localdomain> Received: from server1.localdomain (server1.keithnet.us.
Specificly, what I need if I send emails out in future is to see server1.keithnet.us refferenced as a machine name,(as that does exist as an a record) and return-path of user@keithnet.us where user can be any email account on the system.

Hope this helps.
If you still want me to post logs, I can.

Wanted to add that I’m more confused as to why I was having this problem in the first place as my hosts file, was setup like so:

 127.0.0.1 server1.keithnet.us server1 localhost

Where as before, that line refferenced: localhost.localdomain.
So it would appear that somewhere, (back when my hosts file for the localhost entry had a localdomain entry) that Postfix stored it somewhere.
But as described above, emials are delivering just fine, I’m just tyring to see why specific thigns like what I tried to show you folks show up in the email headers of the actual emails.

Ah okay, if it’s just the header lines, the reason might be wrong contents of /etc/mailname. What do you have in that file?

Afraid I don’t have a /etc/mailname file on my system. I’m using CentOS here. Any other place this information might be stored? Thanks again.

Yeah, it seems the “mailname” thing is Debian specific.

You can check the file /etc/postfix/main.cf, the line “myorigin” should contain the relevant place/text if I’m not mistaken. While you are there, you can check the other directives too if you find one that reads “localdomain” instead of what it should read.

Solved!
Okay, I finally figured it out.
Postfix was attaching the wrong hostname in the Myorigin section.
Though for some reason one of the lines was commented with a # simbol.
I simply uncommented one of the examples changed it from “hostname.tld” as when I didn’t do that, it caused localdomain to suddenly become “hostname.tld” in the headers LOL.
I just manually inputted the name of my box, server1.keithnet.us, and now all is fine!
isn’t it funny the little things we overlook are what seem to trip us all up sometimes?
:slight_smile:

Thanks folks!

You’re welcome!

Repair Postfix configuration: Success. Journal updated. COMPLETED: HELP OUT KHINTON WITH HIS SERVER PROBLEMS.

Yeah yeah, you’re right. I’ve been playing too much Skyrim recently.