Answers.Body: <p>So after plenty of back and forth, the issue seems to be the fact I am specifying a Source folder in my IMAP account.</p>
  
  <p>When I created a brand new account for testing, found same issue with a folder named CRM. Tried crm in case there was case sensitivity, still the same.</p>
  
  <p>Only when I removed source and let it read from the Inbox directory did it work consistently. It was nothing to do with a specific email, simply the folder being used. </p>
  
  <p>Would love to know if this can be fixed (or even where in the code it is so I can try myself) as meanwhile I will need to maintain an extra email account. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T12:56:15.473Z
Answers.LastActivityDate: 2015-07-21T12:56:15.473Z
Answers.UserDisplayName: Davey H
Answers.Body: <p>If the IMAP account is a Gmail or Google Apps account, it is likely you will have to enable a setting, "Allow access by less secure apps". That solved my authentication errors with a Google Apps account. More info can be found here: <a href="https://support.google.com/a/answer/6260879?hl=en" rel="nofollow">https://support.google.com/a/answer/6260879?hl=en</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-21T15:28:33.507Z
Answers.LastActivityDate: 2015-12-21T15:28:33.507Z
Answers.UserDisplayName: Jake Schlachter
Answers.Body: <p>I've found that deleting any emails with attachments prior to running Civi's scheduled allowed the processing to complete normally.  While SOME small attachments are ok, generally attachments do not process well with Civi.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T18:49:56.887Z
Answers.Text: It didn't seem to have a problem with attachments. When I change the folder - it works for 1 execution. From then on , it fails consistently regardless of what content is in the folder (I have stopped bothering even adding content as it consistently fails on the 2nd run on an empty folder). I think it's trying to create the ignored folder again, but not sure
Answers.UserDisplayName: Davey H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T18:58:50.190Z
Answers.Text: The error does seem to indicate it is trying to create a folder that already exists, and then stopping, citing an IMAP error.  Could this be a configuration on your IMAP server?
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T18:41:32.123Z
Answers.LastActivityDate: 2015-07-20T18:41:32.123Z
Answers.UserDisplayName: CiviTeacher
Answers.Body: <p>Use of emoji in email can also cause problems - which may be able to be solved  with</p>
  <blockquote>
  <p>drush cvapi System.utf8conversion</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-01T08:52:32.143Z
Answers.LastActivityDate: 2024-02-01T08:52:32.143Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>The mail2activity feature might have difficulties to process some mails indeed (eg. if they are too big).</p>
  
  <p>When I had this problem, deleting the mail did solve it. Are you sure you are properly deleting the email? imap has a tendency to want to keep the emails even if you delete them (until you purge them, or whatever the name on your mail client)</p>
  
  <p>What I found was working better is to move them to a different folder instead of trashing them, it avoided the problem for me</p>
  
  <p>If you want to dig more into the issue, can you enable the debug and traceback and add them to your question? </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T17:15:48.483Z
Answers.Text: Hi Xavier - problem is that I want CiviCRM to go through three years of emails and create the contacts. Was aiming to do in batches of 20 or so rather than dump the two thousand emails in the same folder. The tester email is fell over on was tiny, only a subject no content. Debug and traceback enabled - where do I go to find the output to paste here?
Answers.UserDisplayName: Davey H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T17:26:48.057Z
Answers.Text: Added as part of the question. I will switch to a new folder and paste in the same for the successful process
Answers.UserDisplayName: Davey H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T17:37:47.387Z
Answers.Text: The first run at the new folder worked (and created the appropriate folders in the IMAP account). The second run (5 minutes later) failed with same reasons as above
Answers.UserDisplayName: Davey H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T18:48:04.397Z
Answers.Text: from the log it appears that CiviCRM is trying to create the ignored folder when it already exists. Otherwise cannot see anything that stands out. I currently do not have bounce processing set up, but don't think that is an issue.[Sorry for so many comments in a row]
Answers.UserDisplayName: Davey H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T15:14:45.247Z
Answers.LastActivityDate: 2015-07-20T15:14:45.247Z
Answers.UserDisplayName: Xavier
Body: <p>Have installed CiviCRM 4.6.4 on Drupal 7.38 and have explored the various modules to identify how it can be used to help a small UK charity.</p>
  
  <p>I am having issues with email-to-activity.
  I set it up to hook into an IMAP account via SSL and read a specific folder. This worked perfectly for a few tester emails, so then expanded my testing.
  When it got an email from a particular account the job started failing with:
  Error message: Process Activities failed</p>
  
  <p>When this email was removed from the specified folder, it did not fix the issue. Changing folders (and email accounts) worked until the job hits an email that it cannot process and then never works again in that folder.</p>
  
  <p>All my searching has only found two potential solutions. 
  1 - the password is wrong. This has been dismissed as it works fine until it hits certain emails.
  2 - make bounce processing and E2A from the same account - have seen this as a "solution" as well as a recommendation NOT to do this. Either way, it made no difference.
  I tried looking at the email headers to see if anything jumped out, but didn't seem to be encoding. </p>
  
  <p>I am new to CiviCRM and linux hosting, so while happy to look at detailed logging I may not know how to access/interpret. </p>
  
  <p>Any help or guidance would be appreciated, I can supply a sample email (either sent to an email to be picked up or a .eml attachment) if useful</p>
  
  <p>Many thanks</p>
  
  <p>Dave</p>
  
  <pre><code>Debug &amp; traceback:
  Jul 20 18:15:02  [info] $Fatal Error Details = Array
  (
      [message] =&gt; Could not connect to MailStore for XXX@YYY.com@secure.emailsrvr.com
  
  Error message: 
  
  An error occured while sending or receiving mail. The IMAP server could not create mailbox 'CRM2.CiviMail.ignored': A0006 NO [ALREADYEXISTS] Mailbox already exists.
  
      [code] =&gt; 
  )
  
  Jul 20 18:15:02  [info] $backTrace = #0 sites/all/modules/civicrm/CRM/Core/Error.php(322): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(184): CRM_Core_Error::fatal("Could not connect to MailStore for XXX@YYYY.com@secure.emailsrvr.com&lt;...")
  #2 sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(111): CRM_Utils_Mail_EmailProcessor::_process(FALSE, Object(CRM_Core_DAO_MailSettings))
  #3 sites/all/modules/civicrm/api/v3/Job.php(379): CRM_Utils_Mail_EmailProcessor::processActivities()
  #4 sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_fetch_activities((Array:1))
  #5 sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  #6 sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("Job", "fetch_activities", (Array:1), NULL)
  #7 sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "fetch_activities", (Array:1))
  #8 sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob))
  #9 sites/all/modules/civicrm/bin/cron.php(42): CRM_Core_JobManager-&gt;execute()
  #10 {main}
  </code></pre>
  
Tags: <civimail><cron-job><scheduling><activity>
Title: Email-to-activity processing - Error message: Process Activities failed
ThreadText: # Email-to-activity processing - Error message: Process Activities failed
  
  (Asked by: username_0 on 2015-07-20)
  
  Have installed CiviCRM 4.6.4 on Drupal 7.38 and have explored the various modules to identify how it can be used to help a small UK charity.
  
  I am having issues with email-to-activity.
  I set it up to hook into an IMAP account via SSL and read a specific folder. This worked perfectly for a few tester emails, so then expanded my testing.
  When it got an email from a particular account the job started failing with:
  Error message: Process Activities failed
  
  When this email was removed from the specified folder, it did not fix the issue. Changing folders (and email accounts) worked until the job hits an email that it cannot process and then never works again in that folder.
  
  All my searching has only found two potential solutions.
  1 - the password is wrong. This has been dismissed as it works fine until it hits certain emails.
  2 - make bounce processing and E2A from the same account - have seen this as a "solution" as well as a recommendation NOT to do this. Either way, it made no difference.
  I tried looking at the email headers to see if anything jumped out, but didn't seem to be encoding.
  
  I am new to CiviCRM and linux hosting, so while happy to look at detailed logging I may not know how to access/interpret.
  
  Any help or guidance would be appreciated, I can supply a sample email (either sent to an email to be picked up or a .eml attachment) if useful
  
  Many thanks
  
  Dave
  
  ```
  Debug & traceback:
  Jul 20 18:15:02  [info] $Fatal Error Details = Array
  (
      [message] => Could not connect to MailStore for XXX@YYY.com@secure.emailsrvr.com
  
  Error message: 
  
  An error occured while sending or receiving mail. The IMAP server could not create mailbox 'CRM2.CiviMail.ignored': A0006 NO [ALREADYEXISTS] Mailbox already exists.
  
      [code] => 
  )
  
  Jul 20 18:15:02  [info] $backTrace = #0 sites/all/modules/civicrm/CRM/Core/Error.php(322): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(184): CRM_Core_Error::fatal("Could not connect to MailStore for XXX@YYYY.com@secure.emailsrvr.com<...")
  #2 sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(111): CRM_Utils_Mail_EmailProcessor::_process(FALSE, Object(CRM_Core_DAO_MailSettings))
  #3 sites/all/modules/civicrm/api/v3/Job.php(379): CRM_Utils_Mail_EmailProcessor::processActivities()
  #4 sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_fetch_activities((Array:1))
  #5 sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #6 sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "fetch_activities", (Array:1), NULL)
  #7 sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "fetch_activities", (Array:1))
  #8 sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
  #9 sites/all/modules/civicrm/bin/cron.php(42): CRM_Core_JobManager->execute()
  #10 {main}
  
  ```
  
  **Tags:** civimail, cron-job, scheduling, activity
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_0 on 2015-07-21. Score: 4
  
  So after plenty of back and forth, the issue seems to be the fact I am specifying a Source folder in my IMAP account.
  
  When I created a brand new account for testing, found same issue with a folder named CRM. Tried crm in case there was case sensitivity, still the same.
  
  Only when I removed source and let it read from the Inbox directory did it work consistently. It was nothing to do with a specific email, simply the folder being used.
  
  Would love to know if this can be fixed (or even where in the code it is so I can try myself) as meanwhile I will need to maintain an extra email account.
  
  
  ---
  
  ### Answer by username_1 on 2015-12-21. Score: 2
  
  If the IMAP account is a Gmail or Google Apps account, it is likely you will have to enable a setting, "Allow access by less secure apps". That solved my authentication errors with a Google Apps account. More info can be found here: <https://support.google.com/a/answer/6260879?hl=en>
  
  
  ---
  
  ### Answer by username_2 on 2015-07-20. Score: 2
  
  I've found that deleting any emails with attachments prior to running Civi's scheduled allowed the processing to complete normally. While SOME small attachments are ok, generally attachments do not process well with Civi.
  
  > **Comments:**
  > **username_0**: It didn't seem to have a problem with attachments. When I change the folder - it works for 1 execution. From then on , it fails consistently regardless of what content is in the folder (I have stopped bothering even adding content as it consistently fails on the 2nd run on an empty folder). I think it's trying to create the ignored folder again, but not sure  
  > **username_2**: The error does seem to indicate it is trying to create a folder that already exists, and then stopping, citing an IMAP error.  Could this be a configuration on your IMAP server?  
  
  ---
  
  ### Answer by username_3 on 2024-02-01. Score: 1
  
  Use of emoji in email can also cause problems - which may be able to be solved with
  
  > drush cvapi System.utf8conversion
  
  
  ---
  
  ### Answer by username_4 on 2015-07-20. Score: 0
  
  The mail2activity feature might have difficulties to process some mails indeed (eg. if they are too big).
  
  When I had this problem, deleting the mail did solve it. Are you sure you are properly deleting the email? imap has a tendency to want to keep the emails even if you delete them (until you purge them, or whatever the name on your mail client)
  
  What I found was working better is to move them to a different folder instead of trashing them, it avoided the problem for me
  
  If you want to dig more into the issue, can you enable the debug and traceback and add them to your question?
  
  > **Comments:**
  > **username_0**: Hi username_4 - problem is that I want CiviCRM to go through three years of emails and create the contacts. Was aiming to do in batches of 20 or so rather than dump the two thousand emails in the same folder. The tester email is fell over on was tiny, only a subject no content. Debug and traceback enabled - where do I go to find the output to paste here?  
  > **username_0**: Added as part of the question. I will switch to a new folder and paste in the same for the successful process  
  > **username_0**: The first run at the new folder worked (and created the appropriate folders in the IMAP account). The second run (5 minutes later) failed with same reasons as above  
  > **username_0**: from the log it appears that CiviCRM is trying to create the ignored folder when it already exists. Otherwise cannot see anything that stands out. I currently do not have bounce processing set up, but don't think that is an issue.[Sorry for so many comments in a row]  
  
  ---
  
  