Mail sender name with "/" produces log errors.
Steps to reproduce
- Receive an email with sender in the format "Name (Dept/Group) [email protected]"
- Open nextcloud server log
- Entry
"Symfony\Component\Routing\Exception\InvalidParameterException"exists
Expected behavior
Mail from sender with this format can be received without errors.
Actual behavior
I see a lot of log entries in the following format:
[no app in context] Fehler: Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "guestName" for route "core.GuestAvatar.getAvatar" must match "[^/]++" ("Name (Dept/Group)" given) to generate a corresponding URL. at <<closure>>
0. /var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php line 160
Symfony\Component\Routing\Generator\UrlGenerator->doGenerate()
1. /var/www/nextcloud/lib/private/Route/Router.php line 372
Symfony\Component\Routing\Generator\UrlGenerator->generate()
2. /var/www/nextcloud/lib/private/Route/CachingRouter.php line 65
OC\Route\Router->generate()
3. /var/www/nextcloud/lib/private/URLGenerator.php line 103
OC\Route\CachingRouter->generate()
5. /var/www/nextcloud/apps/mail/lib/Dashboard/MailWidget.php line 167
OC\URLGenerator->linkToRoute()
6. <<closure>>
OCA\Mail\Dashboard\MailWidget->OCA\Mail\Dashboard\{closure}("*** sensitive parameters replaced ***")
7. /var/www/nextcloud/apps/mail/lib/Dashboard/MailWidget.php line 152
array_map()
8. /var/www/nextcloud/apps/mail/lib/Dashboard/MailWidgetV2.php line 43
OCA\Mail\Dashboard\MailWidget->getItems()
9. /var/www/nextcloud/apps/dashboard/lib/Controller/DashboardApiController.php line 134
OCA\Mail\Dashboard\MailWidgetV2->getItemsV2()
10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
OCA\Dashboard\Controller\DashboardApiController->getWidgetItemsV2()
11. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
OC\AppFramework\Http\Dispatcher->executeController()
12. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
OC\AppFramework\Http\Dispatcher->dispatch()
13. /var/www/nextcloud/lib/private/Route/Router.php line 315
OC\AppFramework\App::main()
14. /var/www/nextcloud/ocs/v1.php line 65
OC\Route\Router->match()
15. /var/www/nextcloud/ocs/v2.php line 23
require_once("/var/www/nextcloud/ocs/v1.php")
GET /nextcloud/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=mail-unread
from X.X.X.X by XXX at 2023-12-14T15:23:03+00:00
Mail app version
3.5.0
Mailserver or service
imap on debian
Operating system
Raspbian bullseye 64bit (Linux 6.1.21-v8+ aarch64)
PHP engine version
PHP 8.1
Web server
Nginx
Database
MariaDB
Additional info
No response
I'm experiencing the same log errors. I hope this issue gets some needed attention.
Having same issue - thia one has been markewd as duplicate? - So can you provide the duplicate's reference, please?
It's sufficient to π the original report if you're affected. Use the Subscribe button on the right to get updates. The previous comment and yours only duplicate what has already been reported. Thanks.
Which versions of Nextcloud do you all run?
Which versions of Nextcloud do you all run?
for me itβs 28.0.1 on Nextcloud AIO
27.1.5 on Raspberry Pi
One way to avoid this error is to replace or remove /s from sender labels at https://github.com/nextcloud/mail/blob/027b63127ef6b45e5f724fa3993a478a38a6ee4a/lib/Dashboard/MailWidget.php#L160-L169.
maybe also related to https://github.com/nextcloud/contacts/issues/3479
possible fix: https://github.com/nextcloud/server/pull/42860
Sounds similar but it's not. The issue here is "/", there it's the empty string.
You have to make sure to remove slashes from the parameter because symphony does not allow slashes in path parameters by default. Encoding (%2F) does not work as this breaks Apache. Best solution: Where possible sanitize the parameters to replace slash with space.