CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • CiviMailProcessor.php - Invalid mailbox name..
Pages: [1]

Author Topic: CiviMailProcessor.php - Invalid mailbox name..  (Read 10929 times)

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
CiviMailProcessor.php - Invalid mailbox name..
December 10, 2008, 09:57:29 am
I am trying to test my setup and it seems I have put in the right parameters for password, username, etc... but, to me it seems that my IMAP server does not like the folder names with a dot in them. Here's error message:

connecting to pop.example.net, authenticating as civimail@example.net and selecting Inbox mailboxes found: INBOX.CiviMail.ignored, INBOX.CiviMail, INBOX
Fatal error: Uncaught exception 'ezcMailTransportException' with message 'An error occured while sending or receiving mail. The IMAP server could not create mailbox 'CiviMail.ignored': A0004 NO Invalid mailbox name..' in /var/www/html/drupal-6.6/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/imap/imap_transport.php:504 Stack trace: #0 /var/www/html/drupal-6.6/sites/all/modules/civicrm/CRM/Mailing/MailStore/Imap.php(67): ezcMailImapTransport->createMailbox('CiviMail.ignore...') #1 /var/www/html/drupal-6.6/sites/all/modules/civicrm/CRM/Mailing/MailStore.php(60): CRM_Mailing_MailStore_Imap->__construct('pop.example.net', 'civimail@example.n...', 'Sup3rspl4sh', true, 'Inbox') #2 /var/www/html/drupal-6.6/sites/all/modules/civicrm/bin/CiviMailProcessor.php(48): CRM_Mailing_MailStore->getStore() #3 /var/www/html/drupal-6.6/sites/all/modules/civicrm/bin/CiviMailProcessor.php(144): CiviMailProcessor->process() #4 {main} thrown in /var/www/html/drupal-6.6/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/imap/imap_transport.php on line 504

I tried creating manually and that seems to be the problem... I can manually create (see above - Inbox mailboxes found) create something like INBOX.CiviMail.ignored

Where should I tell CiviMail to use these?
« Last Edit: December 11, 2008, 01:56:31 am by goran »

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: CiviMailProcessor.php - Invalid mailbox name..
December 10, 2008, 10:19:50 am
soved it the lazy way
changed lines 97 and 98 in Imap.php to       

$this->_ignored   = 'INBOX.CiviMail.ignored';
$this->_processed = 'INBOX.CiviMail.processed';

and now it works for me (the folders we manually created before...)

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
December 11, 2008, 12:48:29 am
Quote from: goran on December 10, 2008, 09:57:29 am
An error occured while sending or receiving mail. The IMAP server could not create mailbox 'CiviMail.ignored': A0004 NO Invalid mailbox name..

Argh. Do you know what IMAP server it runs?

I tested the code with GMail and it worked with mixed-case folders; if the above is with some free webmail, I could test exactly what the problem is.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: CiviMailProcessor.php - Invalid mailbox name..
December 11, 2008, 01:55:09 am
From my understanding it is not a problem of mixed case (do you mean case sensitive?), but

Quote from: goran on December 10, 2008, 10:19:50 am
$this->_ignored   = 'INBOX.CiviMail.ignored';
$this->_processed = 'INBOX.CiviMail.processed';

the fact that originally it did not prepend the $folder variable so it was trying to create the folders in the root - not the Inbox.CiviMail.ignored, but CiviMail.ignored and my IMAP server (I will check with our ISP if you think that is still pertinent) didn't want to create that.

I tried creating it through outlook in the way mentioned above.

Another thing that might be an issue (sorry, have no time to test today, so I list it as assumption) - while creating the folder structure (using Outlook) might be the creation of the folders. If i try to create 'CiviMail.ignored' directly I get 'Cannot create the folder. The hierarchy delimiter for this server '.' cannot be used in folder names. Create only one level of hierarchy at a time'. Not sure if CiviMail would have a problem with this (assumption).

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
December 11, 2008, 02:37:42 am
Quote from: goran on December 11, 2008, 01:55:09 am
the fact that originally it did not prepend the $folder variable so it was trying to create the folders in the root - not the Inbox.CiviMail.ignored, but CiviMail.ignored and my IMAP server (I will check with our ISP if you think that is still pertinent) didn't want to create that.

Yeah, I understood that. I tested with GMail and they did allow root-originated mailboxes, so I assumed other implementations would as well (I’m not sure why would anyone restrict the user to allow mailboxes only under INBOX).

Quote from: goran on December 11, 2008, 01:55:09 am
I tried creating it through outlook in the way mentioned above.

Did you confirm that you cannot create any root inboxes whatsoever? Even simple ones, like ‘test’?

Quote from: goran on December 11, 2008, 01:55:09 am
The hierarchy delimiter for this server '.' cannot be used in folder names.

This is most probably it – GMail uses \ for hierarchy delimiter. I’ll adjust the CiviMail folder names to not contain a dot.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: CiviMailProcessor.php - Invalid mailbox name..
December 11, 2008, 04:28:21 am
I confirm I can not. Outlook pops up: " Cannot create the folder. The server responded: 'Invalid mailbox name.' "

Also I confirm that neither / nor \ work as separators (/ is refused, and \ is taken literaly and creates a folder with a name 'test\test')

So, I think it is restricted. Maybe, because my provider use older web interface that can't handle it? Nevermind, I believe that the solution for this from CiviMail side is that the folder path is completely configurable...

As a second best I would vote for keeping it in the inbox (not only because it works for me :), but because this mail is still should be considered only received by any other reader). But these are details.
« Last Edit: December 11, 2008, 04:39:03 am by goran »

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
December 12, 2008, 02:32:33 am
Thanks a lot for testing this!

Quote from: goran on December 11, 2008, 04:28:21 am
Nevermind, I believe that the solution for this from CiviMail side is that the folder path is completely configurable...

As a second best I would vote for keeping it in the inbox (not only because it works for me :), but because this mail is still should be considered only received by any other reader).

Yeah, I think we should make this configurable.

Making it a subfolder of inbox makes some sense, but I’ll have to test it with GMail – we want to support GMail, because it’s the easiest way to have a working return channel (GMail supports + as the recipient delimiter and CiviCRM 2.2 has localpart support, so if you have a civimail@gmail.com account, you can use civimail+s.7.0.0000000000000000@gmail.com as the CiviMail subscribe-to-group-7 address, for example, and poll that account with CiviMail Processor). The trick with GMail is that it maps IMAP folders to labels, and so I’m not sure whether it supports subfolders (and if so how does it work).

Also, on every connection CiviMail Processor parses all email from the inbox, and if GMail has a flat hierarchy then moving an email to INBOX.CiviMailProcessed might mean it gets processed again next time anyway.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
December 12, 2008, 02:47:01 am
I filed CRM-3929 to track this.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: CiviMailProcessor.php - Invalid mailbox name..
December 12, 2008, 04:09:02 am
I think GMail will have no issues with hierarchy (I tested through Outlook as IMAP client for gmail and subfolders look fine).
From tests with Outlook I assume(!) that the IMAP support for gmail is good and that the lables/flat space only appears flat in the webclient.


Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
December 12, 2008, 04:48:40 am
Quote from: goran on December 12, 2008, 04:09:02 am
I think GMail will have no issues with hierarchy (I tested through Outlook as IMAP client for gmail and subfolders look fine).
From tests with Outlook I assume(!) that the IMAP support for gmail is good and that the lables/flat space only appears flat in the webclient.

So would it make more sense to make the two folders (for processed and ignored) CiviMail-bound emails configurable, or would it make more sense to create them as Inbox.CiviMailProcessed and Inbox.CiviMailIgnored (where . is replaced by the given IMAP server’s hierarchy delimiter)?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

fchmely

  • Guest
Re: CiviMailProcessor.php - Invalid mailbox name..
December 23, 2008, 02:26:34 pm
Wouldn't it be better to use the $folder variable (whose default value is 'Inbox')?

For instance, like so:

line 61        $this->_ignored   = $folder . '.CiviMail.ignored';

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: CiviMailProcessor.php - Invalid mailbox name..
January 27, 2009, 05:29:18 am
Filed as CRM-4037, fixed for CiviCRM 2.2 in r19545.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • CiviMailProcessor.php - Invalid mailbox name..

This forum was archived on 2017-11-26.