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 »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
Pages: [1]

Author Topic: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ  (Read 1871 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 16, 2010, 01:07:25 pm
Hello,

I believe the EZC package is broken with regards to gmail imap accounts

This may affect many sites that are unaware of it and have had it working in set & forget mode for a long time.


It would result in replies not being processed but no errors and could affect sites which previously had working gmail php return channels. The symptoms of this problem are as described in other posts.



http://forum.civicrm.org/index.php/topic,10721.15.html
http://forum.civicrm.org/index.php/topic,10698.0.html
http://issues.civicrm.org/jira/browse/CRM-5431
http://issues.ez.no/IssueView.php?Id=15837&ProjectId=1


The details of the second symptom type & how I got it to work are below BUT the important thing to note is that there may be many sites out there blissfully unaware their civimail is not processing bounces because it is gmail that has changed not anything at their end

To test
Go to (Drupal)
http://yourdomain/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=username&pass=password&key=yourKey

& check there is evidence of mail being processed

To fix

apply this patch:

Code: [Select]
--- Mail/src/transports/imap/imap_transport.php (revision 11126)
+++ Mail/src/transports/imap/imap_transport.php (revision 11127)
@@ -522,6 +522,11 @@
         $tag = $this->getNextTag();
         $this->connection->sendData( "{$tag} LOGIN {$user} {$password}" );
         $response = trim( $this->connection->getLine() );
+ // hack for gmail, to fix issue #15837: imap.google.com (google gmail) changed IMAP response
+ if ( $this->serverType === self::SERVER_GIMAP && strpos( $response, "* CAPABILITY" ) === 0 )
+ {
+ $response = trim( $this->connection->getLine() );
+ }
         if ( strpos( $response, '* OK' ) !== false )
         {
             // the server is busy waiting for authentication process to


Some technical explanation (if you care)

EZC processes the first line returned By IMAP looking for the OK string:

Here is how it looks when you communicate with google by IMAP:

A LOGIN username@domain password
* CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
A OK username@domain authenticated (Success)


On line 503 of ezc imap_transport it says:

        $response = trim( $this->connection->getLine() );

ie. it only looks at the first line returned which is the CAPABILITY line not the OK string line. The fix causes it to look at the second too.

« Last Edit: January 16, 2010, 01:17:28 pm by Eileen »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 18, 2010, 02:37:56 am
The relevant issue is CRM-5431 and we’re using the fixed ezComponents in CiviCRM 3.1.
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 18, 2010, 02:51:34 am
Yep - that link is above too - but anyone using gmail should apply the patch NOW not wait until their upgrade
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 19, 2010, 01:31:44 am
The problem is that the above patch is not enough; you’d need to fully upgrade the ezComponents. For example, the patch refers to self::SERVER_GIMAP which is undefined until you add it.

I’m thinking fast what would be the best solution here; upgrading ezComponents in a patch release (3.0.3 → 3.0.4) is a very bad idea, but having a half-patched ezComponents is even worse. :|
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

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 19, 2010, 06:28:35 am
Ok, I went out and upgraded ezComponents on the v3.0 branch, and this should be fixed in CiviCRM 3.0.4 later this week.

If someone could test whether overwriting their CiviCRM 3.0’s packages/ezc with CiviCRM 3.1’s packages/ezc fixes this issue it would be most appreciated.
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 19, 2010, 10:28:04 am
For People using gmail who are not able to upgrade to either 3.0.4 or 3.1 in the near future you can simply duplicate this line

Code: [Select]
     $response = trim( $this->connection->getLine() );

ie.
Code: [Select]
       $this->connection->sendData( "{$tag} LOGIN {$user} {$password}" );
       $response = trim( $this->connection->getLine() );+
 +   $response = trim( $this->connection->getLine() );

This will break anything other than gmail
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

mikeney

  • I’m new here
  • *
  • Posts: 20
  • Karma: 3
  • CiviCRM version: 3.3.2
  • CMS version: Joomla 1.5.22
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 19, 2010, 07:46:48 pm
I just replaced the ecz directory in my 3.0.3 installation with the 3.1b5 ezc directory and so far it has solved the Gmail access problems.  :) I look forward to getting the final 3.1!

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ
January 19, 2010, 09:50:44 pm
Thanks so much, mikeney, for testing this!

Also – thanks a lot, Eileen, for the workaround!
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 »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • GMAIL IMAP & EZC - IF YOU ARE USING GMAIL for civimail you need to READ

This forum was archived on 2017-11-26.