Isuue with Email

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 27.1.5
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.6 LTS
Apache or nginx version (eg, Apache 2.4.25): apache2
PHP version (eg, 7.4): 8.1

The issue you are facing:

Nextcloud version: 27.1.5
I have 2 nextcloud server with the same version: one prod and on test.
the issue is that the email server configuration is not working with my local smtp server for the prod server but it is working for the test nextcloud server.

Configuration For Test Server:
‘mail_from_address’ => ‘MyEmailAddress’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_domain’ => ‘Mudomain’,
‘mail_smtphost’ => ‘IPhost’,
‘mail_smtpport’ => ‘25’,
0 => ‘opcache.save_comments = 1’,
1 => ‘opcache.revalidate_freq = 60’,
“mail_smtpstreamoptions” => array(
‘ssl’ => array(
‘allow_self_signed’ => true,
‘verify_peer’ => false,
‘verify_peer_name’ => false
)
),

===> it is working for the test server fine but not for the prod server.

The issue is I need to use our official email address to send email to customers, it is a workaround but I need to fix it.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

1.use local email address
2. use the port 25
3. disable the Authentification

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "NXTC01.domain.local",
            "share.domain.de",
            "72.33.200.220"
        ],
        "overwrite.cli.url": "https:\/\/share.mydomail.de",
        "htaccess.RewriteBase": "\/",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "\/var\/www\/nextcloud-daten\/eigenes-skeleton\/",
        "dbtype": "mysql",
        "version": "27.1.5.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "trashbin_retention_obligation": "auto",
        "check_for_working_htaccess": true,
        "default_phone_region": "DE",
        "updater.release.channel": "stable",
        "0": "opcache.save_comments = 1",
        "1": "opcache.revalidate_freq = 60",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

The output of your Apache/nginx/system log in /var/log/____:

[Wed Jan 03 08:19:23.862987 2024] [mpm_prefork:notice] [pid 258402] AH00169: caught SIGTERM, shutting down
[Wed Jan 03 08:19:23.942340 2024] [ssl:warn] [pid 284061] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 03 08:19:24.006532 2024] [ssl:warn] [pid 284072] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 03 08:19:24.012346 2024] [mpm_prefork:notice] [pid 284072] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Wed Jan 03 08:19:24.012389 2024] [core:notice] [pid 284072] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jan 03 08:26:50.355351 2024] [proxy_fcgi:error] [pid 284138] (70008)Partial results are valid but processing is incomplete: [client 10.0.7.196:61373] AH01075: Error dispatching request to : (reading input brigade)
[Wed Jan 03 08:41:24.610344 2024] [proxy_fcgi:error] [pid 284804] (70008)Partial results are valid but processing is incomplete: [client 10.0.7.196:62846] AH01075: Error dispatching request to : (reading input brigade)

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Hello @hamzaouic,

How did these entries get into your config.php?

All values to opcache directives belong into php.ini (in your case: /etc/php/8.1/apache2/php.ini) and not in config/config.php, where they are ineffective.

Much luck,
ernolf

Hi! For email issues, non-enterprise users can find help at help.nextcloud.com. Business users can access paid support via portal.nextcloud.com for dedicated assistance. Before creating a topic, provide relevant details for a quicker resolution, using a pastebin service for logs or indenting short log examples with four spaces.

Thank you for your fast replay.
I did your request configuration but I still have the same issue:
“A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)”
The weird thing is my the same configuration worked for my test server.

But as far a s I understand your first post, your test server has these mail setting:

  'mail_from_address' => 'MyEmailAddress',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'Mudomain',
  'mail_smtphost' => 'IPhost',
  'mail_smtpport' => '25',
  'mail_smtpstreamoptions' => array(
  'ssl' => array(
    'allow_self_signed' => true,
    'verify_peer' => false,
    'verify_peer_name' => false
  )

while your productive server has these:

  'mail_smtpmode': 'smtp',
  'mail_sendmailmode': 'smtp',
  'mail_domain': '***REMOVED SENSITIVE VALUE***',
  'mail_from_address': '***REMOVED SENSITIVE VALUE***',
  'mail_smtphost': '***REMOVED SENSITIVE VALUE***',
  'mail_smtpport': '587',
  'mail_smtpauth': 1,
  'mail_smtpname': '***REMOVED SENSITIVE VALUE***',
  'mail_smtppassword': '***REMOVED SENSITIVE VALUE***'

From my pov these settings look different! :thinking:


ernolf

Exactly. This configuration:

‘mail_from_address’ => ‘MyEmailAddress’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_domain’ => ‘Mudomain’,
‘mail_smtphost’ => ‘IPhost’,
‘mail_smtpport’ => ‘25’,
0 => ‘opcache.save_comments = 1’,
1 => ‘opcache.revalidate_freq = 60’,
“mail_smtpstreamoptions” => array(
‘ssl’ => array(
‘allow_self_signed’ => true,
‘verify_peer’ => false,
‘verify_peer_name’ => false
)
),

worked for the test server but not for the prod.

As workaround I Re-configured the prod server with my private email on hotmail (smtp.office365.com:587)
Now it is working with this configuration (hotmail) but I still need to make it works with our smtp server.