I guess for some mails there is no attachments is attached, we can loop through them and check if mailMessages.attachments.any then only we can download the attachment.
Also if possible we can filter the mails using subject.
Can you please try this one and let us know?
I understand your point of view but unfortunately I can’t avoid or delete these emails.
According to the IT team in my company, these emails are identical and have almost identical headers. The only variable are the 2 attached .PDFs but those ARE NOT corrupt documents, I don’t understand why Studio won’t let me process them. Bear in mind that these .PDFs are already manually downloaded and used by the company’s employees.
My guess is there is a bug withing Studio and I trying to find a workaround.