Skip to content

[Bug]: Support PHP8.1 with swiftmailer #35055

@creopard

Description

@creopard

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

This is a remainder for the open issue with the PHP 8.1 compatibility and the 3rd party addon "swiftmailer" found by @VVD and requested by @ChristophWurst

The issue is described here:
#29287 (comment)

The solution is already available, but not yet implemented (as with NC 25.0.1):
The existing commit swiftmailer/swiftmailer@ee8a1d9 is not yet integrated into https://github.com/nextcloud/3rdparty/tree/master/swiftmailer/swiftmailer

Steps to reproduce

  1. Use PHP 8.1
  2. Send a test email from the settings/admin
  3. The email will be sent successfully. However, you'll find the following error message in the Nextcloud log:
    Error: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at /home/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#144

Expected behavior

No deprecated error message should be thrown.

Installation method

Community Web installer on a VPS or web space

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.1.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "default_phone_region": "DE",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "trashbin_retention_obligation": "10,30",
        "versions_retention_obligation": "10,30",
        "loglevel": 0,
        "cron_log": true,
        "log_rotate_size": 5242880,
        "dbdriveroptions": {
            "1002": "SET wait_timeout = 28800"
        },
        "maintenance": false,
        "theme": "",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "allowNightlyUpdates": [],
        "mail_sendmailmode": "smtp",
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "bruteforcesettings"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - bruteforcesettings: 2.5.0
  - calendar: 4.1.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.0.1
  - dashboard: 7.5.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_downloadactivity: 1.15.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - passwords: 2022.11.20
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - circles: 23.0.0
  - contactsinteraction: 1.5.0
  - encryption
  - federation: 1.13.0
  - files_external
  - files_pdfviewer: 2.4.0
  - photos: 1.6.0
  - support: 1.0.0
  - survey_client: 1.2.0
  - suspicious_login
  - twofactor_totp
  - user_ldap
  - user_status: 1.3.1
  - weather_status: 1.0.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"Fmga0R2gFKqyeS9y47ov","level":3,"time":"2022-11-09T13:37:30+00:00","remoteAddr":"IPADDRESS_REMOVED","user":"USERID-REMOVED","app":"PHP","method":"POST","url":"/index.php/settings/admin/mailtest","message":"strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at /home/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#144","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"25.0.1.1","exception":{"Exception":"Error","Message":"strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at /home/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#144","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/home/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php","line":144,"function":"strtolower"},{"file":"/home/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php","line":43,"function":"setEncryption","class":"Swift_Transport_EsmtpTransport","type":"->"},{"file":"/home/lib/private/Mail/Mailer.php","line":267,"function":"__construct","class":"Swift_SmtpTransport","type":"->"},{"file":"/home/lib/private/Mail/Mailer.php","line":254,"function":"getSmtpInstance","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/home/lib/private/Mail/Mailer.php","line":180,"function":"getInstance","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/home/apps/settings/lib/Controller/MailSettingsController.php","line":170,"function":"send","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/home/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"sendTestMail","class":"OCA\\Settings\\Controller\\MailSettingsController","type":"->"},{"file":"/home/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions