mail icon indicating copy to clipboard operation
mail copied to clipboard

Mail sender name with "/" produces log errors.

Open BMerz opened this issue 2 years ago β€’ 11 comments

Steps to reproduce

  1. Receive an email with sender in the format "Name (Dept/Group) [email protected]"
  2. Open nextcloud server log
  3. 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

BMerz avatar Dec 14 '23 15:12 BMerz

I'm experiencing the same log errors. I hope this issue gets some needed attention.

whisperdancer avatar Dec 25 '23 18:12 whisperdancer

Having same issue - thia one has been markewd as duplicate? - So can you provide the duplicate's reference, please?

frake65 avatar Dec 27 '23 19:12 frake65

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.

ChristophWurst avatar Dec 27 '23 19:12 ChristophWurst

Which versions of Nextcloud do you all run?

ChristophWurst avatar Dec 28 '23 11:12 ChristophWurst

Which versions of Nextcloud do you all run?

for me itβ€˜s 28.0.1 on Nextcloud AIO

frake65 avatar Dec 28 '23 12:12 frake65

27.1.5 on Raspberry Pi

BMerz avatar Dec 28 '23 13:12 BMerz

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.

ChristophWurst avatar Dec 28 '23 13:12 ChristophWurst

maybe also related to https://github.com/nextcloud/contacts/issues/3479

ximex avatar Jan 17 '24 20:01 ximex

possible fix: https://github.com/nextcloud/server/pull/42860

ximex avatar Jan 17 '24 21:01 ximex

Sounds similar but it's not. The issue here is "/", there it's the empty string.

ChristophWurst avatar Jan 18 '24 07:01 ChristophWurst

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.

susnux avatar Feb 03 '24 10:02 susnux