Seafile in docker + email in docker, cannot send emails


#1

I have basically the same setup on my gitea server:

  1. gitea in a container, no ports mapped
  2. jwilder front proxy that redirects properly
  3. an email server in a docker container on the same host

It works perfectly, although I had to disable ssl certificate verification, because it was self-signed.

So for email to work from seafile, I did the same thing:

EMAIL_USE_TLS = True
EMAIL_HOST = 'dockermail' 
EMAIL_HOST_USER = 'seafile@mydomain.com'
EMAIL_HOST_PASSWORD = 'somePassword'
EMAIL_PORT = 465
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER

STARTTLS is disabled on my server, so is port 587. ‘dockermail’ is a hostname resolving to the internal ip address of the container. It’s pingable and port 465 is open.

However, when creating a new account with confirmation email, the user dialog hangs and after quite a while I get:

2018-06-08 22:23:16,420 [ERROR] seahub.views.sysadmin:1150 user_add Connection unexpectedly closed

The mail account I register at is working, I verified with an email program. I suspect seafile is doing some very fishy stuff in order to connect to the email host.

I also see an smtpd connection on the postfix side, but nothing happens. I strongly suspect this is a certificate issue, maybe also because of the odd EMAIL_HOST name?


#2

Try EMAIL_USE_SSL instead of _TLS, please.


#3

You are right, that worked perfectly, thanks!

I don’t see that option documented in https://manual.seafile.com/config/sending_email.html. Maybe the documentation needs a fix.