Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Illegal seek using Net::IMAP::Simple.pm

Status
Not open for further replies.

gyan

IS-IT--Management
Jul 8, 2001
18
US
Hi,

I'm using this module to logon to IMAP Server and fetch mails.

When there is any mail, either SEEN or NEW, it works fine.

Once I delete those mails, and try to login again it gives me the following error:

------------------------------------
Can't login to mailserver.gp.com : Bad file number

------------------------------------


Using the following to logon:
-----------------------------

$server = Net::IMAP::Simple->new($mail_server);

$server->login( $userid, $passwd )
or die "Can't login to $mail_server : $! \n";


Thanks,

Gyan

 
Gyan,

Is it because you're trying to re-use the same object when you login again?

Have you tried:

undef($server);

and then

$server = Net::IMAP::Simple->new($mail_server);

$server->login( $userid, $passwd )
or die "Can't login to $mail_server : $! \n";
Mike
________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Hi Mike,

I do close the connection to the Server with the following:

# close the connection
$server->quit();

Here is the sequence:
---------------------

$server = Net::IMAP::Simple->new($mail_server);

$server->login( $userid, $passwd )
or die "Can't login to $mail_server : $! \n";

.....
.....

$server->quit();


Following is the truss output:
------------------------------
brk(0x00156030) = 0
ioctl(6, TCGETA, 0xFFBEEA94) Err#22 EINVAL
write(6, " 0 L O G I N g r p _".., 27) = 27
read(6, " 0 O K L O G I N c".., 8192) = 22
write(6, " 1 S E L E C T " I N".., 18) = 18
read(6, " * 0 E X I S T S\r\n".., 8192) = 286
Can't login to mailserver.gp.com : Bad file number
write(2, " C a n ' t l o g i n ".., 60) = 60
getcontext(0xFFBEEA30)
setcontext(0xFFBEEA30)
getcontext(0xFFBEE708)
getcontext(0xFFBEE5D8)
close(6) = 0
llseek(6, 0, SEEK_CUR) Err#9 EBADF
close(6) Err#9 EBADF
getcontext(0xFFBEE9C8)
getcontext(0xFFBEE898)
write(3, " T h e q u e u e d i".., 29) = 29
close(3) = 0
getcontext(0xFFBEE898)
getcontext(0xFFBEE898)
llseek(0, 0, SEEK_CUR) = 167106
_exit(9)



I commented out my rest of lines and used only the above three, still get the same error.


Thanks,

Gyan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top