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.68k stars 727 forks source link

[bug] [question] PDF Too big to be downloaded by mailscanner. #11241

Closed z0lo13 closed 4 years ago

z0lo13 commented 4 years ago

🐞 bug report

⁉️ Describe the bug

In Mailscanner. Is there a limit to download an attachment with a mailscanner cron? I found out that all attachements in /storage/Documents/ do not exceed 4 megabytes in size.

Can I increase the size of Attachement downloaded through mailscanner? as all generated PDF files are larger than 9 MB they simply dont import.

πŸ”₯ How to trigger the error

Steps to reproduce the behavior:

  1. Go to Mail
  2. Click on Attach a file 3.Attach PDF file Larger then 5 MB
  3. Check the corporate emails record,
  4. No attachment

ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

πŸ‘Ž Actual Behavior

No Pdf.

πŸ‘ Expected Behavior

PDF Attached

πŸ‘· Testing

πŸ“· Screenshot of configuration

https://user-images.githubusercontent.com/23143958/61069974-840b2900-a3db-11e9-91d8-dec68a64b113.png

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

Nothing Suspicious

🌍 Your Environment

Environment Version / Name
YetiForce 5.0.0
Web server (name and version) Apache/2.4.39
PHP 7.2.14 PHP-FPM
Browser (name and version)
Operating System (name and version)
Database (name and version) 10.1.39-MariaDB

❓ Additional context

I am not sure if it is a bug or feature.

rskrzypczak commented 4 years ago

Lately a limit equal to the upload value specified in configuration has been added. image

I however think that the reason why your attachments aren't being downloaded is because of something else, namely their verification security-wise. If you check your logs you will probably see entries that confirm that. The latest servicepack for 5.1 includes a fix that improves file verification. It will most likely eliminate the number of rejected files. I recommend updating your system to 5.1 + servicepack v4.

z0lo13 commented 4 years ago

Lately a limit equal to the upload value specified in configuration has been added. image

I however think that the reason why your attachments aren't being downloaded is because of something else, namely their verification security-wise. If you check your logs you will probably see entries that confirm that. The latest servicepack for 5.1 includes a fix that improves file verification. It will most likely eliminate the number of rejected files. I recommend updating your system to 5.1 + servicepack v4.

@rskrzypczak

I understand. Maybe you know What is the class or file that verify attachments for the mail scanner?

Unfortunately 5.1 was not stable when it just came out. And now i hope it will be 5.2 comming soon, as most of bugs from 5.1 been fixed in it. Also i have integrated couple of modules out of yetiforce production, which make update not as smooth. Waiting for 5.2

rskrzypczak commented 4 years ago

https://github.com/YetiForceCompany/YetiForceCRM/blob/f3835d1735f86958fcdfdb5bfb9297503549b285/modules/OSSMail/models/Mail.php#L372

z0lo13 commented 4 years ago

https://github.com/YetiForceCompany/YetiForceCRM/blob/f3835d1735f86958fcdfdb5bfb9297503549b285/modules/OSSMail/models/Mail.php#L372 @rskrzypczak i will test the new version and come back with feedback, i am surer that something wrong with size as the pdf is generated by yetipdf. And i cannot just disable the security check on codeinjections.

My question would be: it should actually log the error when i enable logging but where would it go? system.log or error.log? i dont see any errors in there

z0lo13 commented 4 years ago

@rskrzypczak can you open the issue? as it is a bug and it is not fixed!

rskrzypczak commented 4 years ago

bigattach

I however think that the reason why your attachments aren't being downloaded is because of something else, namely their verification security-wise. If you check your logs you will probably see entries that confirm that.

system.log or error.log? i dont see any errors in there

system.log (link)

z0lo13 commented 4 years ago

@rskrzypczak You have send me a link for debuging. However, I have created a new issue where is test the following in the gitdeveloper https://github.com/YetiForceCompany/YetiForceCRM/issues/11286

rskrzypczak commented 4 years ago

this probably resolve your problem: https://github.com/YetiForceCompany/YetiForceCRM/commit/24125dbbe5c5c700c87d9ae416d2f69e97dc6260