3

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}
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.

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.

  • 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 – Davey H Jul 20 '15 at 18:49
  • 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? – CiviTeacher Jul 20 '15 at 18:58
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

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?

  • 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? – Davey H Jul 20 '15 at 17:15
  • Added as part of the question. I will switch to a new folder and paste in the same for the successful process – Davey H Jul 20 '15 at 17:26
  • 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 – Davey H Jul 20 '15 at 17:37
  • 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] – Davey H Jul 20 '15 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.