Here in the forum again and again connection problems are described e.g. HTTP Error 500 or Autodiscover Errors. Some of these problems are caused by a wrong configuration of the hostname
in /etc/hosts
file.
Please note: the grommunio services must be able to resolve themselves via DNS, this is especially necessary for Outlook with Autodiscover.
With one of the last updates (probably in January 2023 ) something was changed in the name resolution and the HTTP Error 500 problem occurs now more strongly.
This guide should help to detect and repair such configuration errors.
As an example a fictitious grommunio mail server with these parameters is used
Internal IP address: 192.168.1.1
Internal hostname: grommunio.kunde.local
Internal DNS A-Record mail.kunde.at
points to IP: 192.168.1.1
Internal DNS A-Record autodiscover.kunde.at
points to IP: 192.168.1.1
, this can also be a CNAME.
The internal DNS assignment for mail.kunde.at
and autodiscover.kunde.at
can be implemented with a split DNS, for example. If the internal DNS server does not support split DNS (the Novell OES DNS server is a good example) you can create the zone kunde.at
internally with the same data as externally only mail.kunde.at
and autodiscover.kunde.at
point to the internal IP 192.168.1.1
. This also works, but requires more administration.
External IP address: 1.2.3.4
External hostname: mail.kunde.at
External DNS A-Record mail.kunde.at
points to IP: 1.2.3.4
External DNS A-record autodiscover.kunde.at
points to IP: 1.2.3.4
, this can also be a CNAME.
D-Nat for ports 25, 80, 443
from IP 1.2.3.4
to IP 192.168.1.1
is present. Please note: we only talk about SMTP, EAS and Grommunio-Web. Ports for IMAP4, POP3, etc. are not listed.
A PTR record pointing from 1.2.3.4
to mail.kunde.at
is recommended for reliable mail sending, grommunio itself does not need the PTR.
Important: these example values have to be replaced by the values of the target system!
The /etc/host file
In /etc/hosts
a FQDN hostname
is entered for the grommunio server. This hostname can be an internal hostname like: grommunio.kunde.local
or an external one like mail.kunde.at
.
During the installation the admin was asked to enter a FQDN hostname
: https://docs.grommunio.com/admin/installation.html#hostname-fqdn-setup.
An /etc/hosts
file with an external hostname
looks like this
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.1 mail.kunde.at mail
For example, an /etc/hosts
file with an internal hostname
looks like this
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.1 grommunio.kunde.local grommunio
Please note: Only the last line is different.
Scenario 1, in the /etc/hosts
is the external hostname
as FQDN
The hostname line in this scenario is: 192.168.1.1 mail.kunde.at mail
.
On the console, the hostname
command must return the external hostname as the FQDN mail.kunde.at
.
Here no further configuration is necessary in grommunio for the hostname.
Continue to test if the DNS configuration works.
Scenario 2, in /etc/hosts
is the internal hostname
as FQDN
The hostname line in this scenario is: 192.168.1.1 grommunio.kunde.local grommunio
.
On the console, the hostname
command must return the internal hostname as the FQDN grommunio.kunde.local
.
Here in grommunio, further configurations are necessary, a server has to be created and all mailboxes have to be assigned to this home server:
- in the Admin UI -> Admin -> Servers -> NEW SERVER:
Selection policy: round-robin
Hostname: localhost
External name: mail.kunde.at
Important: the field Hostname: localhost
refers to the line 127.0.0.1 localhost
in /etc/hosts
, so it must always be localhost.
- in Admin UI -> Admin -> Users -> edit all mailboxes and set the Homeserver
localhost
in the ACCOUNT tab. This must be done for all mailboxes / users.
Now Autodiscover can use the correct external FQDN hostname
.
- Continue to test if the DNS configuration works.
Test if the DNS configuration works
Please note, instead of ping xxx.yyy.zzz
you can also use nslookup xxx.yyy.zzz
, which returns only one, but more informative answer and does not have to be aborted with CTRL
-C
. Ping additionally tests the reach ability of the server.
Test on grommunio server:
ping mail.kunde.at
expected response: 192.168.1.1
ping autodiscover.kunde.at
expected response: 192.168.1.1
ping6 ::1
expected response: 64 bytes from ::1: ...
Internal test from a workstation:
ping mail.kunde.at
expected response: 192.168.1.1
ping autodiscover.kunde.at
expected response: 192.168.1.1
External test from another Internet connection or MX toolbox:
ping mail.kunde.at
expected response: 1.2.3.4
ping autodiscover.kunde.at
expected response: 1.2.3.4
Optionally test the PTR from an Windows workstation:
ping -a 1.2.3.4
expected response: mail.kunde.at
Optionally test the internal DNS name, only for scenario 2:
ping grommunio.kunde.local
expected response: 192.168.1.1
Important: if there are errors in the DNS resolution, they must be fixed!
Q&A
How to set the hostname
- edit the
/etc/hosts
file and change the line as shown above. External: 192.168.1.1 mail.kunde.at mail
or internal: 192.168.1.1 grommunio.kunde.local grommunio
.
- all other files can be changed with command
hostnamectl set-hostname ...
to set e.g. the internal hostname: hostnamectl set-hostname grommunio.kunde.local
- command
hostname
return the set hostname as FQDN.
If the hostname
was created incorrectly
There are some files in which the FQDN hostname must be entered, but these files do not have to exist on all systems. In these files you can (recommended) use the external hostname, in /etc/postfix/main.cf
you have to use the external hostname.
/etc/gromox/autodiscover.ini:/var/lib/gromox/user = mail.kunde.at
/etc/gromox/autodiscover.ini:/var/lib/gromox/domain = mail.kunde.at
/etc/gromox/autodiscover.ini:hostname = mail.kunde.at
/etc/gromox/http.cfg:host_id = mail.kunde.at
/etc/gromox/mysql_adaptor.cfg:schema_upgrades = host:mail.kunde.at
/etc/postfix/main.cf:myhostname = mail.kunde.at
About IPv6
Internally grommunio needs IPv6, i.e. IPv6 must be enabled, but the server does not need an IPv6 address.
Troubleshooting
If the tests work up to here, mail sending, EAS and also grommunio-web should work.
If it still does not work, the most important points / commands
- are all services are running:
systemctl --failed
- restart of processes necessary:
SUSE: zypper ps -s
Debian: needrestart
*1
- is IPv6 enabled?
ping6 ::1
- is there enough disk space:
df -h
- perform schema update:
gromox-dbop -U
- what does the system log show:
journalctl-f
- what do the nginx/grommox logs show:
tail /var/log/grommunio/* -f
- restart php-fpm:
systemctl restart php-fpm
- reboot the server - important after first installation:
init 6
- reload web page with:
CTRL
- SHFT
- R
especially recommended for grommunio-web after an update.
*1 For Debian, the packages needrestart
and reboot-notifier
must be installed: apt update; apt install needrestart reboot-notifier
Closing words
I hope this tutorial helps to solve connection problems. I am glad about feedback.
Please note, this guide may contain errors.