Domain for proxmox mail delivery system is still "localhost"

mmenaz

Renowned Member
Jun 25, 2009
835
26
93
Northern east Italy
Hi, I've scheduled a backup with e-mail notification to my account in a proxmox of a client of mine.
FQHN of their proxmox server has a correct domain (a domain is resolved with MX record in internet), like:
# hostname -f
proxmox.mycustomerdomain.it

Neverless I receive mail notivication as "Undelivered Mail Returned to Sender" with the following error message:

The mail system
<myname@mydomain.it>: host mail-mydomain.it [208.36.100.00] said: 550
<root@proxmox.localdomain>: No thank you rejected: Domain not found (in reply to RCPT TO command)
Reporting-MTA: dns; proxmox.localdomain
X-Postfix-Queue-ID: 7BD0D4822CB
X-Postfix-Sender: rfc822; root@proxmox.localdomain
Arrival-Date: Sun, 19 Jul 2009 03:21:33 +0200 (CEST)

Final-Recipient: rfc822; myname@mydomain.it

Action: failed
Status: 5.0.0
Remote-MTA: dns; mail-mydomain.it
Diagnostic-Code: smtp; 550 <root@proxmox.localdomain>: No thank you rejected: Domain not found

I'm not an expert, and I've "fixed" it editing directly /etc/postfix/main.cf and adding to the top a line like:
myhostname = proxmox.mycustomerdomain.it
I'm wondering if is possible having it automatically set by Proxmox Web Interface when you enter System -> DNS -> Hostname and Domain, or if I'm missing something.
Thanks a lot!
 
Don't remember, but I doubt I installed with 'localdomain' as domain. In any case, other than in resolv.conf and hostname, where should the installer put this information for postfix? Why postfix does not use $(hostname -f) or something like that to grab it's own hostname and domain? Is it normal?
Thanks in advance
 
There is postfix, and there are the debian configuration scripts for postfix... I have done my best to setup a resonable configuration, but I have no idea why it did not work on your side - please let me know if you can reproduce the problem somehow?
 
hi dietmar i have this same problem after install ,how can i correct this .thank you
 
Don't remember, but I doubt I installed with 'localdomain' as domain. In any case, other than in resolv.conf and hostname, where should the installer put this information for postfix? Why postfix does not use $(hostname -f) or something like that to grab it's own hostname and domain? Is it normal?
Thanks in advance

The postfix documentation states:
The default is to use the fully-qualified domain name from gethostname().
 
I know this is a really old thread, but I wanted to add my .02 since I still had this issue in version 1.8 and found a slightly better solution (imo). Like other users, I found that running 'hostname -f' would return the correct fqdn but any emails coming from the host came from 'root@proxserver.localdomain'. I observed this on a server that was installed with the correct domain name (during the installer), and also one that had its domain set after the fact. Both servers were 1.7 upgraded to 1.8 post-install.

I did not have to set 'myhostname = host.yourdomain.com' in /etc/postfix/main.cf... I only had to set 'mydomain = yourdomain.com'. Setting either option seems to fix the problem, but only having to set the domain is slightly more portable and it worked for me so I wanted to share it.

The issue still appears to be that postfix cannot find the correct domain to use in the fqdn. I don't know enough about the components involved to have an opinion whether this is being caused by the default main.cf that is being used, by the way the Proxmox installer is setting the hostname, or if it really is a bug with postfix not being able to pull what it needs from gethostname(). I did also see a post about this online about a CentOS install, which leads me to lean more to the idea that postfix's hostname finding routines are not quite comprehensive enough.
 
Hi,

I did a fresh install of Proxmox VE 1.8 on bare metal.

After reboot of initial installation, I did "apt-get update; apt-get upgrade".
And a reboot.
Then did setup backup schedule with email address, now I get the same result with postfix using ".localdomain" as domain suffix.

The hostname was typed in correctly at installation time, the fullqualified hostname has proper dns and reverse PTR.

Why does that happen?


"hostname" shows the host name only,
"hostname -f" the FQDN, it's OK this way?



# pveversion -v
pve-manager: 1.8-17 (pve-manager/1.8/5948)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-33
pve-kernel-2.6.32-4-pve: 2.6.32-33
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.26-1pve4
vzdump: 1.2-12
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5
#

# uname -a
Linux (myhostname) 2.6.32-4-pve #1 SMP Mon May 9 12:59:57 CEST 2011 x86_64 GNU/Linux



what is the "cleanest" way to fix it?

kind regards,

spdriver
 
As I said previously, imo the cleanest way to fix this (worked for me, ymmv) is to set 'mydomain = example.com' in /etc/postfix/main.cf. This seems much more portable to me than changing settings in that file related to the hostname, which would have to be done differently on each host. This change is only different per domain. Also, some have reported in this thread that changing hostname parameters there didn't help them. I've not tried that so I don't know.

The debate on why this happens likely (imo) won't go anywhere. I'm not going to fully jump back into my notes on this but as best I can remember: since some of these parameters aren't set in main.cf, postfix should be getting the same results you're getting by running the hostname command. It just uses, according to the postfix docs and previously mentioned by dietmar, the gethostname() function within the code.

...all of that is really just a summary of what is already here. I'm not sure why I bothered to write it again.