I found that reading emails using Zend_Mail might be a bit of a mistake. Sometimes not all attachment files are recognized or in some cases imap cannot even decode the body of the message.
We use the Sendgrid service to analyze emails now, and it works very well. They have a special api for decrypting emails. on the other hand, it costs money, but I prefer better results.
source share