Dovecot gives me Fatal: Invalid system hostname: ''.

R6exe

Member

Reaction score: 2
Messages: 32

When I try to restart the service with the command service dovecot restart it just gives me this error Fatal: Invalid system hostname: '' which I don't know how to solve.
I tried to find in the dovecot.conf and in other configuration files some keywords about hostname, but I couldn't find anything.
All I did just for now was install the service dovecot 2.3.13, copy the files it needed on it's config directory, and that's it, I didn't make any other actions or changes to the service.
As I can see there's not so much information about this problem in the internet, so that's why I decided to ask for help in here.
Thank you so much for your help.
Regards.
 
OP
R

R6exe

Member

Reaction score: 2
Messages: 32

Edit the /usr/local/etc/dovecot/conf.d/15-lda.conf
Hi, I did uncomment the variable hostname in that file but unfortunately when I restart the service again it gaves me the same problem. Even if I reboot. But thank you anyways.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,545

I did uncomment the variable hostname in that file
Just uncommenting it doesn't help. You need to provide the actual hostname of the machine here. But you shouldn't need to set this anyway as it automatically picks the hostname from the host itself. Which leads me to believe you haven't set a proper hostname in rc.conf, there really should be one (unless this is a jail, in which case it needs to be set in jail.conf). What does hostname -f output?

Code:
hostname="myhost.example.com"
 
OP
R

R6exe

Member

Reaction score: 2
Messages: 32

Just uncommenting it doesn't help. You need to provide the actual hostname of the machine here. But you shouldn't need to set this anyway as it automatically picks the hostname from the host itself. Which leads me to believe you haven't set a proper hostname in rc.conf, there really should be one (unless this is a jail, in which case it needs to be set in jail.conf). What does hostname -f output?

Code:
hostname="myhost.example.com"
Hi SirDice.
With the command hostname -f doesn't output anything to the terminal.
Y added two quotation marks in the hostname value and it's still giving me the error.
Thank you.
 
OP
R

R6exe

Member

Reaction score: 2
Messages: 32

All right so in rc.conf I added a name to the hostname and now dovecot is giving me another problem.
Code:
doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory. Dovecot is not running.
Should I pass the dovecot.conf file in the etc folder inside /var/run/dovecot/?
Thanks.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,545

How are you starting dovecot? You should start it with service dovecot start.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,745
Messages: 36,545

/var/run/dovecot should contain a symlink:
Code:
root@mail:~ # ls -l /var/run/dovecot/dovecot.conf
lrwx------  1 root  wheel  35 Jan 10 14:54 /var/run/dovecot/dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf
 
Top