From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12749 Path: main.gmane.org!not-for-mail From: SL Baur Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus-ing your hotmail.. Date: 01 Nov 1997 19:51:45 -0800 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: multipart/mixed; boundary="Multipart_Sat_Nov__1_19:51:45_1997-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035152230 5455 80.91.224.250 (20 Oct 2002 22:17:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:17:10 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id VAA10278 for ; Sat, 1 Nov 1997 21:18:18 -0800 Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA27757 for ; Sat, 1 Nov 1997 23:19:27 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no (8.8.7/8.8.7/ifi0.2) with SMTP id EAA08847 for ; Sun, 2 Nov 1997 04:53:11 +0100 (MET) Original-Received: (qmail 4577 invoked by uid 504); 2 Nov 1997 03:53:10 -0000 Original-Received: (qmail 4574 invoked from network); 2 Nov 1997 03:53:10 -0000 Original-Received: from xemacs.miranova.com (HELO altair.xemacs.org) (steve@206.190.83.19) by claymore.vcinet.com with SMTP; 2 Nov 1997 03:53:09 -0000 Original-Received: (from steve@localhost) by altair.xemacs.org (8.8.8/8.8.8) id TAA05435; Sat, 1 Nov 1997 19:51:45 -0800 Mail-Copies-To: never Original-To: ding@gnus.org X-Face: (:YAD@JS'&Kz'M}n7eX7gEvPR6U1mJ-kt;asEc2qAv;h{Yw7ckz<7+X_SYeTNAaPui:e~x$ ,A=gkt*>UPL/}\a/#C~v2%ETiAY_sx;xve0yL??JWTtX_-NUzXyP38UdW#cmN1\4(X!c3m#%IbtB-3 Z-!xpZi!`E.s{(;aP=b11"!3wQu]1j@^V|;n=B|{l writes: > Now, I only miss the ability to post from gnus to hotmail! You might find the attached script useful ... --Multipart_Sat_Nov__1_19:51:45_1997-1 Content-Type: message/rfc822 X-From-Line: owner-cypherpunks@Algebra.COM Wed Aug 13 16:04:05 1997 Return-Path: Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.6/8.8.6) with ESMTP id QAA01572 for ; Wed, 13 Aug 1997 16:03:54 -0700 Received: from www.video-collage.com (www.video-collage.com [199.232.240.107]) by xemacs.org (8.8.5/8.8.5) with ESMTP id RAA02321 for ; Wed, 13 Aug 1997 17:59:29 -0500 (CDT) Received: (from ichudov@localhost) by www.video-collage.com (8.8.5/8.8.5) id SAA08489 for cypherpunks-outgoing; Wed, 13 Aug 1997 18:47:47 -0400 (EDT) Received: from sirius.infonex.com (sirius.infonex.com [206.170.114.2]) by www.video-collage.com (8.8.5/8.8.5) with ESMTP id SAA08477 for ; Wed, 13 Aug 1997 18:47:43 -0400 (EDT) Received: (from cpunks@localhost) by sirius.infonex.com (8.8.5/8.7.3) id PAA13987; Wed, 13 Aug 1997 15:47:35 -0700 (PDT) Received: from rigel.cyberpass.net (root@rigel.infonex.com [206.170.114.3]) by sirius.infonex.com (8.8.5/8.7.3) with ESMTP id PAA13982 for ; Wed, 13 Aug 1997 15:47:28 -0700 (PDT) Received: from abraham.cs.berkeley.edu (abraham.CS.Berkeley.EDU [128.32.37.121]) by rigel.cyberpass.net (8.8.5/8.7.3) with ESMTP id PAA23891 for ; Wed, 13 Aug 1997 15:45:05 -0700 (PDT) Received: (from news@localhost) by abraham.cs.berkeley.edu (8.8.6/8.8.6) id PAA30246; Wed, 13 Aug 1997 15:45:26 -0700 To: cypherpunks@cyberpass.net Path: not-for-mail From: iang@cs.berkeley.edu (Ian Goldberg) Newsgroups: isaac.lists.cypherpunks Subject: sendhotmail, version 1.3 Date: 13 Aug 1997 22:45:26 GMT Organization: ISAAC Group, UC Berkeley Distribution: isaac Message-ID: <5stde6$tdc$1@abraham.cs.berkeley.edu> References: <19970807192254.40.qmail@zipcon.net> <199708080936.KAA01816@server.test.net> <5sg43l$v7v$1@abraham.cs.berkeley.edu> <5sqrsc$c8k$1@abraham.cs.berkeley.edu> NNTP-Posting-Host: abraham.cs.berkeley.edu X-Newsreader: trn 4.0-test58 (13 May 97) Sender: owner-cypherpunks@Algebra.COM Precedence: bulk X-Mailing-List: cypherpunks@algebra.com X-List-Admin: ichudov@algebra.com X-Loop: cypherpunks@algebra.com Lines: 250 Xref: altair.xemacs.org cypherpunks:7679 And here's 1.3. It uses the same config file as 1.2. New: o fixes a bug involving + in email addresses o handles continuation headers properly o Can be used as a drop-in replacement for sendmail (though it may get confused if you pass weird sendmail options); it will keep trying random hotmail accounts and proxies until it succeeds in delivering the mail. Note that, depending on your connectivity, this can take a while... - Ian #!/usr/bin/perl -w ## ## sendhotmail: pipe an RFC822 mail message into this, and it will send it ## out from a hotmail account via an HTTP proxy ## ## Version 1.3: 19970813 ## ## Program by Ian Goldberg ## sub Usage { die "Usage: $0 -t | addr\@host ...\n"; } ## Check options $cmdlineto = ''; while ($#ARGV >= 0 && $ARGV[0] =~ /^-/o) { $_ = shift @ARGV; if ($_ eq "-t") { $cmdlineto = ''; } elsif ($_ eq "-f") { shift @ARGV; } else { ## Ignore option } } if ($#ARGV >= 0) { $cmdlineto = join(", ", @ARGV); } use LWP; $uadirect = new LWP::UserAgent; ## The filename of the configuration file $configfile = '/home/iang/sendhotmail/config'; ## Read the config file open(CONFIG, $configfile) or die "Cannot open $configfile: $!\n"; while() { next if /^\s*$/o; next if /^\s*\#/o; next unless /^([^:]+):\s*(.*)$/o; $value = $2; $name = "\L$1\E"; $name =~ s/[^a-z0-9]//iog; $config{$name} = $value; } close(CONFIG); sub escapetext { my $t = $_[0]; $t =~ s/([\000-\037\200-\377\{\}\|\\\^\[\]\`\"\<\>\:\@\/\;\?\=\&\%\.\#\+])/"%".unpack('H2',$1)/eg; $t =~ s/ /+/g; $t; } sub getaddrs { my @addrlist = split(/,\s*/, $_[0]); my ($a, $ra); my @r; foreach $a (@addrlist) { $ra = ''; if ($a =~ /\<(.*?)\>/) { $ra = $1; } else { $a =~ s/\(.*?\)//g; $a =~ s/\".*?\"//g; $ra = $1 if $a =~ /(\S+\@\S+)/; } push (@r, $ra) if $ra ne ''; } join(', ', @r); } ## Parse the incoming mail. We need to put the To, Cc, and Bcc headers ## into a simple format that hotmail can understand. $header{'to'} = ''; $header{'subject'} = ''; $header{'cc'} = ''; $header{'bcc'} = ''; $curheader = ''; while() { last if /^$/; chomp; if (/^\S/) { ## Start a new header if (s/^To:\s*//io) { $curheader = 'to'; $header{'to'} .= ', ' if $header{'to'} ne ''; } elsif (s/^Cc:\s*//io) { $curheader = 'cc'; $header{'cc'} .= ', ' if $header{'cc'} ne ''; } elsif (s/^Bcc:\s*//io) { $curheader = 'bcc'; $header{'bcc'} .= ', ' if $header{'bcc'} ne ''; } elsif (s/^Subject:\s*//io) { $curheader = 'subject'; } else { $curheader = ''; } } if ($curheader ne '') { s/^\s*//; $header{$curheader} .= ' ' if $header{$curheader} ne ''; $header{$curheader} .= $_; } } ## If we were given command-line addresses, that overrides the headers $header{'to'} = &getaddrs($cmdlineto eq '' ? $header{'to'} : $cmdlineto); $header{'cc'} = &getaddrs($cmdlineto eq '' ? $header{'cc'} : ''); $header{'bcc'} = &getaddrs($cmdlineto eq '' ? $header{'bcc'} : ''); $msg = &escapetext(join('', )); srand(time ^ $$); ## Keep trying until the message is successfully delivered RETRYLOOP: while (1) { ## Get the proxy list $proxylisturl = new URI::URL ($config{'proxylisturl'} || 'http://www.publius.net/~remailer/proxy_list.txt'); if (defined $config{'proxylistcachefile'}) { ## Check if the locally cached copy is new enough $maxage = $config{'proxylistcacheage'} || 1; if (! -e $config{'proxylistcachefile'} || -M $config{'proxylistcachefile'} > $maxage) { ## Fetch a new copy $request = new HTTP::Request('GET', $proxylisturl); $request->header(Pragma => 'no-cache'); $response = $uadirect->request($request); $body = $response->content; $newfname = $config{'proxylistcachefile'}.".new.$$"; open(CACHE, ">$newfname") or die "Cannot write $newfname: $!\n"; print CACHE $body; close(CACHE); rename($newfname, $config{'proxylistcachefile'}) or die "Cannot rename $newfname: $!\n"; } ## Read the proxy list open(CACHE, $config{'proxylistcachefile'}) or die "Cannot open $config{'proxylistcachefile'}: $!\n"; @proxylist = grep (s/\n// && /^[^#]/, ); close(CACHE); } else { ## Just fetch from the net $request = new HTTP::Request('GET', $proxylisturl); $request->header(Pragma => 'no-cache'); $response = $uadirect->request($request); @proxylist = grep (/^[^#]/, split("\n", $response->content)); } @proxylist = ('secure.escape.ca:80') if $#proxylist == -1; ## Get the account list if (defined $config{'accountlistfile'}) { open(ACC, $config{'accountlistfile'}) or die "Cannot open $config{'accountlistfile'}: $!\n"; @accountlist = grep (s/\n// && /^[^#]/, ); close(ACC); } @accountlist = ('ldeliverer:xxxx') if $#accountlist == -1; ## Choose a proxy and account at random $proxy = $proxylist[int rand ($#proxylist+1)]; ($login, $passwd) = $accountlist[int rand ($#accountlist+1)] =~ /^([^:]*):(.*)$/; #print STDERR "Trying $login through $proxy\n"; ## Begin hotmail-specific magic $ua = new LWP::UserAgent; $ua->proxy('http', "http://${proxy}/"); $url = new URI::URL 'http://www.hotmail.com/cgi-bin/password.cgi'; $request = new HTTP::Request('POST', $url); $request->header(Pragma => 'no-cache'); $request->content("login=${login}&curmbox=ACTIVE"); $response = $ua->request($request); $body = $response->content; $body =~ /\<\s*form\s+[^>]*action=\"(.*?)\"/io or next RETRYLOOP; $url = new URI::URL $1, $url; $body = $'; $body =~ s/\<\s*\/form\s*\>.*//; $body =~ /\<\s*input\s+[^>]*name=\"disk\"\s+value(=\"(.*?)\")?/io or next RETRYLOOP; $disk = $2 || ""; $request = new HTTP::Request('POST', $url); $request->header(Pragma => 'no-cache'); $request->content("passwd=${passwd}&frames=no&disk=${disk}&curmbox=ACTIVE&login=${login}&js=no"); $response = $ua->request($request); $body = $response->content; $body =~ /\<\s*area\s+[^>]*href=\"(\/cgi-bin\/compose.*?)\"/io or next RETRYLOOP; $composeurl = new URI::URL $1, $url; $body =~ /\<\s*area\s+[^>]*href=\"(\/cgi-bin\/logout.*?)\"/io or next RETRYLOOP; $logouturl = new URI::URL $1, $url; $request = new HTTP::Request('GET', $composeurl); $request->header(Pragma => 'no-cache'); $response = $ua->request($request); $body = $response->content; $body =~ /\<\s*form\s+[^>]*action=\"(.*?)\".*?\>/io or next RETRYLOOP; $url = new URI::URL $1, $composeurl; $body = $'; $data = ''; while(1) { $body =~ /^\s*\<\s*input\s+type=\"?hidden\"?\s+name=\"(.*?)\"\s+value(=\"(.*?)\")?\s*\>/io or last; $name = $1; $value = $3 || ""; $body = $'; $data .= $name."=".$value."&"; } $data .= "to=$header{'to'}&subject=$header{'subject'}&cc=$header{'cc'}&bcc=$header{'bcc'}&body=${msg}&Send.x=1&Send.y=1"; $request = new HTTP::Request('POST', $url); $request->header(Pragma => 'no-cache'); $request->content($data); $response = $ua->request($request); $body = $response->content; $body =~ /\<\s*title\s*\>\s*Hotmail\s*-\s*Mailbox/io or next RETRYLOOP; $request = new HTTP::Request('GET', $logouturl); $request->header(Pragma => 'no-cache'); $response = $ua->request($request); last RETRYLOOP; ## Success } --Multipart_Sat_Nov__1_19:51:45_1997-1--