YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.72k stars 742 forks source link

[bug] Mail Scanner fails with error on invalid MailId #12290

Closed diderich closed 4 years ago

diderich commented 4 years ago

🐞 bug report

⁉️ Describe the bug

Mail scanner fails with error about

The mail scanner fails when reading mail with error message:

2019-12-21 11:22:11.669 [error][IllegalValue] - purifyByType: <!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=>
2019-12-21 11:22:11.6692 [error] - ERR_NOT_ALLOWED_VALUE||<!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=>
App\Exceptions\IllegalValue: ERR_NOT_ALLOWED_VALUE||<!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=> in /opt/crm/app/Purifier.php:452
Stack trace:
#0 /opt/crm/modules/OSSMail/models/Record.php(241): App\Purifier::purifyByType()
#1 /opt/crm/modules/OSSMailView/models/Record.php(309): OSSMail_Record_Model::getMail()
#2 /opt/crm/modules/OSSMail/views/MailActionBar.php(35): OSSMailView_Record_Model->checkMailExist()
#3 /opt/crm/include/main/WebUI.php(191): OSSMail_MailActionBar_View->process()
#4 /opt/crm/index.php(28): Vtiger_WebUI->process()
#5 /opt/crm/public_html/index.php(11): require('/opt/crm/index....')
#6 {main}

The internet header of the mail scanned is as follows:

From: "Claude Diderich" <claude.diderich@XXXX.com>
To: <claude.diderich@YYYY.com>
References: <1922119698.1391226.1576921437434.ref@mail.YYYY.com> <1922119698.1391226.1576921437434@mail.YYYY.com>
In-Reply-To: <1922119698.1391226.1576921437434@mail.YYYY.com>
Subject: RE: This is a test message from yahoo to innovate-d.com
Date: Sat, 21 Dec 2019 11:12:13 +0100
Message-ID: <!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=>
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_0015_01D5B7EF.E2E19900"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQJgcIadeXpGXW2CoiX8H8NdwrIN5wGDjykJAgEg4q0=
Content-Language: en-us
Disposition-Notification-To: "Claude Diderich" <claude.diderich@XXXX.com>

πŸ”₯ How to trigger the error

Steps to reproduce the behavior:

  1. Save e-mail with header in imap folder
  2. Execute cron job
  3. See error

πŸ‘Ž Actual Behavior

Mail is not imported

πŸ‘ Expected Behavior

Mail is imported

πŸ‘· Testing

πŸ“· Screenshot of configuration

πŸ“ PHP/Apache/Nginx/Browser/CRM Logs

==================================================================================================================================== 2019-12-21 11:22:11.669 [error][IllegalValue] - purifyByType: <!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=> 2019-12-21 11:22:11.6692 [error] - ERR_NOT_ALLOWED_VALUE||<!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=> App\Exceptions\IllegalValue: ERR_NOT_ALLOWED_VALUE||<!&!AAAAAAAAAAAuAAAAAAAAAI2EY7b/pIVCuSQQAo+CBF4BADStdhh1kZdNv2xPdpUchzoBAAIAAAAAABAAAAC5hIHpd6CwSIORsysc39GxAQAAAAA=> in /opt/crm/app/Purifier.php:452 Stack trace:

0 /opt/crm/modules/OSSMail/models/Record.php(241): App\Purifier::purifyByType()

1 /opt/crm/modules/OSSMailView/models/Record.php(309): OSSMail_Record_Model::getMail()

2 /opt/crm/modules/OSSMail/views/MailActionBar.php(35): OSSMailView_Record_Model->checkMailExist()

3 /opt/crm/include/main/WebUI.php(191): OSSMail_MailActionBar_View->process()

4 /opt/crm/index.php(28): Vtiger_WebUI->process()

5 /opt/crm/public_html/index.php(11): require('/opt/crm/index....')

6 {main}

2019-12-21 11:22:11.5107 [info][application] - $_GET = [] $_POST = [ '_csrf' => 'sid:da8b55aec114ce223da4e208c0b331f70ceb64ca,1576923708' 'module' => 'OSSMail' 'view' => 'MailActionBar' 'uid' => '8' 'folder' => 'INBOX/crm' 'rcId' => 'MvmxXc9KUcfqQ0bE' ] $_FILES = [] $_COOKIE = [ 'language' => 'en_US' 'YTSID' => 'i3327vr61hrt2mhvtaesg4p4m9' 'roundcube_sessid' => '8dlgvni82g3je5o6khl43t2q8q' 'roundcube_sessauth' => '7FY4o6lY2i29LWPvfPbb7o4UDD-1576923300' ] $_SESSION = [ 'CSP_TOKEN' => '4403c1f79b36c1a2e3667867277a12f01c71a42002a239e520e79850af087305' 'last_activity' => 1576923731.5119 'UserAuthMethod' => 'PASSWORD' 'authenticated_user_id' => 1 'app_unique_key' => '5da0e8994d70e46c580657ff6df6dd7e9fbcd5f0' 'user_name' => 'root2020' 'full_user_name' => 'Administrator System' 'fingerprint' => 'd520c7a8-421b-4563-b955-f5abc56b97ec' 'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0' 'DashBoard' => [ 'Home' => [ 'LastDashBoardId' => 1 ] ] ] $stability = [ 'phpVersion' => '7.4.1' 'error_reporting' => 'E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE (22527)' 'output_buffering' => '4096' 'default_socket_timeout' => '600' 'memory_limit' => '512 MB' 'short_open_tag' => 'Off' 'post_max_size' => '50 MB' 'upload_max_filesize' => '100 MB' 'max_input_vars' => '10000' 'auto_detect_line_endings' => 'On' ] $security = [ 'HTTPS' => 'Off' 'session.use_strict_mode' => 'On' 'expose_php' => 'Off' ] $headers = [ 'Header: server' => 'Apache' 'Header: access-control-allow-origin' => '*' 'Header: referrer-policy' => 'no-referrer' 'Header: expect-ct' => 'enforce; max-age=3600' 'Header: x-frame-options' => 'sameorigin' 'Header: x-xss-protection' => '1; mode=block' 'Header: x-content-type-options' => 'nosniff' 'Header: x-robots-tag' => 'none' 'Header: x-permitted-cross-domain-policies' => 'none' ] $libraries = [ 'ldap' => 'LBL_NO' 'apcu' => 'LBL_NO' 'imagick' => 'LBL_NO' ] $performance = [ 'opcache.enable_cli' => 'On' 'opcache.max_accelerated_files' => '40000' 'opcache.interned_strings_buffer' => '100' 'opcache.revalidate_freq' => '0' 'opcache.save_comments' => '0' 'opcache.file_update_protection' => '0' 'realpath_cache_ttl' => '600' 'mysqlnd.collect_statistics' => 'Off' ] $environment = [ 'error_log' => false ]

🌍 Your Environment

Environment Version / Name
YetiForce 5.2.94
Web server (name and version) spache2
PHP 7.4.1
Browser (name and version)
Operating System (name and version)
Database (name and version)
Service Pack version 2019.12.18

❓ Additional context

Add any other context about the problem here.

❗️ Inform the community if you solve the problem

z0lo13 commented 4 years ago

@mariuszkrzaczkowski please add [ and ] as well it throws an error on mine

our MailId are in folowing format <31238641246123694124[sssq@192.168.2.1].