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
In reply to Re: Strange result using Mail::POP3Client
by tachyon
in thread Strange result using Mail::POP3Client
by Roust
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |