Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked


by Corion (Pope)
on Feb 12, 2013 at 19:16 UTC ( #1018429=CUFP: print w/replies, xml ) Need Help??

Recently, I've signed up for some forums, just to read their posts. As I'm not interested in having my email address sold, I used to create disposable email addresses. As I'm also lazy and didn't want to visit, I wrote the following script which generates a random email address and polls that inbox on, printing all HTTP links found in every mail, in the assumption that one of them is the signup/verification link mailed.

Update: Mailinator is for Humans points out that they've cut the POP3 access and likely will cut all other "machine-only" access soon. So I won't bother porting this to consume the RSS feed. Sad that we can't have nice things.

#!perl -w use strict; use Net::POP3; use MIME::Parser; use URI; use App::scrape 'scrape'; use Getopt::Long; use Pod::Usage; GetOptions( 's|server:s' => \my $server, 'd|domain:s' => \my $domain, 'm|mailbox:s' => \my $mailbox, 't|sleep:s' => \my $delay, ) or pod2usage(1); $server||= ''; $domain||= ''; if( ! defined $delay) { $delay = 45; }; my @letters = ('a'..'z','0'..'9'); $mailbox ||= join '', map { $letters[ rand 0+@letters ] } 1..12; print "$mailbox\@$domain\n"; sleep $delay+rand(5); #while( 1 ) { poll(); #sleep 45+rand(5); #}; sub poll { my $connection= Net::POP3->new( $server ); if( $connection->login( $mailbox => 'xxxxxxxx' )> 0) { my $messages= $connection->list; for my $id (sort keys %$messages) { my $msg= $connection->get($id); my $mime= MIME::Parser->new(); my $raw= join '', @$msg; my $entity= $mime->parse_data( \$raw ); print $entity->head->get('subject'),"\n"; print $entity->head->get('from'),"\n"; (my $payload)= grep { $_->bodyhandle } ($entity, $entity-> +parts()); my $body= $payload->bodyhandle->as_string; if( 'text/html' eq $payload->effective_type ) { print "$_\n" for map { @$_ } scrape( $body, ['a@href'] +, { base => 'xxx' } ); } else { print "$_\n" for $body=~ m!(https?://[^\s]+)!g; }; }; }; $connection->quit; }; =head1 NAME anon-signup - poll a mailinator email address for HTTP links =cut

Replies are listed 'Best First'.
Re: Poll
by grondilu (Friar) on Mar 19, 2013 at 02:40 UTC

    Haven't tested it, but just from the description, I'd say it's pretty neat.

      Is it safe to assume that this code would be useful for a Mailinator Pro (any level) subscription?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1018429]
Approved by GrandFather
Front-paged by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-10-19 22:27 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (111 votes). Check out past polls.