Changeset 191

Show
Ignore:
Timestamp:
02/27/06 14:38:19
Author:
tokuhirom
Message:

Publish::Gmail with POP before SMTP

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/Gmail.pm

    r161 r191  
    4848        Data => encode("utf-8", $body), 
    4949    ); 
     50 
     51    # POP before SMTP 
     52    if ($cfg->{pop3}) { 
     53        require Net::POP3; 
     54        my $pop = Net::POP3->new($cfg->{pop3}->{host}); 
     55        if ($pop->login($cfg->{pop3}->{username}, $cfg->{pop3}->{password})) { 
     56            $context->log(info => 'POP3 login succeed'); 
     57        } else { 
     58            $context->log(info => 'POP3 login error'); 
     59        } 
     60        $pop->quit; 
     61    } 
    5062 
    5163    my $route = $cfg->{mailroute} || { via => 'smtp', host => 'localhost' };