Can't setup general email configuration

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 9 (30.0.5)
  • Operating system and version (e.g., Ubuntu 24.04):
    • AlmaLinux release 9.5
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.62
  • PHP version (e.g, 8.3):
    • PHP 8.3.14
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • after pressing "send Email"
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • in LXC container on Proxmox
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Setting up Basic settings on GUI:
send mode: SMTP
Encryption: None/STARTTLS
From address nc @ domain
Server address: 192.168.130.192 : 25
No Authentication required

Steps to replicate it (hint: details matter!):

filling out the settings above, press “Send email” Error:
A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)

Log entries

Nextcloud

nothing logged

Configuration

Nextcloud

"system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.130.*",
            "nc.xxxx.xx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/192.168.130.183\/",
        "dbtype": "mysql",
        "version": "30.0.5.1",
        "installed": true,
        "maintenance": false,
        "maintenance_window_start": 1,
        "theme": "",
        "loglevel": 0,
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "default_phone_region": "DE",
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "trashbin_retention_obligation": "auto",
        "updater.release.channel": "stable",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpsecure": "",
        "mail_smtptimeout": 30,
        "mail_smtpdebug": true
    }

Tips for increasing the likelihood of a response

The target SMTP server has logged:

Feb  7 07:43:41 farm12 postfix/smtpd[94063]: Anonymous TLS connection established from unknown[192.168.130.183]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature ECDSA (P-256) server-digest SHA256
Feb  7 07:43:41 farm12 postfix/smtpd[94063]: lost connection after STARTTLS from unknown[192.168.130.183]
Feb  7 07:43:41 farm12 postfix/smtpd[94063]: disconnect from unknown[192.168.130.183] ehlo=1 starttls=1 commands=2

the used SMTP server accepts all kind of connections without auth or encryption from the nextcloud instance.

hey @digidax welcome back

please mention type of mail server and location, possibly different networks (DMZ) then allow self signed and do not verify peer and peer_name.

add this to config.php and see if that works:

  ),
  'mail_smtpstreamoptions' => 
  array (
    'ssl' => 
    array (
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
    ),

Use the troubleshooting steps described in the manual to get details about email problems: