Attachment Dropping: Failure to Decode File Names Properly During Mail Fetching

Attachment Dropping: Failure to Decode File Names Properly During Mail Fetching

      The attachment is dropped due to invalid extension. 

 After decoding, the file name appears as:

Orange Załącznik nr 1 - Podsumowanie - uzupełnienie. xlsx(Contains space in the extension)

However, the actual file name should be:

Orange Załącznik nr 1 - Podsumowanie - uzupełnienie.xlsx

The issue arises because there is an extra space character in the extension after decoding from the email. As a result, the extension of the attachment is considered as invalid and discards it.

[10:10:37:643]|[01-24-2024]|[]|[SEVERE]|[273]: File extension do not match with the allowed extenions |
[10:10:37:643]|[01-24-2024]|[]|[INFO]|[273]: IAMSecurityException ErrorCode: INVALID_FILE_EXTENSION|
[10:10:37:643]|[01-24-2024]|[com.manageengine.servicedesk.v3api.utils.AttachmentAPIUtil]|[SEVERE]|[273]: Exception while writing Attachment file| INVALID_FILE_EXTENSION
at com.manageengine.servicedesk.v3api.utils.AttachmentAPIUtil.uploadStreamAsAttachment(
at com.manageengine.servicedesk.mailutils.MailAPI.uploadAttachment(
at com.manageengine.servicedesk.mailutils.ModuleHandler.handleMailObject(
at com.adventnet.servicedesk.mailutils.MailProcessor.processEMail(
at com.manageengine.servicedesk.mail.core.fetcher.EwsMailFetcher.fetchAndProcessMails(
at com.manageengine.servicedesk.mail.core.fetcher.MailFetcher.startFetching(
at com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask.executeTask(
at com.adventnet.taskengine.internal.SchedulerBean.executeTask(
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.adventnet.mfw.bean.BeanProxy.lambda$invoke$0(
at com.zoho.mickey.api.DefaultCodeBlock.execute(
at com.adventnet.mfw.bean.BeanProxy.invoke(
at com.sun.proxy.$Proxy5.executeTask(Unknown Source)
at com.adventnet.taskengine.internal.ScheduleExecutor.executeNextTask(
at java.util.concurrent.Executors$
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
at java.util.concurrent.ScheduledThreadPoolExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

[10:10:37:643]|[01-24-2024]|[com.manageengine.servicedesk.mailutils.MailAPI]|[INFO]|[273]: Attchment dropped due to : INVALID_FILE_EXTENSION

Apply the provided fixed JAR file to address the issue. This solution, outlined in the knowledge base, ensures correct filename decoding, enabling successful addition of the attachment.

Before applying the .fjar file, kindly verify its compatibility in the "Jar Compatibility" section below.

Steps to apply the fix:
1. Download the attached .fjar file.
2. Click here for steps to apply the .fjar file.
3. Restart the application service.
4. If the issue occurs again, enable the email debug in the application, recreate the issue after enabling the email debug then immediately zip the logs (<server_home>\logs folder. For eg: C:\Program Files\ManageEngine\ServiceDesk\logs folder) and share it with us for analysis. If the size of the log file is huge, you can send it to us using our FTP link Select the product as "ServiceDesk Plus" and provide the proper ticket number.

Jar Compatibility:

Compatible Jar
14503 & 14504
14506 & 14600

                    New to ADSelfService Plus?

                      • Related Articles

                      • Mail Fetching: Inline Images Dropping Due to Invalid Extension

                        Issue: The inline image's file name from the email doesn't contain the extension. Example: filename = sys_attachment.dosys_id=5bb0751c8303b5dc96a238226daad371 As a result, the inline image gets stripped during the mail fetching process. The sender of ...
                      • Fix: Mail fetching stops due to invalid characters in the attachment name

                        Issue: Mail fetching being stopped due to invalid characters "?" , ":" in the filename. In this case, the eml file's subject contains ":" character and so, while uploading the .eml as attachment, error is thrown (Only in windows server) Trace: ...
                      • Mail Fetching - Error while processing attachment and inline image.

                        Issue During the process of fetching emails, attachments are dropped as a result of the presence of directory traversal characters. Furthermore, an issue arises when processing inline images, this particular error related to inline images results in ...
                      • Mail Fetching Stopped Due to Inline Image Handling

                        Issue Cause : While fetching a mail, in certain mail servers, cid of inline image is not parsed correctly. Once inline stream is converted to image, cid in src attr will be replaced with image url. cid for uploaded inline image in mail content is not ...
                      • Troubleshooting Oauth configuration for mail server settings

                        Oauth in ServiceDesk Plus / AssetExplorer for Mail SDP supports Oauth configuration for Office365 and GSuite mailboxes since 11106 build. Office365 mailboxes can be configured with Oauth authentication using EWS (since 11106) and IMAP / SMTP (since ...