Solved OpenSMTPD in jail - bind: address already in use

lib13

Active Member

Reaction score: 8
Messages: 138

I'd like to have OpenSMTPD in a jail to process email for a domain I rent. I've done some configuration and when try to run it it says:
Code:
fatal: smtpd: bind: Address already in use

sendmail is working in the host and in each of the other jails with no problems of binding. In each, I haven't changed anything of the configuration files, as I didn't need and also don't have a clue on how to modifications.

The network interfaces are configured like:
from the host's /etc/rc.conf:
Code:
cloned_interfaces="lo1"
ifconfig_lo1="inet 192.168.0.1 netmask 255.255.255.0"

and:
Code:
  lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
  options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
  inet 192.168.0.1 netmask 0xffffff00
  inet 192.168.0.2 netmask 0xffffffff
  inet 192.168.0.3 netmask 0xffffffff
  inet 192.168.0.4 netmask 0xffffffff
  inet 192.168.0.5 netmask 0xffffffff
  inet 192.168.0.6 netmask 0xffffffff
  inet 192.168.0.7 netmask 0xffffffff
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL


What should I do in order to be able to process incoming and outgoing emails for my domain in a jail without this binding problem?
 

Nulani

Member

Reaction score: 9
Messages: 36

Could you also paste smtpd.conf? An initial guess is that opensmtpd is trying to listen to 127.0.0.1.
 

tobik@

Daemon
Developer

Reaction score: 1,421
Messages: 1,909

Please also show the output of sockstat -P tcp -l (preferably from outside the jail if possible).
 
OP
L

lib13

Active Member

Reaction score: 8
Messages: 138

Could you also paste smtpd.conf? An initial guess is that opensmtpd is trying to listen to 127.0.0.1.

Here it is:
Code:
# cat /usr/local/etc/mail/smtpd.conf | grep -v '^#' | grep -v '^ *$'
pki mail.myserver.com certificate "/usr/local/etc/ssl/myserver_wosign_apache.crt"
pki mail.myserver.com key "/usr/local/etc/ssl/private/myserver_wosign_apache.key"
listen on 192.168.0.5
listen on 192.168.0.5 tls pki mail.myserver.com auth-optional
listen on 192.168.0.5 port submission tls-require pki mail.myserver.com auth
table aliases file:/etc/mail/aliases
table vusers file:/usr/local/etc/mail/vusers
table vdomains file:/usr/local/etc/mail/vdomains
accept for local alias <aliases> deliver to maildir
accept from any for domain <vdomains> virtual <vusers> deliver to maildir
accept from local for any relay
 
OP
L

lib13

Active Member

Reaction score: 8
Messages: 138

Please also show the output of sockstat -P tcp -l (preferably from outside the jail if possible).

The output:
Code:
# sockstat -P tcp -l | grep ':25'
root  sendmail  16522 3  tcp4  192.168.0.8:25  *:*
root  sendmail  2260  3  tcp4  192.168.0.3:25  *:*
root  sendmail  2018  4  tcp4  192.168.0.2:25  *:*
root  sendmail  1757  3  tcp4  192.168.0.7:25  *:*
root  sendmail  1624  3  tcp4  192.168.0.4:25  *:*
root  sendmail  1614  3  tcp4  192.168.0.6:25  *:*
root  sendmail  871  4  tcp4  127.0.0.1:25  *:*
 

Nulani

Member

Reaction score: 9
Messages: 36

Code:
listen on 192.168.0.5
listen on 192.168.0.5 tls pki mail.myserver.com auth-optional
Both these lines instruct OpenSMTPD to listen on 192.168.0.5 port 25. You can safely remove the first line and still accept e-mail from servers that do not support STARTTLS.
 
OP
L

lib13

Active Member

Reaction score: 8
Messages: 138

Code:
listen on 192.168.0.5
listen on 192.168.0.5 tls pki mail.myserver.com auth-optional
Both these lines instruct OpenSMTPD to listen on 192.168.0.5 port 25. You can safely remove the first line and still accept e-mail from servers that do not support STARTTLS.

That was it, thank you very much, Nulani!
 
Top