#!/usr/bin/perl
$user = 'username'; # hotmail user name
$pass = 'password'; # hotmail password
$addr = 'fwdaddress@foo.com'; # forwarding address
$delay = 30; # delay (in seconds) between sending messages
$delete_messages = 0; # 0/1 => don't/do delete messages from th
+e hotmail account
require LWP::UserAgent;
require HTTP::Cookies;
# set up our super cool web browser
$ua = LWP::UserAgent->new;
push @{$ua->requests_redirectable}, 'POST';
$ua->cookie_jar(HTTP::Cookies->new({}));
$ua->agent("yellow rubber ducky");
# let's get some "hot" mail
$html = $ua->get('http://www.hotmail.com')->content;
# we don't need no stinkin' javascript
while( $html =~ s/<input type=hidden name="([^"]*)" value="([^"]*)">//
+ ){
$form{$1} = $2;
}
$html = $ua->post( 'http://login.passport.net/uilogin.srf?id=2', \%for
+m)->content;
# log on in
$html =~ /<form TARGET="_top" name="hotmail_com" action="([^"]*)"/;
$html = $ua->post( $1, ['login' => $user,
'passwd' => $pass,
'domain' => 'hotmail.com',
'sec' => '',
'mspp_shared' => '',
'padding' => substr( "xxxxxxxxxxxxxxxx",
+0, 16-length($pass))])->content;
# follow the magic meta
$html =~ /<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=([^"]*)"/;
$html = $ua->get($1)->content;
# we definetly don't need no stinking internet explorer
$html =~ /<form name="cont" action="([^"]*)"/;
$html = $ua->post( $1, ['curmbox' => 'F000000001',
'HrsTest' => ''])->content;
$base = $1;
$base =~ s/\/cgi-bin\/.*//;
# find out where we can get our free massages
$html =~ /_UM = "([^"]*)"/;
$UM = $1;
while( $html =~ s/<a href="javascript:G\('(\/cgi-bin\/getmsg?[^']*)'//
+ ){
if( $1 !~ /msgread/ ){
push @messes, $1;
}
}
# get the whole mess
foreach $mess(@messes){
$html = $ua->get($base.$mess."&".$UM)->content;
# junk it
if( $delete_messages ){
$html =~ /<a href="#" onclick="G\('([^']*)'.*>Delete<\/a>/;
$ua->get($base.$1."&".$UM);
}
# go straight to the source (set the options for advanced view)
$html =~ /<a href="([^"]*)" target="_blank">View E-mail Message So
+urce<\/a>/;
$html = $ua->get($1)->content;
$html =~ /<A HREF="([^"]*)">here<\/A>/;
$html = $ua->get($1)->content;
# clean up the mess
$html =~ s/<pre>\s*([\w\W]*)<\/pre>[\w\W]*/$1/;
$html =~ s/"/"/gi;
$html =~ s/</</gi;
$html =~ s/>/>/gi;
$html =~ s/&/&/gi;
$html =~ s/\n\.\n/\n .\n/g;
$html =~ s/(\s+)To:.*/$1To: $addr/;
open MAIL, "|/usr/sbin/sendmail -t";
print MAIL $html;
close MAIL;
sleep($delay);
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|