Authen-Simple-Gmail

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

my $builder = Module::Build->new(
    module_name       => 'Authen::Simple::Gmail',
    license           => 'perl',
    dist_author       => 'Daniel Muey <http://drmuey.com/cpan_contact.pl>',
    dist_version_from => 'lib/Authen/Simple/Gmail.pm',
    requires          => {
        'Test::More'  => 0,
        'Net::Detect' => 0,
        'File::Slurp' => 0,

        'IO::Socket::SSL'         => 0,
        'Authen::Simple::Adapter' => 0,
        'File::Slurp'             => 0,
    },
    add_to_cleanup => ['Authen-Simple-Gmail-*'],
);

$builder->create_build_script();

META.json  view on Meta::CPAN

      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Authen::Simple::Adapter" : "0",
            "File::Slurp" : "0",
            "IO::Socket::SSL" : "0",
            "Net::Detect" : "0",
            "Test::More" : "0"
         }
      }
   },
   "release_status" : "stable",
   "version" : "0.2"
}

META.yml  view on Meta::CPAN

  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: Authen-Simple-Gmail
no_index:
  directory:
    - t
    - inc
requires:
  Authen::Simple::Adapter: 0
  File::Slurp: 0
  IO::Socket::SSL: 0
  Net::Detect: 0
  Test::More: 0
version: 0.2

Makefile.PL  view on Meta::CPAN

    NAME          => 'Authen::Simple::Gmail',
    AUTHOR        => 'Daniel Muey <http://drmuey.com/cpan_contact.pl>',
    VERSION_FROM  => 'lib/Authen/Simple/Gmail.pm',
    ABSTRACT_FROM => 'lib/Authen/Simple/Gmail.pm',
    PL_FILES      => {},
    PREREQ_PM     => {
        'Test::More'  => 0,
        'Net::Detect' => 0,
        'File::Slurp' => 0,

        'IO::Socket::SSL'         => 0,
        'Authen::Simple::Adapter' => 0,
    },
    dist  => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean => { FILES    => 'Authen-Simple-Gmail-*' },
);

lib/Authen/Simple/Gmail.pm  view on Meta::CPAN

package Authen::Simple::Gmail;

use strict;
use warnings;

$Authen::Simple::Gmail::VERSION = '0.2';

use IO::Socket::SSL         ();
use Authen::Simple::Adapter ();
use base 'Authen::Simple::Adapter';

my $portable_crlf = "\015\012";    # "\r\n" is not portable

sub check {
    my ( $self, $username, $password ) = @_;

    my $sock = IO::Socket::SSL->new(
        'PeerHost'        => "pop.gmail.com",
        'PeerPort'        => "995",
        'SSL_verify_mode' => IO::Socket::SSL::SSL_VERIFY_NONE,    # Patches welcome!
    );

    if ( !$sock ) {
        $self->log->error( IO::Socket::SSL->errstr() ) if $self->log;
        return;
    }

    my $line = <$sock>;                                           # welcome msg

    # d("init: $line");
    print {$sock} "USER $username$portable_crlf";
    $line = <$sock>;

    # d("user: $line");

lib/Authen/Simple/Gmail.pm  view on Meta::CPAN

=back

=head1 CONFIGURATION AND ENVIRONMENT
  
Authen::Simple::Gmail requires no configuration files or environment variables.

=head1 DEPENDENCIES

L<Authen::Simple::Adapter> for subclassing.

L<IO::Socket::SSL> for the SSL socket

=head1 INCOMPATIBILITIES

None reported.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to



( run in 0.521 second using v1.01-cache-2.11-cpan-4d50c553e7e )