Fix: Mail fetching stops due to invalid characters in the attachment name

Fix: Mail fetching stops due to invalid characters in the attachment name


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)


[00:49:53:547]|[01-31-2024]|[com.manageengine.servicedesk.v3api.utils.AttachmentAPIUtil]|[SEVERE]|[383]: Exception while writing Attachment file| 
java.nio.file.InvalidPathException: Illegal char <?> at index 73: C:\Users\admin\AppData\Local\Temp\2\SDPAttachment\a9fb54f26e\Testing _ _ ? : characters.eml
at sun.nio.fs.WindowsPathParser.normalize(
at sun.nio.fs.WindowsPathParser.parse(
at sun.nio.fs.WindowsPathParser.parse(
at sun.nio.fs.WindowsPath.parse(
at sun.nio.fs.WindowsFileSystem.getPath(
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.JavaMailFetcher.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.GeneratedMethodAccessor85.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.$Proxy2.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$

[00:49:53:548]|[01-31-2024]|[com.manageengine.servicedesk.mail.core.MailScheduleBean]|[INFO]|[383]: __errormail__ : Error Mail is encountered for the first time. Skipping it to process again|


     SDP now replaces the problematic characters "?", ":" with "_" character. With this, the attachment will be uploaded properly.

Steps to apply the fix:

1. Download the fjar file compatible to your build version. Check the compatibility in the below table.

2. Click here on steps to apply the fjar file.

3. Restart the application service.

4. Check for the issue.

5. If the issue occurs, 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.

Affected versions: Since 14610

Issue ID: SD-118369

Compatible Fjar files:

Fjar name


                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • 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 ...
                      • Fix JAR for Parse Error Exception Raised during Mail Fetching

                        Issue : Some mail are fetched and created as ticket without description due to message corruption temporarily. The issue is can be identified with the below trace. Fix : The issue is not recreated when the mail is skipped to next schedule and fetched ...
                      • Attachment Dropping: Failure to Decode File Names Properly During Mail Fetching

                        Issue: 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 ...
                      • List of mail fetching issues and solutions

                        Scenario 1 : Mail fetching issue due to Invalid or No PKIX certificate .   Log traces for Mail Fetching  issues Exception when connecting to store.|javax.mail.MessagingException: PKIX path building failed: ...