[SOLVED] Sending mails via seahub does not work

Hello community,

I am running seafile-server-6.2.5 on debian with apache and I am currently trying to get seahub to send mails.
Sending a download link via seahub will say “Internal server error, or please check the email(s) you entered”.

logs/seahub.log does not show any related error or warning.

conf/seahub_settings.py:
SECRET_KEY = “xxxxx”

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘seahub-db’,
‘USER’: ‘seafile’,
‘PASSWORD’: ‘xxxx’,
‘HOST’: ‘127.0.0.1’,
‘PORT’: ‘3306’
}
}

FILE_SERVER_ROOT = ‘https://xxxx.xxxxx.at/seafhttp

CACHES = {
‘default’: {
‘BACKEND’: ‘django.core.cache.backends.memcached.MemcachedCache’,
‘LOCATION’: ‘127.0.0.1:11211’,
}
}

EMAIL_USE_TLS = True
EMAIL_HOST = ‘smtp.gmail.com’ # smpt server
EMAIL_HOST_USER = ‘xxxx.xxxx@gmail.com’ # username and domain
EMAIL_HOST_PASSWORD = ‘xxxxxx’ # password
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER

Any ideas?
Help is much appreciated!

Probably you should use App specific Gmail password :slight_smile:

NKelemen18

Thanks for your reply but I have no 2 factor authentification enabled. And it is not working with other mail services either.

Did you opened the ports for mail?

I did not think about port 25, only 465 and 587 were open. :man_facepalming:
Thank you! Now it works perfectly! :smiley:

Edit:
Ok this is very strange now: I sent 3 mails and it worked. But now it stopped working. I have no idea why it does not work anymore. Ports are still all open.

According to your config you are using port 587. Are there still nor errors in the log file?

Yes I am using port 587 but it appears that apart from that port 25 has to be open as well.

Still no related entry in the log file.
The only anormality is this entry, that appeared three times today but it does not look related:
2018-06-15 11:32:19,829 [ERROR] seahub.thumbnail.views:77 latest_entry [Errno 2] No such file or directory: ‘/home/username/seafile/seafile-server-6.2.5/seahub/seahub/…/…/…/seahub-data/thumbnail/1024/9deaf44ce6901a69777f72b18cd73eaacc4a5419’

(Edit: Ok never mind this log entry, I think this was caused by rebooting my server.)
Still not sending mails.

EDIT:
Yey! I fixed it, there was another problem caused by a problem of the DNS of my internet provider.
Temporary fix till next reboot (changes the DNS to google’s own public DNS), as root:
echo “nameserver 8.8.8.8” | sudo tee /etc/resolv.conf > /dev/null
Permanent fix: wait till DNS error is resolved or change DNS permanently.
It is the same problem as here:

Thank you guys for your help! Finally it works. :smile:

1 Like