Next cloud not sending any emails

Hi guys,

had Nextcloud running on a shared hosting @ all-inkl.com, german shared hosting provider with no probs. After a clean re-install with the web installer i can’t even send sendmail emails from nextcloud. no settings are working. always “Beim Senden der E-Mail ist ein Problem aufgetreten. Bitte überprüfen Sie Ihre Einstellungen. (Fehler: E-Mail konnte nicht versandt werden. Prüfen Sie Ihr E-Mail-Server-Protokoll)” - no errors on php errorlog. same with the old working smtp setup.

any solutions for this?

current config.php is wrong i think. even with just sendmail and emailaddress entered in /index.php/settings/admin - button saved appears - the content of config.php won’t change. chmod was 640 - that’s wrong i think. shouldn’t it be 740?

but even with that, sendmail > saved message the content still stays

‘mail_domain’ => ‘xxx’,
‘mail_from_address’ => ‘xxx’,
‘mail_smtpmode’ => ‘sendmail’,
‘mail_smtphost’ => ‘xxx’,
‘mail_smtpauth’ => 1,
‘mail_smtpport’ => ‘465’,
‘mail_sendmailmode’ => ‘smtp’,

No, 640 is correct!

It is important, that it is owned by the user running nextcloud. Normaly the webserver user (www-data on debian/Ubuntu)

About your mailsettings:

How do you in fact connect to your mailserver? Is a complete MTA installed with a working sendmail binary or do you connect to smtp like described here: FAQ - Häufig gestellte Fragen & Antworten zum Webhoster ALL-INKL.COM

I would try to use this settings instead of sendmail:

  'mail_smtpmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '<sender>',
  'mail_domain' => '<Ihre-Maildomain>',
  'mail_smtphost' => '<Ihr-Login>.kasserver.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => '<Ihr-Login>',
  'mail_smtppassword' => '**TOPSECRET**',

This would send the emails over the smtp server you registered for your (sub)domain with <sender> as sender with STARTTLS (which is in fact the successor of the older smtps)

I hope this solves your problem!
Much luck
ernolf

thanks ernolf!

change config.php to 640 again.
i’m pretty sure allinkl got sendmail / php 8.1
anyway, set up your smtp in config.
updated private credentials.
uploaded config.php
when i go to /index.php/settings/admin
is still don’t see the setup saved to config.php

chown isn’t possible due to newer ubuntu @ all-inkl.
contacted support…

I have a suspicion. Could it be that you are editing the wrong config.php file?

Can you please compare the 'instanceid' stored in the config.php you edited with the one used by the instance you open in the browser?

You get the latter with this command:
(change URI accordingly, no http(s):// needed)

URI=cloud.yourdomain.tld
curl -sLI $URI | grep -i 'set-cookie: [[:alnum:]]\{12\}=' | awk -F'[ =]' '{print $2}' | sort -u

much luck,
ernolf

unfortunately, no CLI on shared hosting.
instanceID onconfig.php is somethng cryptic, but from the config.php generated new on web install.

You should run it from a linux terminal at your home of course :wink:

Much luck
ernolf

Since you didn’t answer, I was guessing if you don’t have Linux running locally and don’t know how?

Simply install MobaXterm. That gives you a Linux (Cygwin, Busybox) terminal on your windows box that can run that kind of commands.
It is a PuTTTY based Terminal and SSH-Client and SFTP browser. In addition it comes with an X-Server (Including Mesa Open GL), so you can run applications on remote Linux-servers with the GUI tunneled to that X-Server on your local windows box.
A kind of all in one must have client.

Much luck,
ernolf

new to me. interesting. i’ll give it a try as soon as all-inkl git my ssh login problems fixed.

with mobaxterm i also should be able to run the “real” installer from shell, right? or even use sudo -u www-data php occ upgrade - whilst on all-inkl server the user www-data is long gone. not that unfamiliar with shell…but really scared of running in just the next problems.

i did the clean reinstall with the web installer as i don’t have straight commandline @ all-inkl.com.

one of the problems i had with the last installation: using the web installer NC doesn’t provide the updater secret plantext owhere, right? i tried to hash a new one…still no luck…

@ff-webdesigner , I realy want to help you to get a working mail in your installation but you’re not doing things systematically, at least that’s what it looks like to me.

I thought, all-inkl doesn’t provide ssh login? Your words:

But annyhow, that got nothing to do with my question:

Or have you given up on your issue and doesn’t take it as seriously as it looked first?

Do you still need help?

Much luck,
ernolf

hi ernolf,

sry, i thought even mobaxterm needs ssh. checking my reseller i found a hidden option for ssh. activated it, got ssh running. i’ll check instance id as soon as a got some time to do so… thanks for your help so far!

No. It does not need ssh. The command I provided makes use of curl. That is a command line interface to internet servers like your cloud. MobaXterm has curl. So you should simply start the terminal an paste my command and execute it. That’s all.

Much luck,
ernolf

thanks ernolf,

tried both in putty, in mobaxterm local terminal and in ssh. no output nowhere. uri is correct.
curl is supported on ssh allinkl: Anleitungen, KAS, Tools, Dateiverwaltung: verwendbare SSH-Befehle

  • Open MobaXterm
  • Click on “Packages”
  • Install linux packages needed (coreutils, gawk, curl, dash etc)

Much luck,
ernolf

thanks! now i got the instance id. it’s the same as in config.php. a good friend of mine is quite firm with NC. he pretended that the config.phpis not even parsed by NC. allinkl and i disagree, because then the whole NC wouldn’t be running, no login etc.

What is “NC.allinkl”?

ernolf

config.pgp is not parsed by nextcloud @ allinkl. that’s what my friend thought. i disagree, because NC is up and running. just the mail configuration not displayed or saved in NC admin.

i already did a 2nd blank installation with web installer. same effect.

Let me summarize:
If you make the changes in config.php, they do not get visible in /settings/admin.

But what if you specify the settings the other way around correctly in the web frontend under /settings/admin, i.e.:

Send mode = SMTP
Encryption = None/STARTTLS
From address = sender @ your.maildomain
Server address = <your-login>.kasserver.com : 587
Authentication = :ballot_box_with_check: Authentication required
Credentials = <Ihr-Logn> **TOPSECRET**

then press “Save” Button.

If that does not work ass well, I cannot help you.

Much luck,
ernolf

when i edit mail settings, i see only mail_smtpname and mail_smtppassword set correctly in configure.php. nothing else.

added

‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpsecure’ => ‘tls’,
‘mail_smtphost’ => ‘w01d5645.kasserver.com’,
‘mail_smtpport’ => 465,
‘mail_smtpauth’ => true,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtpname’ => ‘xxxx’,
‘mail_smtppassword’ => ‘xxxxx’,

manually. checked 587/ssl and 25 as well as sendmail.
error always stays the same.
nothing visible on nextcloud.log, even on highest log levels.