FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18735&edit=1

ID: 18735
Updated by: dominik@dokdok.com
Reported By: dominik at dokdok dot com
Summary: Gmail OAuth support
Status: Open
Type: Feature/Change Request
Package: Net_SMTP
Package Version: 1.6.1
PHP Version: 5.3.6
Roadmap Versions:
New Comment:

usage for 2legged:


<?php
require './SMTP.php';

$host = 'smtp.gmail.com';
$from = '';

if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
die('Unable to instantiate Net_SMTP');
}

if (PEAR::isError($e = $smtp->connect())) {
die($e->getMessage() . "\n");
}

if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
'consumer_secret' => ''), 'XOAUTH'))) {
die($e->getMessage() . "\n");
}

...
?>


Previous Comments:
------------------------------------------------------------------------

[2011-08-15 19:09:26] dominikgehl

Added #patch bug:18735;patch:xoauth.patch;revision:1313431766;.

------------------------------------------------------------------------

[2011-08-15 19:06:25] dominikgehl

Description:
------------
Added support for XOAUTH
http://code.google.com/apis/gmail/oauth/protocol.html#smtp

------------------------------------------------------------------------

Search Discussions

  • Dominik at Aug 15, 2011 at 5:15 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18735&edit=1

    ID: 18735
    Comment by: dominik@dokdok.com
    Reported By: dominik at dokdok dot com
    Summary: Gmail OAuth support
    Status: Open
    Type: Feature/Change Request
    Package: Net_SMTP
    Package Version: 1.6.1
    PHP Version: 5.3.6
    Roadmap Versions:
    New Comment:

    usage for 3legged:

    <?php
    require './SMTP.php';

    $host = 'smtp.gmail.com';
    $from = '';

    if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
    die('Unable to instantiate Net_SMTP');
    }

    if (PEAR::isError($e = $smtp->connect())) {
    die($e->getMessage() . "\n");
    }

    if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
    'consumer_secret' => '', 'token' => '', 'token_secret' => ''),
    'XOAUTH'))) {
    die($e->getMessage() . "\n");
    }

    ...
    ?>


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-08-15 19:14:54] dominikgehl

    usage for 2legged:


    <?php
    require './SMTP.php';

    $host = 'smtp.gmail.com';
    $from = '';

    if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
    die('Unable to instantiate Net_SMTP');
    }

    if (PEAR::isError($e = $smtp->connect())) {
    die($e->getMessage() . "\n");
    }

    if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
    'consumer_secret' => ''), 'XOAUTH'))) {
    die($e->getMessage() . "\n");
    }

    ...
    ?>

    ------------------------------------------------------------------------

    [2011-08-15 19:09:26] dominikgehl

    Added #patch bug:18735;patch:xoauth.patch;revision:1313431766;.

    ------------------------------------------------------------------------

    [2011-08-15 19:06:25] dominikgehl

    Description:
    ------------
    Added support for XOAUTH
    http://code.google.com/apis/gmail/oauth/protocol.html#smtp

    ------------------------------------------------------------------------
  • Jon at Aug 17, 2011 at 7:29 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18735&edit=1

    ID: 18735
    Updated by: jon@php.net
    Reported By: dominik at dokdok dot com
    Summary: Gmail OAuth support
    -Status: Open
    +Status: Assigned
    Type: Feature/Change Request
    Package: Net_SMTP
    Package Version: 1.6.1
    PHP Version: 5.3.6
    -Assigned To:
    +Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Assigned
    -Assigned To:
    +Assigned To: jon
    Could you convert those examples into a unit test? It's the best way we
    have to
    ensure expected behavior as the code evolves.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-08-15 19:15:45] dominikgehl

    usage for 3legged:

    <?php
    require './SMTP.php';

    $host = 'smtp.gmail.com';
    $from = '';

    if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
    die('Unable to instantiate Net_SMTP');
    }

    if (PEAR::isError($e = $smtp->connect())) {
    die($e->getMessage() . "\n");
    }

    if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
    'consumer_secret' => '', 'token' => '', 'token_secret' => ''),
    'XOAUTH'))) {
    die($e->getMessage() . "\n");
    }

    ...
    ?>

    ------------------------------------------------------------------------

    [2011-08-15 19:14:54] dominikgehl

    usage for 2legged:


    <?php
    require './SMTP.php';

    $host = 'smtp.gmail.com';
    $from = '';

    if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
    die('Unable to instantiate Net_SMTP');
    }

    if (PEAR::isError($e = $smtp->connect())) {
    die($e->getMessage() . "\n");
    }

    if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
    'consumer_secret' => ''), 'XOAUTH'))) {
    die($e->getMessage() . "\n");
    }

    ...
    ?>

    ------------------------------------------------------------------------

    [2011-08-15 19:09:26] dominikgehl

    Added #patch bug:18735;patch:xoauth.patch;revision:1313431766;.

    ------------------------------------------------------------------------

    [2011-08-15 19:06:25] dominikgehl

    Description:
    ------------
    Added support for XOAUTH
    http://code.google.com/apis/gmail/oauth/protocol.html#smtp

    ------------------------------------------------------------------------
  • Dominik at Aug 17, 2011 at 12:18 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18735&edit=1

    ID: 18735
    Comment by: dominik@dokdok.com
    Reported By: dominik at dokdok dot com
    Summary: Gmail OAuth support
    Status: Assigned
    Type: Feature/Change Request
    Package: Net_SMTP
    Package Version: 1.6.1
    PHP Version: 5.3.6
    Assigned To: jon
    Roadmap Versions:
    New Comment:

    Unit tests are added. Let me know if you need anything else


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-08-17 14:18:11] dominikgehl

    Added #patch bug:18735;patch:config.php.dist.patch;revision:1313587091;.

    ------------------------------------------------------------------------

    [2011-08-17 14:16:43] dominikgehl

    Added #patch
    bug:18735;patch:auth_xoauth_3legged.phpt;revision:1313587003;.

    ------------------------------------------------------------------------

    [2011-08-17 14:16:16] dominikgehl

    Added #patch
    bug:18735;patch:auth_xoauth_2legged.phpt;revision:1313586976;.

    ------------------------------------------------------------------------

    [2011-08-17 09:30:12] jon

    -Status: Open
    +Status: Assigned
    -Assigned To:
    +Assigned To: jon
    Could you convert those examples into a unit test? It's the best way we
    have to
    ensure expected behavior as the code evolves.

    ------------------------------------------------------------------------

    [2011-08-15 19:15:45] dominikgehl

    usage for 3legged:

    <?php
    require './SMTP.php';

    $host = 'smtp.gmail.com';
    $from = '';

    if (! ($smtp = new Net_SMTP('ssl://' . $host, 465))) {
    die('Unable to instantiate Net_SMTP');
    }

    if (PEAR::isError($e = $smtp->connect())) {
    die($e->getMessage() . "\n");
    }

    if (PEAR::isError($e = $smtp->auth($from, array('consumer_key' => '',
    'consumer_secret' => '', 'token' => '', 'token_secret' => ''),
    'XOAUTH'))) {
    die($e->getMessage() . "\n");
    }

    ...
    ?>

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18735
  • Jon at Aug 29, 2011 at 3:43 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18735&edit=1

    ID: 18735
    Updated by: jon@php.net
    Reported By: dominik at dokdok dot com
    Summary: Gmail OAuth support
    -Status: Assigned
    +Status: Analyzed
    Type: Feature/Change Request
    Package: Net_SMTP
    Package Version: 1.6.1
    PHP Version: 5.3.6
    Assigned To: jon
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Analyzed
    One issue with the proposed patch is the fact that the "password" ($pwd
    in
    _authXOAuth) is an array for XOAUTH.

    This is a problem for the case where the Net_SMTP package is used to
    contact an
    XOAUTH-capable SMTP server but only a regular user password has been
    provided
    by the user. In that case, the new code will fail. (I changed your
    patch to raise a
    PEAR_Error in this case to be explicit.)

    Even if we changed $pwd's type to be formatted as a string (e.g.
    "consumer_secret:consumer_key"), it still wouldn't degrade to the other
    AUTH
    protocol implementations that expect a user password. (This path could
    occur if
    the AUTH method priorities are reconfigured by the user, for example.)

    I think we'll probably need to extend the AUTH selection mechanism in
    Net_SMTP to
    handle these cases before this patch can be fully integrated.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-08-18 15:15:24] dominikgehl

    Added #patch bug:18735;patch:package.xml.patch;revision:1313676924;.

    ------------------------------------------------------------------------

    [2011-08-17 14:18:45] dominikgehl

    Unit tests are added. Let me know if you need anything else

    ------------------------------------------------------------------------

    [2011-08-17 14:18:11] dominikgehl

    Added #patch bug:18735;patch:config.php.dist.patch;revision:1313587091;.

    ------------------------------------------------------------------------

    [2011-08-17 14:16:43] dominikgehl

    Added #patch
    bug:18735;patch:auth_xoauth_3legged.phpt;revision:1313587003;.

    ------------------------------------------------------------------------

    [2011-08-17 14:16:16] dominikgehl

    Added #patch
    bug:18735;patch:auth_xoauth_2legged.phpt;revision:1313586976;.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18735

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 15, '11 at 5:14p
activeAug 29, '11 at 3:43p
posts5
users3
websitepear.php.net

3 users in discussion

Jon: 2 posts Dominik: 2 posts Dominik: 1 post

People

Translate

site design / logo © 2022 Grokbase