Unable to send email

I have a new installation of Seafile and everything works except email. When checking on my mailserver (self hosted) I can see it trying to make a TCP connection but won’t even complete it. Seafile will reset the connection before it even is completed.

192.168.0.108 = Seafile
192.168.0.104 = mail-server

It does this for 3 times and then shows the following line in seahub.log:

2020-11-17 17:47:25,723 [INFO] seafes:162 load_seafevents_conf [seafes] use highlighter fvh
2020-11-17 17:47:32,956 [INFO] seafes:162 load_seafevents_conf [seafes] use highlighter fvh
2020-11-17 17:48:04,603 [ERROR] seahub.api2.endpoints.send_share_link_email:111 post [Errno 110] Connection timed out
2020-11-17 17:58:35,706 [INFO] seafes:162 load_seafevents_conf [seafes] use highlighter fvh

My config is:

EMAIL_USE_TLS = False
EMAIL_HOST = 'mailserver-hostname'
EMAIL_HOST_USER = 'admin@mydomain.ltd'
EMAIL_HOST_PASSWORD = '*********'
EMAIL_PORT = 25
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER
REPLACE_FROM_EMAIL = False
ADD_REPLY_TO_HEADER = True

Even enabling debugging doesn’t show any additional log entries. So not sure why it won’t complete the TCP connection and tries to send the email.

Anybody any ideas?

OK I just seem to have fixed it, but replacing the mailserver hostname with the IP address. Not sure why that would work since the hostname does resolve to the same IP:

seafile@seafile:/opt/seafile/seafile-pro-server-7.1.8$ host mailserver
mailserver has address 192.168.0.104

But it is resolved now :slight_smile: