I have basically the same setup on my gitea server:
- gitea in a container, no ports mapped
- jwilder front proxy that redirects properly
- 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 = 'firstname.lastname@example.org'
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?