3

When setting up a Civi site for a client, I turned on email-to-activity processing. When you do this, Civi tries to set up two folders ('CiviMail/ignored' and 'CiviMail/processed') as subfolders of the inbox folder. However, the mail server doesn't support this, and puts them in a different place in the folder hierarchy (on the same level as the inbox).

I've patched this for now but it doesn't seem like a good long-term solution. Has any one else run into this? Any ideas on how I might deal with it in a longer-term way? Seems like something that would be good to make configurable.

(The relevant code in Civi is in CRM/Mailing/MailStore/Imap.php)

2

You can aslo create an issue on https://lab.civicrm.org/dev/core/issues and then send a Pull Request on GitHub.

1

When you say "doesn't support this", it sounds like it isn't returning an error(?), so it might be that the hierarchy separator isn't being determined correctly. Also I've seen some imap servers are case sensitive or just picky, so INBOX might be treated differently from Inbox when you specify the prefix.

Which imap server brand is it? Besides playing a bit with the Source settings on the Mail Account page where you set it up, try to confirm what the separator is (can put some debug code in the same place you've linked to see what it's returning from getHierarchyDelimiter()).

  • It's Dovecot. I had a search around and found some articles that suggested in some configurations of Dovecot, you can't create subfolders of the inbox, so I think it is just a mail server issue. Dovecot is quite widely used though so I'm surprised this isn't a more common issue. I don't have any control over the mail server sadly. – Anna Sidwell May 31 '18 at 15:45
  • Ok. So as Jaap says in his answer if you're able to submit a patch that allows for a blank Source prefix without breaking other setups then it will probably be accepted into core. For backwards compatibility you'd need to either also include upgrade code to convert any existing blanks to "INBOX", or else you would have to do something like use a lone period "." to mean blank, or a special string like "<blank>". Otherwise people's setups might stop working. The former is probably preferred. See e.g. CRM/Upgrade/Incremental/sql – Demerit Jun 2 '18 at 13:21

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.