the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
1.01k stars 121 forks source link

Avatars plugin: Call to undefined function mime_content_type() #1392

Closed yasuhirokimura closed 9 months ago

yasuhirokimura commented 9 months ago

After updating Avaters plugin to 1.12, 'Unknown error' is diplayed as following when listing messages in folder.

SnappyMail UnknowError AvatarsPlugin

And follwing messages are written to log file.

[2024-01-16 18:42:52.071][d5abac14] SERVICE[WARNING]: Call to undefined function mime_content_type()
#0 /net/data/snappymail/_data_/_default_/plugins/avatars/index.php(185): AvatarsPlugin::getCachedImage('no-reply@examp....')
#1 /net/data/snappymail/_data_/_default_/plugins/avatars/index.php(64): AvatarsPlugin::getServiceIcon('no-reply@examp....')
#2 /net/data/snappymail/_data_/_default_/plugins/avatars/index.php(48): AvatarsPlugin->JsonAvatar(Array)
#3 /usr/local/www/snappymail/snappymail/v/2.32.0/app/libraries/RainLoop/Plugins/Manager.php(314): AvatarsPlugin->JsonMessageList(Array)
#4 /usr/local/www/snappymail/snappymail/v/2.32.0/app/libraries/RainLoop/ServiceActions.php(151): RainLoop\Plugins\Manager->RunHook('json.after-mess...', Array)
#5 /usr/local/www/snappymail/snappymail/v/2.32.0/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#6 /usr/local/www/snappymail/snappymail/v/2.32.0/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#7 /usr/local/www/snappymail/snappymail/v/2.32.0/include.php(127): RainLoop\Service::Handle()
#8 /usr/local/www/snappymail/index.php(11): include('/usr/local/www/...')
#9 {main}

The problem disappears by disabling Avaters plugin.

I have following 2 instances of SnappyMail.

Instance 1

Instance 2

And the problem only happens with the former.

the-djmaze commented 9 months ago

Fileinfo is enabled by default. Somehow it is disabled in your PHP instance. https://www.php.net/manual/en/fileinfo.installation.php

Can you check that?

yasuhirokimura commented 9 months ago

@the-djmaze In FreeBSD Ports Collection fileinfo is provided as separate port. I installed it and now the problem is fixed. Thanks!