server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: 30.0.0 share by email - no email is sent

Open himpierre opened this issue 1 year ago • 19 comments

⚠️ This issue respects the following points: ⚠️

Bug description

Hello Devs.

After updating to 30.0.0 sharing files via email does not work as it is supposed to I guess. There is no mail being sent to the sharee. So the one I try to share the files with is not getting notified. Nothing in the logs. Email in general works. Invitations for talk go out.

Steps to reproduce

  1. Share file via Email
  2. Save
  3. No email to the sharee

Expected behavior

Sharee gets notified.

Nextcloud Server version

master

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 28 to 29)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.0.14",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "maintenance_window_start": 3,
        "theme": "",
        "trusted_domains": [
            "fluffycloud.de"
        ],
        "mail_smtpmode": "sendmail",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "log_rotate_size": 104857600,
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "htaccess.RewriteBase": "\/",
        "updater.release.channel": "stable",
        "preview_max_filesize_image": -1,
        "overwrite.cli.url": "https:\/\/fluffycloud.de\/",
        "mysql.utf8mb4": true,
        "default_phone_region": "DE",
        "defaultapp": "files",
        "app_install_overwrite": [
            "calendar",
            "groupfolders",
            "mail",
            "spreed",
            "passman",
            "audioplayer",
            "polls",
            "passwords",
            "breezedark"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - calendar: 5.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.0
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notes: 4.10.1
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - oidc: 0.9.4
  - password_policy: 2.0.0
  - passwords: 2024.7.20
  - photos: 3.0.2
  - polls: 7.2.3
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - bruteforcesettings: 3.0.0 (installed 2.4.0)
  - circles: 30.0.0-dev (installed 27.0.0)
  - encryption: 2.18.0
  - federation: 1.20.0 (installed 1.17.0)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - groupfolders: 18.0.1 (installed 18.0.1)
  - secrets: 2.0.3 (installed 2.0.3)
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev (installed 5.0.0)
  - user_ldap: 1.21.0
  - whiteboard: 1.0.1 (installed 1.0.1)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

himpierre avatar Sep 15 '24 12:09 himpierre

The same here. But the function is essential for me (and probably for others too).

Bad-and-Mad avatar Sep 16 '24 10:09 Bad-and-Mad

The same here. But the function is essential for me (and probably for others too).

Yes its the only usecase for our company. Same problem here, just restored the old version from backup and waiting for the fix.

hxcde avatar Sep 17 '24 09:09 hxcde

The same here. But the function is essential for me (and probably for others too).

Yes its the only usecase for our company. Same problem here, just restored the old version from backup and waiting for the fix.

Lucky you. In our case, by the time I realized it, so much data had been changed that it no longer made sense to restore the backups for a downgrade. Unfortunately, I now have to wait for the error to be rectified. However, I cannot understand why such an important function for a version release was not tested extensively. My OpenOffice connection also only works if I change the program code. After that, however, the mail app no longer works. None of the last releases have caused so much trouble.

Bad-and-Mad avatar Sep 17 '24 10:09 Bad-and-Mad

Confirmed this is broken in 30.0.0. The [ Send Email ] button to test smtp works. However when you share a file by email address, the outside user never gets email. Confirmed that email is bouncing correctly to this same smtp host at the operating system level.

daveatpinellas avatar Sep 17 '24 18:09 daveatpinellas

Here is my log (level 0):

"Share notification not sent because mailsend is false."

{"reqId":"MVHwqqQbuNmAEozOhw5i","level":0,"time":"2024-09-24T12:54:28+02:00","remoteAddr":"x.x.x.x","user":"xyz","app":"share","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Share notification not sent because mailsend is false.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36","version":"30.0.0.14","data":{"app":"share"}}

Bad-and-Mad avatar Sep 24 '24 11:09 Bad-and-Mad

Hello Devs!

Is there maybe a patch or workaround we can try until this is fixed?

cheers!

himpierre avatar Sep 24 '24 12:09 himpierre

Dear developers, is there anyone who can tell us how to set mailsend to true? There must be a way in the code to influence this logical state, as it is also queried and evaluated by the sharing api.

Bad-and-Mad avatar Sep 26 '24 05:09 Bad-and-Mad

This issue deserves urgent attention. The email sharing function is a critical feature of Nextcloud, and we are now two weeks into a stable release with this functionality broken.

I've observed an additional detail that may be helpful for troubleshooting: When creating a new share, no email is sent to the recipient. However, if we edit an existing share (e.g., change the password or add a comment), emails are successfully sent.

This behavior suggests that the email sending mechanism itself is working, but there's a specific issue with the initial share creation process. Can the development team please investigate this discrepancy?

Given the importance of this feature for many users and organizations, we urgently need an update on the status of this bug and an estimated timeline for a fix. In the meantime, are there any workarounds that can be implemented to restore this functionality? If there's a specific commit that introduced this issue, would it be possible to temporarily revert that commit as a quick fix until a proper solution is developed?

Orobas42 avatar Sep 26 '24 05:09 Orobas42

The quick and dirty customization that works for me. But the function is essential for us.

File: NC_DIR/lib/private/Share20/Share.php

From line 590

        public function getMailSend() {
                // by M.W.
                // return $this->mailSend;
                return true;
        }

Bad-and-Mad avatar Sep 26 '24 06:09 Bad-and-Mad

This is really dirty. You shouldn't do it in the getter function, as this is also called in other places. The “better” dirty way is to set it to true at the actual place in the code.

File: /lib/private/Share20/Manager.php Line 740:

//if ($share->getMailSend()) {
if (true) {

Thats the place where the message “Share notification not sent because mailsend is false.” is raised.

But it's still the most dirty workaround in my opinion. What happens when you share with nc users or just want to share a link?

Orobas42 avatar Sep 26 '24 06:09 Orobas42

Better dirty is always possible. In any case, for now there is a solution that will help many people here who are dependent on the function. I don't want to wait another two weeks. And it is confirmed again and again: don't use a 0 version on productive systems.

Bad-and-Mad avatar Sep 26 '24 08:09 Bad-and-Mad

Better dirty is always possible. In any case, for now there is a solution that will help many people here who are dependent on the function. I don't want to wait another two weeks. And it is confirmed again and again: don't use a 0 version on productive systems.

Hello @Bad-and-Mad sorry you have had to deal with this for a while, this shall be fixed by the next release.

nfebe avatar Sep 26 '24 09:09 nfebe

Hello @Bad-and-Mad sorry you have had to deal with this for a while, this shall be fixed by the next release.

I assumed that the problem would be fixed in the next version, but for all those who have upgraded to version 30, a solution is needed for such an important function. Nobody knows when version 30.0.1 will be released and whether the problem will really have disappeared. I just hope that the change in the program code does not cause any further problems.

Bad-and-Mad avatar Sep 26 '24 10:09 Bad-and-Mad

Addendum: The program should not search for logical specifications that nobody can set...neither in the web frontend nor in the config.php.

Bad-and-Mad avatar Sep 26 '24 11:09 Bad-and-Mad

Bug does not seem to be fixed with 30.0.0.1-rc1.

himpierre avatar Oct 07 '24 13:10 himpierre

Bug does not seem to be fixed with 30.0.0.1-rc1.

https://github.com/nextcloud/server/pull/48381 is still open and not merged. Seems to be delayed b/c of vacation times of the maintainers?

thbemme avatar Oct 07 '24 14:10 thbemme

Release v30.0.1 does not fix the problem. We still need the dirty hack.

File: /lib/private/Share20/Manager.php
now Line 752:

//if ($share->getMailSend()) {
if (true) {

Unfortunately, this change results in another error during the system check:

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- files_texteditor
	- INVALID_HASH
		- appinfo/info.xml
- core
	- INVALID_HASH
		- .htaccess
		- lib/private/Share20/Manager.php

Raw output
==========
Array
(
    [files_texteditor] => Array
        (
            [INVALID_HASH] => Array
                (
                    [appinfo/info.xml] => Array
                        (
                            [expected] => a7ee0f424af602aa6ff896b4fd08c3304a199474e3bc99365ca1ca1ae9ed520d97d07da98c1360140a0dffefa417dc476cdc0ffc7baf94f73a591428d6bb6bb7
                            [current] => f836ebb5b7ec9c1fdc599e2316b9b3eae14a052f3737fce7528689203f7f79648a18f7d090a5c78b9c816566964b88fe67689b06a5d0122cecb2a644e414bd52
                        )

                )

        )

    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [.htaccess] => Array
                        (
                            [expected] => a8bc695a8fc167f325a305cb0c383e650573494640a06b4a50ad11aff7ca29d5cc855a818c1c489da6d453f895548a70268222cf5c82474bf7bdc1a47c4ac6cc
                            [current] => 517fc10f743af39795dc47344dd574f653b1840a3216fc131c16afa99917da18137190a23fbbdde961659298081d91a23a4b31dc4a10191f21e7cf1bda7a0c67
                        )

                    [lib/private/Share20/Manager.php] => Array
                        (
                            [expected] => 329a227526c305d07593a2fcc4dee77d8525ae2e642650bf272274be5fa52145d2b895e1741d6fc5f2e54d6168b547eba914da0d164ebc92072d62c63e727eeb
                            [current] => 10b626f5379f4fe80f6edcde716b2e4794718bb5f3457526dff224553536500ef1d6fe1e7d3aec8bdc1a3a8bd05b9bda80621afd16ad8c304877436ad9511772
                        )

                )

        )

)

I added 'integrity.check.disabled' => true, in config.php, which is also very dirty.

And all this more than a month after the error report was opened here. There would have been no point in waiting for version 30.0.1 before updating. Because the error still exists.

Bad-and-Mad avatar Oct 18 '24 05:10 Bad-and-Mad

We have the same problem in Version 29.0.7 Enterprise. We have 8000 users waiting for a solution. So please give it a higher priority.....

jfriedrichs85 avatar Oct 18 '24 10:10 jfriedrichs85

I find it very worrying that a bug in such an important function cannot be fixed for well over a month and that the problem even affects Enterprise installations. If there is no solution, the share by email function should be removed, because sharing by email includes sending emails to the recipient. It is also completely non-transparent that emails are sent after the password has been changed.

Yes of course, we can share everything manually as a link.

But sharing by link is a completely different function and always requires further manual steps by the sharer, such as manually composing an email to the recipient.

In addition, there has been no information for a very long time as to whether the problem has been resolved. People are now less and less confident about installing an update. Communication is simply not good.

Bad-and-Mad avatar Oct 18 '24 16:10 Bad-and-Mad

Another (30.0.1) user with the same problem. Was getting crazy on why this wouldn't work since invites for meetings do go through normally... Lets wait for the next realease...

Tchuch0 avatar Oct 23 '24 17:10 Tchuch0

Hello,

My implementation also relies heavily on this feature. I confirm that is it son functioning in 30.0.1.

dd4y avatar Nov 05 '24 14:11 dd4y

I have this problem in both a 30.0.1 and 30.0.2 rc2 instance. Is there a manual fix that can be done while waiting for a solution?

tigernero79 avatar Nov 06 '24 17:11 tigernero79

I have this problem in both a 30.0.1 and 30.0.2 rc2 instance. Is there a manual fix that can be done while waiting for a solution?

Workaround from @Bad-and-Mad works for me. https://github.com/nextcloud/server/issues/48012#issuecomment-2421453877

DerDP avatar Nov 06 '24 18:11 DerDP

I don't understand if the line should be removed or modified in the file manager.php

tigernero79 avatar Nov 06 '24 18:11 tigernero79

I don't understand if the line should be removed or modified in the file manager.php

Modified. In his example he commented out the old if statement and add new one.

DerDP avatar Nov 06 '24 18:11 DerDP

I have this problem in both a 30.0.1 and 30.0.2 rc2 instance. Is there a manual fix that can be done while waiting for a solution?

We do not expect to see this issue as from 30.0.2 rc1

nfebe avatar Nov 07 '24 06:11 nfebe

and yet I updated from 30.0.2 rc2 and the problem continues. given the changes made to the file, perhaps the file should also be modified?

File: /lib/private/Share20/Manager.php
now Line 752:

//if ($share->getMailSend()) {
if (true) {

tigernero79 avatar Nov 07 '24 08:11 tigernero79

Can someone else test it using 30.0.2 rc2?

I intended to do the upgrade to 30.0.2 once it is released, but if this major function is still broken I will postpone the upgrade.

LM-vb avatar Nov 07 '24 09:11 LM-vb

Just checked. Works for me with 30.0.2. Thanks Devs!

Am 7. November 2024 10:41:51 MEZ schrieb LM-vb @.***>:

Can someone else test it using 30.0.2 rc2?

I intended to do the upgrade to 30.0.2 once it is released, but if this major function is still broken I will postpone the upgrade.

himpierre avatar Nov 07 '24 10:11 himpierre

I updated to 30.0.2 final and still I only receive notifications if I rename files or folders, and nothing more

if I try to upload or delete some files or folders I don't receive any notification via email

the bug is still there

tigernero79 avatar Nov 07 '24 16:11 tigernero79