How send email notifications of file changes?

Hello, I am using version 8.0.x.

I have the server configured according to the manual: sending mail.

But I don’t get the notification emails (pro) or the file changes. some help?

Please check the seahub_email_sender.log.

Can you help me find the error? The record is very long, but this is what is repeated. Thanks.

^
SyntaxError: invalid syntax
Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/thirdpart/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/thirdpart/django/core/management/init.py”, line 325, in execute
settings.INSTALLED_APPS
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/thirdpart/django/conf/init.py”, line 79, in getattr
self._setup(name)
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/thirdpart/django/conf/init.py”, line 66, in _setup
self._wrapped = Settings(settings_module)
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/thirdpart/django/conf/init.py”, line 157, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 961, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/seahub/init.py”, line 4, in
from .handlers import repo_created_cb, repo_deleted_cb, clean_up_repo_trash_cb,
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/seahub/handlers.py”, line 4, in
from . import settings
File “/opt/seafile/seafile-pro-server-8.0.10/seahub/seahub/settings.py”, line 869, in
import seahub_settings
File “/opt/seafile/conf/seahub_settings.py”, line 55
OFFICE_WEB_APP_BASE_URL =
^
SyntaxError: invalid syntax

There you have the cause of your problem.

Line 55 in seahub_settings.py contains a syntax error. (It’s also possible that the error is in a previous line if you haven’t correctly terminated a line.)

Hello, in the file I have the recommended text:


OFFICE_SERVER_TYPE = ‘CollaboraOffice’

ENABLE_OFFICE_WEB_APP = True

OFFICE_WEB_APP_BASE_URL = ***********************************************************

WOPI_ACCESS_TOKEN_EXPIRATION = 30 * 60

OFFICE_WEB_APP_FILE_EXTENSION = (‘odp’, ‘ods’, ‘odt’, ‘xls’, ‘xlsb’, ‘xlsm’, ‘xlsx’,‘ppsx’, ‘ppt’, ‘pptm’, ‘pptx’, ‘doc’, ‘docm’, ‘docx’)

ENABLE_OFFICE_WEB_APP_EDIT = True

OFFICE_WEB_APP_EDIT_FILE_EXTENSION = (‘odp’, ‘ods’, ‘odt’, ‘xls’, ‘xlsb’, ‘xlsm’, ‘xlsx’,‘ppsx’, ‘ppt’, ‘pptm’, ‘pptx’, ‘doc’, ‘docm’, ‘docx’)


In line 55 (OFFICE_WEB_APP_BASE_URL =), I have my server on and everything works correctly, I can open documents and edit and save them without problems. I’m going to delete the comments and leave the lines alone to see if that may be the problem. Any more ideas?

Excuse me, I had sent the text with the mobile and I had not realized how bad it was.

I’m still working to find out what is happening. I have looked at another log:
Extract to: file_updates_sender.log

[2021-09-30 19:31:00.473817] Start sending file updates emails...
[2021-09-30 19:31:00.476463] Set language code to en for user: *****@****.com
[2021-09-30 19:31:00.490886] Set language code to en for user: *****@****.com
[2021-09-30 19:31:00.517037] Set language code to es for user: *****@****.com
[2021-09-30 19:31:00.519224] Finish sending file updates emails.

[2021-09-30 19:36:01.934798] Start sending file updates emails...
[2021-09-30 19:36:01.937456] Set language code to en for user: *****@****.com
[2021-09-30 19:36:01.951941] Set language code to en for user: *****@****.com
[2021-09-30 19:36:01.978387] Set language code to es for user: *****@****.com
[2021-09-30 19:36:01.980479] Finish sending file updates emails.

[2021-09-30 19:41:03.392013] Start sending file updates emails...
[2021-09-30 19:41:03.394670] Set language code to en for user: *****@****.com
[2021-09-30 19:41:03.408891] Set language code to en for user: *****@****.com
[2021-09-30 19:41:03.435037] Set language code to es for user: *****@****.com
[2021-09-30 19:41:03.436907] Finish sending file updates emails.

It seems like every 5 minutes I send an email, but I don’t see anything. Also, that the established time is in 1 h as seen in the image above.

I have the seafevent file configured as follows:

[SEAHUB EMAIL]
enabled = true
interval = 1h

Where do you think the error may be so that I cannot receive updates emails?

It’s getting a bit confusing here. So one step at a time.

1.) Do you still have the syntax error in your seahub_email_sender.log? Are there any other error messages in the other log files?

2.) The log posted in your last message is pretty clear: Seafile sends the messages. It is possible that the sent messages end up in a spam filter? You can check with SWAKS if the mail credentials are correct. If the mails end up in trash, create a SPF record.

3.) It’s a good question why the log file reports a mail transfer every 5 minutes. Have you changed the value, but not restarted Seahub? (Edits only become effective after a restart of the the service.)

Hello, I have no problems with what you comment, but I have made the following inquiries (which I hope will be useful for the rest of the community).

The problem is that only shared libraries notifications are sent, notifications of changes to files in your private libraries are not sent.

One of the parts of the notification configuration is the seafevent.log file. The manual indicates this by default:

[FILE HISTORY]
enabled = true
threshold = 5
suffix = md,txt,...

## From seafile 7.0.0
## Recording file history to database for fast access is enabled by default for 'Markdown, .txt, ppt, pptx, doc, docx, xls, xlsx'. 
## After enable the feature, the old histories version for markdown, doc, docx files will not be list in the history page.
## (Only new histories that stored in database will be listed) But the users can still access the old versions in the library snapshots.
## For file types not listed in the suffix , histories version will be scanned from the library history as before.
## The feature default is enable. You can set the 'enabled = false' to disable the feature.

## The 'threshold' is the time threshold for recording the historical version of a file, in minutes, the default is 5 minutes. 
## This means that if the interval between two adjacent file saves is less than 5 minutes, the two file changes will be merged and recorded as a historical version. 
## When set to 0, there is no time limit, which means that each save will generate a separate historical version.

## If you need to modify the file list format, you can add 'suffix = md, txt, ...'

In my case, I have not been able to change this time to 5 minutes by default (if you look above, a scan is made and an email is sent every 5 minutes). I have changed the value from “threshold = 5” to “threshold = 10”, but nothing has changed.

All the extensions that are included in “suffix”, in case of change in the file, the update is sent:

[2021-09-30 22:35:41.367637] Start sending file updates emails...
[2021-09-30 22:35:41.371378] Set language code to en for user: ****@****.com
[2021-09-30 22:35:41.386035] Set language code to en for user: ****@****.com
[2021-09-30 22:35:43.707080] Successful to send email to ****@****.com
[2021-09-30 22:35:43.716108] Set language code to es for user: ****@****.com
[2021-09-30 22:35:43.718423] Finish sending file updates emails.

If I change the option to not send email, the line disappears:

[2021-09-30 22:35:41.371378] Set language code to en for user: *****@****.com

This line, is deleted. The user does not receive email.

However, if I change this option, everything remains the same, I do not know what disappears, because I have not been able to receive email with the notifications that are discussed.

I’ll keep looking, but I think that all this that I’m finding out should be in the manual …