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) »
  • ezcMailTransportException IMAP server could not create mailbox - alternatives?
Pages: [1]

Author Topic: ezcMailTransportException IMAP server could not create mailbox - alternatives?  (Read 5064 times)

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
ezcMailTransportException IMAP server could not create mailbox - alternatives?
May 18, 2010, 06:46:44 am
Hi.

I am caring for a server running a Drupal 6 / CiviCRM 3.1 and CiviMail installation. This install sends mailings to 4,000-6,000 contacts/week, and this has been growing steadily lately. We need to have more statistics on bounces, hence our interest in the return channel configuration.

This civicrm install appears to have been in use since 1.x releases. At that time it is clear that there was an attempt to use the amavisd and postfix for the return channel, as I can see the evolution of the commented out regex in the postfix virtual file. It also appears that that system never was fully configured, as civi has never reported any bounces from mailings on this server. It does however, place addresses on hold. Currently there are over 21,000 "unprocessed" bounce messages in the /var/spool/mail file  (mbox) for the civimail user account. I can authenticate on this account and fetch all of this mail via Thunderbird from the (old) dovecot 1.0.13 IMAP server. I can also create single depth folders in this IMAP account with Thunderbird.

When attempting to process this mailbox via dovecot-IMAP, with both CiviMailProcessor.php and/or EmailProcessor.php I receive the same php error message that indicates the script cannot create the necessary folders in the mailbox. This makes sense as they are more than a single folder deep.  This appears to be a limitation of the combination of dovecot version and the mbox mail storage format.  Here is the error:

Code: [Select]
PHP Fatal error:  Uncaught exception 'ezcMailTransportException' with message 'An error occured while sending or receiving mail. The IMAP server could not create mailbox 'INBOX/CiviMail/ignored': A0006 NO Mailbox doesn't allow inferior mailboxes.' in /var/www/html/sites/all/modules/civicrm/packages/ezc/Mail/src/transports/imap/imap_transport.php:774
maillog excerpt with verbose logging from dovecot:

Code: [Select]
May 10 11:56:52 www dovecot: imap-login: Login: user=<civimail>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
May 10 11:56:52 www dovecot: IMAP(civimail): Effective uid=507, gid=507, home=/home/civimail
May 10 11:56:52 www dovecot: IMAP(civimail): mbox: data=/home/civimail/mail/:INBOX=/var/spool/mail/civimail
May 10 11:56:52 www dovecot: IMAP(civimail): mbox: root=/home/civimail/mail, index=/home/civimail/mail, inbox=/var/spool/mail/civimail
May 10 11:56:52 www dovecot: IMAP(civimail): Disconnected: Logged out

Even if I could have those scripts create those folders and process all that mail, I will have to do it nice'd from the command line.

With the volume of mail we are sending, I am hesitant to try and push it all through one of our google apps accounts, and have heard mixed reports on the ability to do that with google apps accounts (as distinct from gmail accounts) due to header rewriting on the part of google.

Other options include re-configuring the server's mail system to use courier-IMAP and sendmail instead of dovecot-IMAP and postfix (not so fun :)), or building a more recent version of dovecot that will support nested folders (which I have to confirm is even possible)... I could convert the mbox to a Maildir and try to use the Maildir processing system...

It seems like the IMAP / php route is the preferred way of handling the return channel..

Any ideas? Thanks for sharing.. 

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
May 19, 2010, 12:47:25 pm
Hi again,
I built Dovecot 1.2.11 from source and I still have the same errors. Next I am going to go to Maildir Format for the inbox.

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 01:22:46 pm
I have transitioned to Maildir format on this server and can login via IMAP  Dovecot (Thunderbird 3.0 and via CiviMailProcessor.php, and EmailProcessor.php) I can see the (now) 34,000 messages in this mailbox.

when running CiviMailProcessor.php I receive the following and only the following:

Code: [Select]
connecting to localhost, authenticating as civimail and selecting INBOX mailboxes found: Trash, INBOX, INBOX.CiviMail.ignored, INBOX.CiviMail.processed
the page stops loading.
Dovecot shows a disconnection immediately:

Code: [Select]
Nov  9 15:58:29 www dovecot: imap-login: Login: user=<civimail>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, TLS
Nov  9 15:58:29 www dovecot: IMAP(civimail): Effective uid=507, gid=507, home=/home/civimail
Nov  9 15:58:29 www dovecot: IMAP(civimail): maildir: data=/home/civimail/Maildir
Nov  9 15:58:29 www dovecot: IMAP(civimail): maildir: root=/home/civimail/Maildir, index=/home/civimail/Maildir, control=, inbox=
Nov  9 15:58:29 www dovecot: IMAP(civimail): Disconnected: Logged out

no related php errors in the apache error_log.


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 01:36:06 pm
1) try reading the mailbox using a regular mail client (thunderbird)

2) better run the script as a php cli than as a page

(check the book for details)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 01:45:23 pm
As a interesting and somewhat unrelated side note;

With the modded Amavisd pre content filter, the regex in the postfix virtual file (etc/postfix/virtual)
Code: [Select]
/(b|c|e|o|r|u)\.(\d+)\.(\d+)\.([0-9a-f]{16})@www\.example\.org$/ civimail@www.example.org

only works as a pcre regex for me, and the documentation for the amavisd return channel tells you to use this regex as a
regexp:/etc/postfix/vitrual

Code: [Select]
virtual_alias_maps = regexp:/etc/postfix/virtual <<--doesn't work
virtual_alias_maps = pcre:/etc/postfix/virtual <<--does work

http://wiki.civicrm.org/confluence/display/CRMDOC31/AMaViS



technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 01:46:18 pm
Thanks Xavier, will do in the php cli

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 02:01:07 pm
Pretty sure you don't want to go the patched Amavisd way.

http://forum.civicrm.org/index.php/topic,16430.0.html

Unless very good reason, stick to the config we suggest in the book.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 09, 2010, 03:08:23 pm
Thanks X

I can open the IMAP Maildir based mailbox with Thunderbird 3.0.5 on ubuntu 10.04 (loading headers for the 34000+ emails takes a while. ;))
I can manually read the emails on the command line when logged in as the mailbox owner.
I inherited this Amavisd CiviCRM setup, and as I said, It doesn't appear to have ever worked, so it can be scrapped, but the regex thing might help someone, or spur a note in the Documentation.

while running the php script via cli:
Code: [Select]
cd /var/www/html/sites/all/modules/civicrm/bin ; nice -19 /usr/bin/php EmailProcessor.php -sdefault -uusernamehere -ppasshere

OR

cd /var/www/html/sites/all/modules/civicrm/bin ; nice -19 /usr/bin/php CiviMailProcessor.php -sdefault -uusernamehere -ppasshere


I get failed Authentication "ERROR: You need to send a valid user name and password to execute this file".

As i said, the wget method works fine (starts running the script) with a correct username and password , but I'm in civi 3.1, and did investigate some issues with a file called cli.php (which I didn't have, but pulled from trunk). It didn't make any difference, as I would have to add some logic to above scripts to get them to do anything with it.

But I can authenticate in Drupal with the same appropriate username and password. That leads me to Drupal User Permissions ....


technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 10, 2010, 08:48:26 am

So instead of trying to make this old system work, I scrapped it and used a google apps e-mail address (with the localpart: mailaccountusername+ ) and IMAP for the php-based return channel. so far so good.  we'll see soon if I have any problems.

thx for the nudge X

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 10, 2010, 10:51:28 am
Hi,

glad you fixed it.

Something you'd want to check is the spam filter on gmail. Someone shared the filters he put in place to avoid having the bounce seen as spam
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

technil

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 3.2, 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.41, 5.0.45
  • PHP version: 5.3.2, 5.2.6
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
November 19, 2010, 11:30:42 am
 Everything is working quite well now!  I am using postfix SMTP for the outgoing mailings so I don't have to send that magnitude of mailings via Google. I already have an SPF record in DNS set up for that mailserver, so google and other domains know that the sender is valid, and the mails have a spf pass in the header when delivered. I am processing the mail via the wget in cron , at a rate of 50 mails every 10 minutes. I logged in a few times and pulled bounced mails categorized as spam with the "Not spam" button on the Google apps email web interface, and it seems to be doing quite well at figuring out the classification without any filters.

thanks again for the tips xavier

gastrit

  • I post occasionally
  • **
  • Posts: 60
  • Karma: 2
  • CiviCRM version: 4.2.2
  • CMS version: 7.8
  • MySQL version: 5.1.41
  • PHP version: 5.3.2
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
July 20, 2011, 07:58:48 am
Hello!

I am getting the same error message as in the first post here (Could not connect to MailStore Error message: An error occured while sending or receiving mail. The IMAP server could not create mailbox 'CiviCRM_INBOX/CiviMail/ignored': A0006 NO [CANNOT] Mailbox doesn't allow inferior mailboxes.)

It seems like my mail system doesn't allow messages and sub-folders in the same folder. A folder either contains messages or sub-folders. And I'm not aloud to reconfigure the mail system. If I telnet to port 143 I get the following answer:
OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS LOGINDISABLED] Dovecot ready.

Is there any way to solve my problem? Does EmailProcessor.php have to create sub-folders in the same folder it's checking for new mail?

gastrit

  • I post occasionally
  • **
  • Posts: 60
  • Karma: 2
  • CiviCRM version: 4.2.2
  • CMS version: 7.8
  • MySQL version: 5.1.41
  • PHP version: 5.3.2
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
July 20, 2011, 08:10:09 am
Maybe I should add that I created a folder in my bounce mail account that I am trying to use. So instead of using the default INBOX I am using (or trying to use) a folder called CiviCRM_INBOX.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: ezcMailTransportException IMAP server could not create mailbox - alternatives?
July 20, 2011, 08:24:21 am

yes, emailProcessor needs the ability to create sub-folders. You'll need to modify the code there if you want to do something different. I suspect the changes will be non-trivial

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • ezcMailTransportException IMAP server could not create mailbox - alternatives?

This forum was archived on 2017-11-26.