How to lock yourself out of your gmail account
Previously i complained about not being able to clean up the accumulated email in my trash folder. So i decided to try Mail::Webmail::GMail as there was a sample in the readme that shows how to clean up your spam folder. It was not too difficult to look at the code and make some changes to delete stuff from the trash, but apparently google does not want u to clean up the trash, so they locked me out of my gmail account and i have a forced hiatus from all my open source work for 24 hours. sigh!.
Here's the code if u want to shoot yourself in the foot :)
Here's the code if u want to shoot yourself in the foot :)
use Mail::Webmail::Gmail;
my ( $gmail ) = Mail::Webmail::Gmail->new(
username => 'davanum', password => 'XXXXXX', );
my $messages = $gmail->get_messages( label => $Mail::Webmail::Gmail::FOLDERS{ 'TRASH' } );
if ( @{ $messages } ) {
my $test = 0;
foreach ( @{ $messages } ) {
print "MSG: " . $_->{ 'id' } . " trying...\n";
#$gmail->delete_message( msgid => $_->{ 'id' }, search => 'spam', del_message => 1 );
$gmail->delete_message( msgid => $_->{ 'id' } );
if ( $gmail->error() ) {
print $gmail->error_msg();
} else {
print "MSG: " . $_->{ 'id' } . " deleted\n";
}
$test++;
if ( $test == 100 ) {
last;
}
}
}
Comments
If that's really your username/password you just shot yourself in the other foot too!
Posted by: Pólya | March 11, 2005 08:26 AM