in reply to Strange result using Mail::POP3Client
Webmail::vPOP3 is a superclass of Mail::POP3Client in this example which shows the error handling you need as pointed out by BrowserUK ie check $obj->Message for either OK or ERR...
sub open_pop3_connection { my $pop = new Webmail::vPOP3 ( mailroot => $USE_MAILROOT, pop3_init => { USER => $global{username}, PASSWORD => $global{password}, HOST => $POP_SERVER, AUTH_MODE => $POP_AUTH_MODE }, cwd => $global{cwd}, default_folders => { inbox => $INBOX, drafts => $DRAFTS, deleted => $DELETED, sent => $SENT, }, delim => $DELIM, debug => 0, folder_icons => "$IMAGE_LOCATION/folder_icons", Lplus => \&Webmail::Lplus, Lminus => \&Webmail::Lminus, Tplus => \&Webmail::Tplus, Tminus => \&Webmail::Tminus, folder_msg_text => \&Webmail::folder_msg_text, file_msg_text => \&Webmail::file_msg_text, ); unless($pop->Message =~ m/^\+OK/){ ($pop->Message =~ m/ERR(.*)/) ? show_login("$CONNECTION_FAILED: $1") : show_login("$CONNECTION_FAILED:" . $pop->Message); } # reset the session time after a vaild login $global{last_active} = time(); return $pop; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Strange result using Mail::POP3Client
by Anonymous Monk on Jun 25, 2003 at 11:17 UTC | |
by tachyon (Chancellor) on Jun 26, 2003 at 10:37 UTC |