develooper Front page | perl.beginners | Postings from January 2002

help with Net::POP3

Thread Next
From:
Cabezon Aurélien
Date:
January 9, 2002 06:24
Subject:
help with Net::POP3
Message ID:
00a801c19919$6e1f6d30$2a01a8c0@London
Hi list,

I'm playing around Net::POP3.
I wanna make a script that is able to check for pop3 mail and then save them
in a MySQL database (not implemented yet, usefull for mailing archiving)
I'm at the start of the script but i have a problem.

First i check for new mail : OK
Then i get  mail : OK
Then i get print mail : OK
Then i delete the mails : PROBLEM.

I can't delete them. Why ? an idea ?


Here is the code :

------<cut>-----
#!/usr/bin/perl

use Net::POP3;

# Variables
$hostname="www.isecurelabs.com";
$account="securiteam\@isecurelabs.com";
$password="eniac";
$timeout ="3600";

# pop3 connection
$handle = Net::POP3->new($hostname,Timeout => $timeout) or die "Connection
au serveur POP3 $hostname impossible.\n";

# Authentification
defined($handle->login($account, $password)) or die "Probléme
authentification ($account, $password) sur $hostname.\n";

# command list
$list=$handle->list();

#############work with each mail##############

foreach $item (keys %$list) {

# get mail
$message = $handle->get($item);

# print mail (waiting for coding database support)
@message = @$message;
print "\n@message\n";

# del mail
$handle->delete($item);
print "\nMail $item efface\n";

};

------<cut>-----



Thanks very much,
regards,

---
Cabezon Aurélien | aurelien.cabezon@isecurelabs.com
http://www.iSecureLabs.com | French Security Portal

____________________________________________
" Sachez qu'aujourd'hui est le plus beau jour de votre vie,
car c'est le premier de ceux qu'il vous reste à vivre "


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About