« Hiding Google Ads in web sites that you visit | Main | Lack of layering in WS »

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!.
lock.png
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;
	}
    }
}

TrackBack

TrackBack URL for this entry:
http://blogs.cocoondev.org/MT/mt-tb.cgi/2194

Listed below are links to weblogs that reference How to lock yourself out of your gmail account:

» hoodia plant from hoodia plant
[Read More]

Comments

If that's really your username/password you just shot yourself in the other foot too!

Post a comment