Open githubwujicz opened 1 month ago
After upgrade when mail_smtpmode is set to sendmail nextcloud doesn't send emails. It used to work just fine.
Any chance you have exec()
on your disabled_functions
list in PHP?
What version of Nextcloud did it last work for you?
If you are able, try the following patch (part of PR #46480) to get some additional logging (and also fix the fallback binary path handling when the binary search fails, which it appears to be happening in your environment for some reason):
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index e866cbfdbbc..aff6bd86b55 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -299,8 +299,10 @@ class Mailer implements IMailer {
break;
default:
$sendmail = \OCP\Server::get(IBinaryFinder::class)->findBinaryPath('sendmail');
- if ($sendmail === null) {
+ if ($sendmail === false) {
+ // fallback (though not sure what good it'll do)
$sendmail = '/usr/sbin/sendmail';
+ $this->logger->debug('sendmail binary search failed, using fallback ' . $sendmail, ['app' => 'core']);
}
$binaryPath = $sendmail;
break;
@@ -311,6 +313,7 @@ class Mailer implements IMailer {
default => ' -bs',
};
+ $this->logger->debug('Using sendmail binary: ' . $binaryPath, ['app' => 'core']);
return new SendmailTransport($binaryPath . $binaryParam, null, $this->logger);
}
}
I tested the patch and it solved the problem. Thank you.
I can also confirm that the patch works fine. Thank you very much!
⚠️ This issue respects the following points: ⚠️
Bug description
After upgrade when mail_smtpmode is set to sendmail nextcloud doesn't send emails. It used to work just fine. I used forkstat to see what is happening and I can see that /usr/sbin/sendmail isn't called
21:58:41 exec 28142 sh -c -bs 21:58:41 exit 28142 32512 0.003s sh -c -bs
Steps to reproduce
Expected behavior
email is sent
Installation method
Community Manual installation with Archive
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
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?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
Additional info
No response