NextCloud won't talk to mail

NethServer Version: Nethserver 8
Module: nextcloud 1.3.0

I just installed NextCloud today to add groupware features to my email server.

I try to connect my user to email, and I get the following error:

IMAP server is not reachable

the suggested solutions on this forum say to add the following line to to config.php in the Nextcloud container

‘app.mail.verify-tls-peer’ => false,

So I went in via podman and it appears that there is no text editor installed (nano, vim, etc), and I cannot install it because apt, apt-get, yum, and pkg are all unrecognized commands.

I wanted to try downloading and installing nano from the web, but that needs wget, tar, and make, and make seems to be missing from the container as well.

I’m pretty stuck.

The NextCloud and Mail servers are on the same node. I can reach the mail server on my LAN as well as from the Internet, and it has been working for some time.

My installation process for installing NextCloud simply involved me clicking on the “Install” button in NethServer’s Software Center. If there was prerequisite stuff to do beforehand, this is possibly where I messed up.

Any guidance is appreciated.

Did you use the mail server hostname? In the following thread also installing packages in containers and setting ‘app.mail.verify-tls-peer’ => false via occ are explained:

1 Like

As always mrmarkuz I am grateful for your guidance!

runagent -m nextcloud1 occ config:system:set --value true allow_local_remote_servers

I switched to the NextCloud user and ran the above command, with output indicating that it worked, but the problem persists. Next I used podman to restart the container in case that was needed to reload config.php, but it had no effect. I also cat’ed the file to make sure the new directive was added successfully, and it is in there.

For additional context since I saw it mentioned in the thread that you referenced, the mail server instance does indeed have a valid certificate, and for the mail server address, I added the FQDN of the mail server (reachable globally) The NextCloud instance, however, does not yet have a valid certificate (I was planning on doing LetsEncrypt after I got it up and running)

Again, I appreciate your guidance on this!

I have a feeling that I did something wrong during installation. I simply added it from the Software Center, but, I feel like there may be prerequisites that I don’t know about.

I got it working!

In addition to the steps recommended above (thank you again), I modified my host’s firewall rules so that the Trusted zone includes the following networks:

10.5.4.0/24 (default added by NethServer)
my LAN CIDR address (Added by me like a year ago, and I don’t remember why)
127.0.0.0/16 (The home CIDR address)

I looked at the hosts file and saw that there was an entry for the mail server. I tried changing that to a few different things, and what seemed to fix it was changing it to my LAN CIDR network address.

Thanks!

1 Like

Nethserver8 with Mail + Sogo + Netxcloud Hub 8 (29.0.10)
(snappymail2.38.2, mail3.7.24, …)**
Oh what an endless story…
Today after update Nethserver/core, mail. imapsync it’s the same message in nextcloud-mail and snappymail:
" IMAP-Server is not reachable"
we used configuration like mrmarkuz since december 2024 no problem…
What have they changed ? Which screw we have to spin ?

  • Sogo is full OK = our sheet ancor … after update no problem
  • only snappy-mail and nextcloud-mail not able to connect to IMAP server

21.03,2025 solution
found the reason by myself - there was no DNS record to the mailserver.
Now we created a new record in dnsmasq - now nextcloud mail and snappymail find the IMAP server…
But why it was OK without this record in the last months ?

It is interesting that I have landed on this thread with the exact same problem listed by Tony on Feb 11. I am using nextcloud 1.5. Followed all the steps listed here — to no avail.

It has stopped me from trying to use nextcloud.

AFAIK Nextcloud can send notifications via Mail app as documented in Email notifications — NS8 documentation. See Use Mail app instance option.

Feel free to open a new Support topic to get help.

1 Like

Thanks for the reply, but I believe that I have not explained myself clearly. It is not email notifications that I am having issue with, it is setting my personal email within the nextcloud mail app. I have installed Mail, Webtop PLUS Webmail on the same node and they all work fine. I just installed nextcloud in order to test SMS Relentless amongst other apps. I added the Mail app to nextcloud and inserted all of my personal settings to see my email. Regardless of FQDN, wg0 ip and the loopback ip - in all cases I receive “IMAP server is not reachable”.

I have followed all the steps listed above

BTW - I did receive a standard email notification from nextcloud about “Activity on Nextcloud” - “An administrator added you to group”

I retested it on a VM and I needed to allow local access to remote servers in Nextcloud to make it work.

runagent -m nextcloud1 occ config:system:set --value true allow_local_remote_servers

Did you also try the NethServer node IP after executing the mentioned occ command?

Already did the “runagent” command and listed the occ settings to make sure. Am trying the Netserver node IP now.

[root@mail2 ~]# runagent -m nextcloud2 
runagent: [INFO] starting bash -l
runagent: [INFO] working directory: /home/nextcloud2/.config/state
[nextcloud2@mail2 state]$ ping mail2.dmginc.com
PING mail2.dmginc.com (127.0.1.1) 56(84) bytes of data.
64 bytes from mail2.dmginc.com (127.0.1.1): icmp_seq=1 ttl=64 time=0.032 ms
64 bytes from mail2.dmginc.com (127.0.1.1): icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from mail2.dmginc.com (127.0.1.1): icmp_seq=3 ttl=64 time=0.080 ms
64 bytes from mail2.dmginc.com (127.0.1.1): icmp_seq=4 ttl=64 time=0.044 ms
^C
--- mail2.dmginc.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3077ms
rtt min/avg/max/mdev = 0.030/0.046/0.080/0.020 ms

Security needs to be set to “none” for both IMAP and SMTP, see Mail app in Nextcloud not working with NS8 mail server - #5 by mrmarkuz

Bingo! I thought that I tried that already. I guess that I hadn’t. Thanks so much Markus. It’s working. Now on to the rest of my testing

1 Like