Changeset 236
- Timestamp:
- 03/02/06 13:51:32
- Files:
-
- trunk/plagger/lib/Plagger/Plugin/Publish/Gmail.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Publish/Gmail.pm
r191 r236 13 13 our %TLSConn; 14 14 15 sub rule_hook { 'publish.feed' } 16 15 17 sub register { 16 18 my($self, $context) = @_; 17 19 $context->register_hook( 18 20 $self, 21 'publish.init' => \&initialize, 19 22 'publish.feed' => \¬ify, 20 23 ); 24 } 25 26 sub initialize { 27 my($self,$context) = @_; 28 29 # authenticatE POP before SMTP 30 if (my $conf = $self->conf->{pop3}) { 31 require Net::POP3; 32 my $pop = Net::POP3->new($conf->{host}); 33 if ($pop->login($conf->{username}, $conf->{password})) { 34 $context->log(info => 'POP3 login succeed'); 35 } else { 36 $context->log(error => 'POP3 login error'); 37 } 38 $pop->quit; 39 } 21 40 } 22 41 … … 48 67 Data => encode("utf-8", $body), 49 68 ); 50 51 # POP before SMTP52 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 }62 69 63 70 my $route = $cfg->{mailroute} || { via => 'smtp', host => 'localhost' };
