GetLive Update

2009-03-06 Thread Mike Erdely
Hotmail keeps making changes.

This diff (from GetLive CVS) allows p5-GetLive to work again.
Note, you have to update Mode=200902 in your configuration file.
You also have to clear out the Hi, Jerk, We've made changes.  Click
here not to see this stupid message again. message.

ok?

-ME

Index: Makefile
===
RCS file: /cvs/ports/mail/p5-GetLive/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile10 Nov 2008 20:23:50 -  1.5
+++ Makefile7 Mar 2009 05:19:52 -
@@ -3,7 +3,7 @@
 COMMENT=   automatically fetch hotmail.com email
 
 DISTNAME=  GetLive_0_57
-PKGNAME=   p5-GetLive-0.57p0
+PKGNAME=   p5-GetLive-0.57p1
 CATEGORIES=mail perl5
 EXTRACT_SUFX=  .tgz
 
Index: patches/patch-GetLive_pl
===
RCS file: /cvs/ports/mail/p5-GetLive/patches/patch-GetLive_pl,v
retrieving revision 1.4
diff -u -p -r1.4 patch-GetLive_pl
--- patches/patch-GetLive_pl11 Nov 2008 22:03:59 -  1.4
+++ patches/patch-GetLive_pl7 Mar 2009 05:19:52 -
@@ -1,6 +1,8 @@
+Diff from GetLive CVS to incorporate Hotmail site changes.
+
 $OpenBSD: patch-GetLive_pl,v 1.4 2008/11/11 22:03:59 merdely Exp $
 GetLive.pl.origMon Nov 10 14:39:12 2008
-+++ GetLive.pl Mon Nov 10 14:41:25 2008
+--- GetLive.pl.origSat Jul  5 16:27:36 2008
 GetLive.pl Fri Mar  6 23:56:19 2009
 @@ -65,11 +65,12 @@ my $Password= ;
  my $Domain  = 'hotmail.com';
  my $CurlCommand = 'curl -k';
@@ -57,8 +59,8 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
  Display(Delete must be 'No' when MoveToFolder is also specified in the 
configuration file.\n,stderr=1);
  DisplayUsageAndExit(); 
}
-+  if ($Mode !~ m/^(200809|200810)$/i) {
-+Display(Mode must be oneof 200809 or 200810 as argument in the 
configuration file.\n,stderr=1);
++  if ($Mode !~ m/^(200809|200810|200902)$/i) {
++Display(Mode must be oneof 200809,200810,200902 as argument in the 
configuration file.\n,stderr=1);
 +DisplayUsageAndExit(); 
 +  }
  }
@@ -73,7 +75,38 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
  
# We expect here a number of functions now (aug 2007) to be hidden in a 
javascript
# that is loaded separately. Let's load and append.
-@@ -960,7 +973,7 @@ sub GetMessagesFromFolder($) {
+@@ -690,7 +703,9 @@ REENTRY_DARREN_QUIRK:
+ 
+   Display(LoginUrl 2 : '$LoginUrl'.\n,MinVerbosity = 10);
+   # Following the redirect : Third step of login.
+-  Display(Following redirect.\n,MinVerbosity = 2);
++  Display(Following redirect.\n,MinVerbosity = 2);
++
++LABEL_20090214:
+   ($LoginPageAsString,$GetPageUrl) = GetPage(Url = $LoginUrl,FollowForward 
= 1);
+ 
+   $LoginUrl = $GetPageUrl;
+@@ -716,6 +731,19 @@ REENTRY_DARREN_QUIRK:
+   } elsif ($LoginPageAsString =~ m/MSNPlatform\/browsercompat.js/) {
+ $LoggedIn = 1;
+   }
++
++  # Since 14/2/2009 we are not logged in anymore now ...
++
++  my $Tried20090214 = 0;
++  if (!$LoggedIn  !$Tried20090214) {
++if ($LoginPageAsString !~ m/src=\([^\]*)\/) {
++  die Could not log in. Maybe structure has changed or was not 
foreseen.;
++}
++$LoginUrl = HtmlUnescape($1);
++Display(Following link '$LoginUrl'.\n,MinVerbosity=2);
++$Tried20090214 = 1;
++goto LABEL_20090214
++  }
+  
+   die Could not log in. Maybe structure has changes or was not foreseen. 
unless $LoggedIn;
+ 
+@@ -960,7 +988,7 @@ sub GetMessagesFromFolder($) {
  au=$AuthUser.
  ptid=0;
my $PostData = ;
@@ -82,7 +115,7 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
  $PostData = cn=Microsoft.Msn.Hotmail.Ui.Fpp.MailBox.
  .
  mn=GetInboxData.
-@@ -971,7 +984,7 @@ sub GetMessagesFromFolder($) {
+@@ -971,7 +999,7 @@ sub GetMessagesFromFolder($) {
  v=1.
  .
  mt=$MT;
@@ -91,7 +124,7 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
  $PostData = cn=Microsoft.Msn.Hotmail.Ui.Fpp.MailBox.
  .
  mn=GetInboxData.
-@@ -979,11 +992,37 @@ sub GetMessagesFromFolder($) {
+@@ -979,11 +1007,37 @@ sub GetMessagesFromFolder($) {
  
d=true,true,{.uri_escape(\$FolderId\).,25,NextPage,0,Date,false,.
uri_escape(\$pnAm\) . , .
uri_escape(\$pnAd\) . , .
@@ -101,7 +134,7 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
  v=1.
  .
  mt=$MT;
-+  } elsif ($Mode =~ m/200810/  $Page == 1) {
++  } elsif ($Mode =~ m/(200810|200902)/  $Page == 1) {
 +$PostData = cn=Microsoft.Msn.Hotmail.Ui.Fpp.MailBox.
 +.
 +mn=GetInboxData.
@@ -114,7 +147,7 @@ $OpenBSD: patch-GetLive_pl,v 1.4 2008/11
 +  v=1.
 +  .
 +  

p5-GetLive update

2008-11-10 Thread Mike Erdely
The current GetLive release does not work with Hotmail any more.  The
code in the GetLive CVS repository has been updated, but a new version
has not been released.

Below is a diff that incorporates the changes in the
patches/patch-GetLive.pl file and adds instructions to the MESSAGE file
to be able to get GetLive working again.

Tested on i386.

ok?

-ME

Index: Makefile
===
RCS file: /cvs/ports/mail/p5-GetLive/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile10 Jul 2008 14:37:31 -  1.4
+++ Makefile10 Nov 2008 19:42:59 -
@@ -3,7 +3,7 @@
 COMMENT=   automatically fetch hotmail.com email
 
 DISTNAME=  GetLive_0_57
-PKGNAME=   p5-GetLive-0.57
+PKGNAME=   p5-GetLive-0.57p0
 CATEGORIES=mail perl5
 EXTRACT_SUFX=  .tgz
 
Index: patches/patch-GetLive_pl
===
RCS file: /cvs/ports/mail/p5-GetLive/patches/patch-GetLive_pl,v
retrieving revision 1.2
diff -u -p -r1.2 patch-GetLive_pl
--- patches/patch-GetLive_pl10 Jul 2008 14:37:31 -  1.2
+++ patches/patch-GetLive_pl10 Nov 2008 19:42:23 -
@@ -1,7 +1,7 @@
 $OpenBSD: patch-GetLive_pl,v 1.2 2008/07/10 14:37:31 merdely Exp $
 GetLive.pl.origSat Sep  8 14:23:33 2007
-+++ GetLive.pl Wed Oct 10 07:59:06 2007
-@@ -53,7 +53,7 @@ my $Password= ;
+--- GetLive.pl.origMon Nov 10 14:39:12 2008
 GetLive.pl Mon Nov 10 14:41:25 2008
+@@ -65,11 +65,12 @@ my $Password= ;
  my $Domain  = 'hotmail.com';
  my $CurlCommand = 'curl -k';
  my $Verbosity   = 1;  
  # 0:Silent; 1:Normal; 2:Verbose; 10:debug; 100:heavy 
debug 
@@ -10,3 +10,274 @@ $OpenBSD: patch-GetLive_pl,v 1.2 2008/07
  my $DownloadedIdsFile   = ;   # Local file with Ids of 
already downloaded messages.
  my $RetryLimit  = 2;
  my $MarkRead= No; # No,Yes : But never when 
downloaded before !
+ my $Delete  = No; # No,Yes : But never when 
downloaded before !
++my $SkipTrash   = No; # No,Yes : Do not handle 
the Trash folder
+ my $FetchOnlyUnread = No; # If Yes, only messages 
marked unread are downloaded.
+ # Unlike gotmail, this is 
completely orthogonal to the
+ # DownloadedIdsFile, i.e. 
it is the one or the other.
+@@ -78,6 +79,8 @@ my $MoveToFolder= ;   # 
+ # contains the folder to 
move to. This is a hook for 
+ # autoclassifying the 
mail on the server, including spam filtering.
+ 
++my $Mode= 200809;
++
+ # Quirk. MS generates unended pre tags. Hope this is a temporary weakness 
in their mind.
+ # (Hope makes living, we say in Dutch ...)
+ # If we want to allow it set this to one. Currently as of 8/9/2007 it must be 
accepted or the
+@@ -275,7 +278,7 @@ sub ParseConfig {
+ } elsif ($Option =~ m/^Password$/i) {
+   $Password = $OptionValue;
+ } elsif ($Option =~ m/^Mode$/i) {
+-  warn \n'Mode = ...' in the config file is ignored.\nThis version works 
only for 'Live' mailboxes !\n; 
++  $Mode = $OptionValue;
+ } elsif ($Option =~ m/^Domain$/i) {
+   $Domain = $OptionValue;
+ } elsif ($Option =~ m/^Proxy$/i) {
+@@ -298,6 +301,8 @@ sub ParseConfig {
+   $MarkRead = $OptionValue;
+ } elsif ($Option =~ m/^Delete$/i) {
+   $Delete = $OptionValue;
++} elsif ($Option =~ m/^SkipTrash$/i) {
++  $SkipTrash = $OptionValue;
+ } elsif ($Option =~ m/^MoveToFolder$/i) {
+   $MoveToFolder = $OptionValue;
+ } else {
+@@ -332,6 +337,10 @@ sub ParseConfig {
+ Display(MarkRead should take No or Yes as argument in the configuration 
file.\n,stderr=1);
+ DisplayUsageAndExit(); 
+   }
++  if ($SkipTrash !~ m/^(No|Yes)$/i) {
++Display(SkipTrash should take No or Yes as argument in the configuration 
file.\n,stderr=1);
++DisplayUsageAndExit(); 
++  }
+   if ($Delete !~ m/^(No|Yes)$/i) {
+ Display(Delete should take No or Yes as argument in the configuration 
file.\n,stderr=1);
+ DisplayUsageAndExit(); 
+@@ -340,6 +349,10 @@ sub ParseConfig {
+ Display(Delete must be 'No' when MoveToFolder is also specified in the 
configuration file.\n,stderr=1);
+ DisplayUsageAndExit(); 
+   }
++  if ($Mode !~ m/^(200809|200810)$/i) {
++Display(Mode must be oneof 200809 or 200810 as argument in the 
configuration file.\n,stderr=1);
++DisplayUsageAndExit(); 
++  }
+ }
+ 
+ 

+@@ -535,7