Title: Error adding attachment
Last modified: August 11, 2021

---

# Error adding attachment

 *  Resolved [justinlongrider](https://wordpress.org/support/users/justinlongrider/)
 * (@justinlongrider)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/error-adding-attachment/)
 * I’m having an intermittent issue where an image attached to an email is not included
   in the resulting post.
 * I get two emails in error. One that says:
 * “There was an error adding the attachment: filename.jpg”
    and another that says:“
   Failed to add image media file: filename.jpg”
 * Both emails state: “Sorry, this file type is not permitted for security reasons.”
 * Now here’s the catch: I’m only getting these errors when Postie is trying to 
   import a large number of posts at the same time. (Typically 10 to 30 different
   emails and images within a short period of time.)
 * I realize this is likely not what Postie was designed for, but it’s an occasional
   requirement in my use case.
 * I’ve tried the following without success:
    - Setting WP_MEMORY_LIMIT anywhere from 60 to 1024 MB.
    - Restricting the number of emails imported at a time to 5, while checking for
      new mail every 30 seconds
 * While I could likely limit the number of emails imported further, importing them
   is somewhat time sensitive.
 * Any assistance is appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Wayne Allen](https://wordpress.org/support/users/wayneallen-1/)
 * (@wayneallen-1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/error-adding-attachment/#post-14766498)
 * This error message is from WordPress, not Postie. For whatever reason, WordPress
   has decided that your attachment is not allowed.
 * It is possible the file is not a valid jpg file, which is why it is being rejected.
 *  Plugin Author [Wayne Allen](https://wordpress.org/support/users/wayneallen-1/)
 * (@wayneallen-1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/error-adding-attachment/#post-14849118)
 * Thanks to logs supplied by [@justinlongrider](https://wordpress.org/support/users/justinlongrider/)
   I found a scenerio where PDF files would not get added due to this error. I was
   able to resolve the issue in Postie 1.9.57

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error adding attachment’ is closed to new replies.

 * ![](https://ps.w.org/postie/assets/icon-256x256.png?rev=970083)
 * [Postie](https://wordpress.org/plugins/postie/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/postie/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/postie/)
 * [Active Topics](https://wordpress.org/support/plugin/postie/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/postie/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/postie/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Wayne Allen](https://wordpress.org/support/users/wayneallen-1/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/error-adding-attachment/#post-14849118)
 * Status: resolved