Solved OpenDKIM not starting anymore

Hello all,
I have a problem with opendkim not starting anymore on my FreeBSD machine and I hope you can help me solve it. The opendkim package I'm using is 2.10.3 installed through "pkg install"on FreeBSD 10.2 RELEASE p13.
If I try to run the service normally everything seems fine
Code:
root@$$$$:/home/$$$$ # service milter-opendkim start
Starting milteropendkim.
but the service doesn't start
Code:
root@$$$$:/home/$$$$ # tail -n 3 /var/log/maillog
Apr  2 18:32:59 $$$$ opendkim[5245]: OpenDKIM Filter: Unable to bind to port inet:18891@localhost: Can't assign requested address
Apr  2 18:32:59 $$$$ opendkim[5245]: OpenDKIM Filter: Unable to create listening socket on conn inet:18891@localhost
Apr  2 18:32:59 $$$$ opendkim[5245]: smfi_opensocket() failed
The port is not used by anything else right now:
Code:
root@$$$$:/home/$$$$ # sockstat -4 | grep 18891
root@$$$$:/home/$$$$ #
Also, trying to running the daemon manually, even with verbose output, it doesn't return any error but the daemon does not run with the same error message:
Code:
root@$$$$:/home/$$$$ # opendkim -vvv -x /usr/local/etc/mail/opendkim.conf -p inet:18891@localhost -u opendkim
root@$$$$:/home/$$$$ # tail -n 3 /var/log/maillog
Apr  2 18:38:23 $$$$ opendkim[5265]: OpenDKIM Filter: Unable to bind to port inet:18891@localhost: Can't assign requested address
Apr  2 18:38:23 $$$$ opendkim[5265]: OpenDKIM Filter: Unable to create listening socket on conn inet:18891@localhost
Apr  2 18:38:23 $$$$ opendkim[5265]: smfi_opensocket() failed

So far I tried to see if there was any update available for my system but everything is up to date, I tried resintalling opendkim without success. I also tried disabling PF and kernel secure level but nothing changes.

Has anybody encountered this issue and managed to solve it? Can you please point me towards any direction on how I could continue troubleshooting this? Any help is really appreciated.
 
I think that error most commonly means it can't find the interface or address you're trying to open a socket on. I'd make sure the machine can resolve localhost (trying pinging localhost and check /etc/hosts if there's a problem) and that lo0 is up.

It may just be something that's got itself in a mess. You may find a reboot fixes it, although that won't help find out what caused it.
 
I think that error most commonly means it can't find the interface or address you're trying to open a socket on. I'd make sure the machine can resolve localhost (trying pinging localhost and check /etc/hosts if there's a problem) and that lo0 is up.

It may just be something that's got itself in a mess. You may find a reboot fixes it, although that won't help find out what caused it.

I don't know how but a non-visible character got in my hosts files and prevented the localhost entry to be resolved correctly, it is weird how other services that bind on localhost kept on working flawlessly...
Thank you very much for your suggestion, I probably didn't look into it deep enough.
 
Back
Top