Nextcloud fedora 38 install many problems remain without answer... sendmail

Bonjour,

I installed nextcloud on a fedora 38 server and I am unable to configure sendmail.
sendmail is linked to ssmtp via alternatives.
ssmtp works find with logwatch, fail2ban, etc…
With the same config if I try to send a mail from nextcloud, I get this error message:

Erreur: Expected response code 220 but got an empty response

What can I do?

Thank you.

F.P.

Well, for starters you can post your NC mail configuration. :slight_smile:

All the mail_* entries from your config.php and simply post the output of occ config:list system.

Hi @frpatte

Is there a specific reason why you want to run your Nextcloud server on Fedora?

I’m asking because Fedora is something like a bleeding edge playground that might eventually become RHEL, so I’d say it’s a rather suboptimal platform to run a production server on it, and it’s not officially supported by the Nextcloud GmbH either.

Honestly, I would recommend you to switch to Debian stable, Ubuntu LTS or to a RHEL derivative. The official documentation and most guides you can find on the internet are based on one of those platforms, and most users in the forums are using some sort of LTS distribution or Enterprise Linux derivative for their servers. In addition to this, it’s probably needless to say that also the devs are mostly, if not exclusively, testing their work on the officially supported distributions.

So the chance that something just works is much higher if you are using one of the supported platforms, and so is chance to find help in case something doesn’t work.

Here is the result of occ config:list system.

{
“system”: {
“log_type”: “file”,
“logfilemode”: 416,
“loglevel”: 2,
“syslog_tag”: “Nextcloud”,
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“updatechecker”: false,
“check_for_working_htaccess”: true,
“asset-pipeline.enabled”: false,
“assetdirectory”: “/var/lib/nextcloud”,
“preview_libreoffice_path”: “/usr/bin/libreoffice”,
“apps_paths”: [
{
“path”: “/usr/share/nextcloud/apps”,
“url”: “/apps”,
“writable”: false
},
{
“path”: “/var/lib/nextcloud/apps”,
“url”: “/apps-appstore”,
“writable”: true
}
],
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“localhost”,
REMOVED SENSITIVE VALUE
],
“dbtype”: “mysql”,
“version”: “25.0.3.2”,
“overwrite.cli.url”: “http://localhost”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“instanceid”: “REMOVED SENSITIVE VALUE”,
“mail_smtpmode”: “sendmail”,
“mail_sendmailmode”: “pipe”,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_domain”: “REMOVED SENSITIVE VALUE”,
“default_phone_region”: “fr”
}
}

I changed the “mail_sendmailmode” to “pipe” which is the only mode for which the mail test answer that a mail has been sent… Unfortunately I can see in the maillog file that the mail cannot be sent because the smtp relay cannot be opened (“permission denied”)…
I tried, without any success to add “mail_smtpdebug” => true;

I use ssmtp on this server and it works fine… I suspect that the nextcloud config somewhere changes my login name to my email provider with the name “apache” but I cannot see if it is the problem, the smtpdebug does not add anything to the maillog.

Moreover the nextcloud.log file is unreadable!

Thank you for lights.

F.P.

Problem solved. Mode Sendmail : pipe

1- setsebool -P httpd_can_sendmail on

2- in /etc/ssmtp/ssmtp.conf
FromLineOverride=YES

@bb77

I use fedora because I have been using redhat distrib since 20 years (I think) I began to use redhat before the “birth” of fedora.

If nextcloud works on RHEL I can’t see any reason why it won’t work on fedora 38.

I struggle with the nextcloud docs which I find very approximate (e.g. something like “in the file config.php” Ok! where is it? Is it so difficult to tell: “in the file /etc/nextcloud/config.php”?

I am not the only one struggling with docs, I found a thread about some config problems, at the end the OP concluded :
“Thank you very much for these explanations, but nothing works!”

F.P.