Skip to content

[Bug]: Calendar invite email rejected by SMTP server due to FROM header format #57856

@clementduport

Description

@clementduport

⚠️ This issue respects the following points: ⚠️

Bug description

Hello,
I've searched for days and could not find any report of the same issue, sorry if I missed something.

I'm using a Nextcloud AIO instance (up-to-date) configured to send e-mails through Protonmail's SMTP servers, using a domain I own.

Notification e-mails from the nextcloud server (files changes, notifications etc) are sent fine, as well as the TEST e-mail from the SMTP settings panel.
However, when sending calendar invites, Protonmail's SMTP server rejects the e-mail, and the following message appears in nextcloud server log :
From core :

UnexpectedResponseException
Expected response code "250" but got code "550", with message "550 5.7.26 Submission not allowed for messages in which MAIL FROM <administrateur@my.domain> does not match header From <Clement via".

From dav :
Unable to deliver message to navetatd@gmail.com

Protonmail support says that the FROM header should match the FROM address, but the FROM header generated by Nextcloud is misshaped, with "Clement via" between <> which should not be the case.

Is there really an issue with FROM header formatting ? Can I solve it through Nextcloud server configuration ?
...Am I really the first person encountering this, or did I miss something ?

My invitees are not getting any invite e-mail from the calendar for now.

I hope that bug report will help ; have a nice day

Steps to reproduce

1.Setup Protonmail to use my custom domain
2.Setup Protonmail SMTP server and credentials from Nextcloud admin panel
3.Create an event in Nextcloud's calendar, including attendees

Expected behavior

Attendees should get an invite by e-mail... yet the e-mails are not sent and an error is reported in Nextcloud log.

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

PostgreSQL

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

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

Configuration report

{
    "system": {
        "default_language": "fr",
        "default_locale": "fr_FR",
        "default_phone_region": "FR",
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "interne.vous-ecouter-pour-lavenir.fr",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "interne.vous-ecouter-pour-lavenir.fr"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "32.0.4.1",
        "overwrite.cli.url": "https:\/\/interne.vous-ecouter-pour-lavenir.fr\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatechecker": false,
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "mail_smtpdebug": true,
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "config_preset": 3,
        "app_install_overwrite": [
            "ransomware_protection"
        ],
        "mail_smtpauth": true,
        "mail_sendmailmode": "smtp",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587"
    }
}

List of activated Apps

Enabled:
  - activity: 5.0.0-dev.0
  - admin_audit: 1.22.0
  - bruteforcesettings: 5.0.0-dev.0
  - calendar: 6.1.5
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contactsinteraction: 1.13.1
  - dashboard: 7.12.0
  - dav: 1.34.2
  - dav_push: 1.0.0
  - deck: 1.16.3
  - encryption: 2.20.0
  - event_update_notification: 2.8.0
  - external: 7.0.0
  - federatedfilesharing: 1.22.0
  - files: 2.4.0
  - files_antivirus: 6.1.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_fulltextsearch: 32.0.2
  - files_pdfviewer: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - firstrunwizard: 5.0.0-dev.0
  - forms: 5.2.4
  - fulltextsearch: 32.0.0
  - fulltextsearch_elasticsearch: 32.0.2
  - groupfolders: 20.1.9
  - guests: 4.6.0
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - nextcloud-aio: 0.8.0
  - nextcloud_announcements: 4.0.0-dev.0
  - notes: 4.12.4
  - notifications: 5.0.0-dev.0
  - notify_push: 1.3.0
  - oauth2: 1.20.0
  - ownershiptransfer: 1.3.0
  - password_policy: 4.0.0-dev.0
  - polls: 8.6.3
  - privacy: 4.0.0-dev.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - quota_warning: 1.23.0
  - recommendations: 5.0.0-dev.0
  - registration: 2.8.0
  - related_resources: 3.0.0-dev.0
  - richdocuments: 9.0.2
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.1
  - spreed: 22.0.8
  - support: 4.0.0-dev.0
  - systemtags: 1.22.0
  - tables: 1.0.3
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_admin: 4.9.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - twofactor_totp: 14.0.0
  - updatenotification: 1.22.0
  - uppush: 2.3.1
  - user_status: 1.12.0
  - viewer: 5.0.0-dev.0
  - webhook_listeners: 1.3.0
  - whiteboard: 1.5.3
  - workflowengine: 2.14.0
Disabled:
  - announcementcenter: 7.3.0 (installed 7.3.0)
  - app_api: 32.0.0 (installed 32.0.0)
  - contacts: 8.3.0 (installed 8.3.0)
  - federation: 1.22.0 (installed 1.22.0)
  - files_external: 1.24.0
  - maps: 1.6.0 (installed 1.6.0)
  - photos: 5.0.0-dev.1 (installed 5.0.0-dev.1)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - sharebymail: 1.22.0 (installed 1.22.0)
  - survey_client: 4.0.0-dev.0 (installed 4.0.0-dev.0)
  - suspicious_login: 10.0.0-dev.0
  - user_ldap: 1.23.0
  - weather_status: 1.12.0 (installed 1.12.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"9Db451D8jQ88s5BsbC20","level":3,"time":"2026-01-27T15:53:32+00:00","remoteAddr":"82.126.8.217","user":"username","app":"core","method":"PUT","url":"/remote.php/dav/calendars/username/personal/06E41279-1CD7-4697-868D-54B83D6586F2.ics","scriptName":"/remote.php","message":"Sending mail to \"Array\n(\n    [recipient@gmail.com] => Recipient Name\n)\n\" with subject \"Invitation mise \u00e0 jour : R\u00e9union comit\u00e9 de Reunion\" failed","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0","version":"32.0.4.1","exception":{"Exception":"Symfony\\Component\\Mailer\\Exception\\UnexpectedResponseException","Message":"Expected response code \"250\" but got code \"550\", with message \"550 5.7.26 Submission not allowed for messages in which MAIL FROM <administrateur@mydomain.fr> does not match header From <Franck Peyronnet via\".","Code":550,"Trace":[{"file":"/var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":186,"function":"assertResponseCode","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->","args":["550 5.7.26 Submission not allowed for messages in which MAIL FROM <administrateur@mydomain.fr> does not match header From <Franck Peyronnet via\n",[250]]},{"file":"/var/www/html/3rdparty/symfony/mailer/Transport/Smtp/EsmtpTransport.php","line":118,"function":"executeCommand","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->","args":["\r\n.\r\n",[250]]},{"file":"/var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":222,"function":"executeCommand","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\EsmtpTransport","type":"->","args":["\r\n.\r\n",[250]]},{"file":"/var/www/html/3rdparty/symfony/mailer/Transport/AbstractTransport.php","line":69,"function":"doSend","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->","args":[{"__class__":"Symfony\\Component\\Mailer\\SentMessage"}]},{"file":"/var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":137,"function":"send","class":"Symfony\\Component\\Mailer\\Transport\\AbstractTransport","type":"->","args":[{"__class__":"Symfony\\Component\\Mime\\Email"},{"__class__":"Symfony\\Component\\Mailer\\DelayedEnvelope"}]},{"file":"/var/www/html/3rdparty/symfony/mailer/Mailer.php","line":42,"function":"send","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->","args":[{"__class__":"Symfony\\Component\\Mime\\Email"},"*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Mail/Mailer.php","line":205,"function":"send","class":"Symfony\\Component\\Mailer\\Mailer","type":"->","args":[{"__class__":"Symfony\\Component\\Mime\\Email"}]},{"file":"/var/www/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php","line":310,"function":"send","class":"OC\\Mail\\Mailer","type":"->","args":[{"__class__":"OC\\Mail\\Message"}]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"schedule","class":"OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin","type":"->","args":[{"__class__":"Sabre\\VObject\\ITip\\Message","uid":"b4a462f4-fe21-4cac-9193-7d02fa0ab536","component":"VEVENT","method":"REQUEST","sequence":3,"sender":"mailto:usermail@msn.com","senderName":{"__class__":"Sabre\\VObject\\Parameter","parent":"*** sensitive parameters replaced ***","name":"CN","noName":false},"recipient":"mailto:recipient@gmail.com","recipientName":"Recipient Name","scheduleStatus":"1.2;Message delivered locally","message":{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},"significantChange":true}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":351,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["schedule",[{"__class__":"Sabre\\VObject\\ITip\\Message","uid":"b4a462f4-fe21-4cac-9193-7d02fa0ab536","component":"VEVENT","method":"REQUEST","sequence":3,"sender":"mailto:usermail@msn.com","senderName":{"__class__":"Sabre\\VObject\\Parameter","parent":"*** sensitive parameters replaced ***","name":"CN","noName":false},"recipient":"mailto:recipient@gmail.com","recipientName":"Recipient Name","scheduleStatus":"1.2;Message delivered locally","message":{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},"significantChange":true}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":627,"function":"deliver","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->","args":[{"__class__":"Sabre\\VObject\\ITip\\Message","uid":"b4a462f4-fe21-4cac-9193-7d02fa0ab536","component":"VEVENT","method":"REQUEST","sequence":3,"sender":"mailto:usermail@msn.com","senderName":{"__class__":"Sabre\\VObject\\Parameter","parent":"*** sensitive parameters replaced ***","name":"CN","noName":false},"recipient":"mailto:recipient@gmail.com","recipientName":"Recipient Name","scheduleStatus":"1.2;Message delivered locally","message":{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},"significantChange":true}]},{"file":"/var/www/html/apps/dav/lib/CalDAV/Schedule/Plugin.php","line":199,"function":"processICalendarChange","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->","args":[{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},["mailto:usermail@msn.com","/remote.php/dav/principals/users/username/"],[],true]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"calendarObjectChange","class":"OCA\\DAV\\CalDAV\\Schedule\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"},{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},"calendars/username/personal",true,false]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/CalDAV/Plugin.php","line":889,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["calendarObjectChange",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"},{"__class__":"Sabre\\VObject\\Component\\VCalendar","parent":"*** sensitive parameters replaced ***","name":"VCALENDAR"},"calendars/username/personal",true,"And 1 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/CalDAV/Plugin.php","line":733,"function":"validateICalendar","class":"Sabre\\CalDAV\\Plugin","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",false,{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"},false]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeWriteContent","class":"Sabre\\CalDAV\\Plugin","type":"->","args":["*** sensitive parameters replaced ***",{"__class__":"OCA\\DAV\\CalDAV\\CalendarObject"},"*** sensitive parameters replaced ***",false]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1133,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeWriteContent",["*** sensitive parameters replaced ***",{"__class__":"OCA\\DAV\\CalDAV\\CalendarObject"},"*** sensitive parameters replaced ***",false]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":211,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":424,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":22,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":151,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","Line":327,"message":"Sending mail to \"Array\n(\n    [recipient@gmail.com] => Recipient Name\n)\n\" with subject \"Invitation mise \u00e0 jour : R\u00e9union comit\u00e9 de Reunion\" failed","exception":{},"CustomMessage":"Sending mail to \"Array\n(\n    [recipient@gmail.com] => Recipient Name\n)\n\" with subject \"Invitation mise \u00e0 jour : R\u00e9union comit\u00e9 de Reunion\" failed"}}
{"reqId":"9Db451D8jQ88s5BsbC20","level":3,"time":"2026-01-27T15:53:32+00:00","remoteAddr":"82.126.8.217","user":"username","app":"dav","method":"PUT","url":"/remote.php/dav/calendars/username/personal/06E41279-1CD7-4697-868D-54B83D6586F2.ics","scriptName":"/remote.php","message":"Unable to deliver message to recipient@gmail.com","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0","version":"32.0.4.1","data":{"app":"dav"}}

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap32-feedbackbug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions