pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/freepops Hotmail's site has changed; update Hotma...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dbaadcaefadd
branches:  trunk
changeset: 533828:dbaadcaefadd
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Tue Oct 02 14:12:35 2007 +0000

description:
Hotmail's site has changed; update Hotmail module to get things
working again, and bump PKGREVISION. From the changelog:

- Fix a slew of issues related to changes made by Hotmail and bugs
    that finally became issues. Added the "AllowUnsafe" parameter.
- Merged in user submitted change and fixed a bug that was causing
    issues with properly ending messages.
- Added the domain parameter for those with a hosted hotmail domain
    and fixed the infinite loop issue with live light.

XXX FreePOPs has a self-updater for situations like this, but it's
XXX nontrivial to package.

diffstat:

 mail/freepops/Makefile          |     6 +-
 mail/freepops/files/hotmail.lua |  2002 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 2007 insertions(+), 1 deletions(-)

diffs (truncated from 2029 to 300 lines):

diff -r 1449b03e3f95 -r dbaadcaefadd mail/freepops/Makefile
--- a/mail/freepops/Makefile    Tue Oct 02 07:47:11 2007 +0000
+++ b/mail/freepops/Makefile    Tue Oct 02 14:12:35 2007 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2007/07/04 20:54:43 jlam Exp $
+# $NetBSD: Makefile,v 1.7 2007/10/02 14:12:35 schmonz Exp $
 #
 
 DISTNAME=              freepops-0.2.5
+PKGREVISION=           1
 CATEGORIES=            mail
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=freepops/}
 
@@ -50,6 +51,9 @@
 PKG_GROUPS_VARS+=              FREEPOPSD_GROUP
 PKG_USERS_VARS+=               FREEPOPSD_USER
 
+post-extract:
+       cp ${FILESDIR}/hotmail.lua ${WRKSRC}/src/lua/hotmail.lua
+
 .include "../../security/openssl/buildlink3.mk"
 .include "../../textproc/expat/buildlink3.mk"
 .include "../../www/curl/buildlink3.mk"
diff -r 1449b03e3f95 -r dbaadcaefadd mail/freepops/files/hotmail.lua
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/freepops/files/hotmail.lua   Tue Oct 02 14:12:35 2007 +0000
@@ -0,0 +1,2002 @@
+-- ************************************************************************** --
+--  FreePOPs @hotmail.com webmail interface
+--  
+--  Released under the GNU/GPL license
+--  Written by Russell Schwager <russell822%yahoo.com@localhost>
+--  Patched by cdmackie (2007-09-11). 
+--    Fixed: lite login, live delete, corrupt messages, stuck at 1st message, classic delete more than 1 message
+-- ************************************************************************** --
+
+-- Globals
+--
+PLUGIN_VERSION = "0.1.84"
+PLUGIN_NAME = "hotmail.com"
+PLUGIN_REQUIRE_VERSION = "0.2.0"
+PLUGIN_LICENSE = "GNU/GPL"
+PLUGIN_URL = "http://www.freepops.org/download.php?module=hotmail.lua";
+PLUGIN_HOMEPAGE = "http://www.freepops.org/";
+PLUGIN_AUTHORS_NAMES = {"Russell Schwager", "D. Milne", "Peter Collingbourne" }
+PLUGIN_AUTHORS_CONTACTS = {"russell822 (at) yahoo (.) com", "drmilne (at) safe-mail (.) net", "pcc03 (at) doc (.) ic (.) ac (.) uk>"}
+PLUGIN_DOMAINS = { "@hotmail.com","@msn.com","@webtv.com",
+      "@charter.com", "@compaq.net","@passport.com", 
+      "@hotmail.de", "@hotmail.it", "@hotmail.co.uk", 
+      "@hotmail.co.jp", "@hotmail.fr", "@messengeruser.com",
+      "@hotmail.com.ar", "@hotmail.co.th", "@hotmail.com.tr"  
+      }
+PLUGIN_PARAMETERS = {
+       {name="folder", description={
+               it=[[La cartella che vuoi ispezionare. Quella di default &egrave; Inbox.]],
+               en=[[The folder you want to interact with. Default is Inbox.]]}
+       },
+       {name = "emptyjunk", description = {
+               en = [[
+Parameter is used to force the plugin to empty the junk folder when it is done
+pulling messages.  Set the value to 1.]]
+               }       
+       },
+       {name = "emptytrash", description = {
+               it = [[ Viene usato per forzare il plugin a svuotare il cestino quando ha finito di scaricare i messaggi. Se il valore &egrave; 1 questo comportamento viene attivato.]],
+               en = [[
+Parameter is used to force the plugin to empty the trash when it is done
+pulling messages.  Set the value to 1.]]
+               }       
+       },
+       {name = "markunread", description = {
+               it = [[ Viene usato per far s&igrave; che il plugin segni come non letti i messaggi che scarica. Se il valore &egrave; 1 questo comportamento viene attivato.]],
+               en = [[ Parameter is used to have the plugin mark all messages that it
+pulls as unread.  If the value is 1, the behavior is turned on.]]
+               }
+       },
+       {name = "maxmsgs", description = {
+               en = [[
+Parameter is used to force the plugin to only download a maximum number of messages. ]]
+               }       
+       },
+       {name = "domain", description = {
+               en = [[
+Parameter is used to override the domain in the email address.  This is used so that users don't
+need to add a mapping to config.lua for a hosted hotmail account. ]]
+               }       
+       },
+}
+PLUGIN_DESCRIPTIONS = {
+       it=[[
+Questo plugin vi permette di scaricare la posta da mailbox con dominio della famiglia di @hotmail.com. 
+Per usare questo plugin dovrete usare il vostro indirizzo email completo come 
+nome utente e la vostra vera password come password.]],
+       en=[[
+This plugin lets you download mail from @hotmail.com and similar mailboxes. 
+To use this plugin you have to use your full email address as the username
+and your real password as the password.  For support, please post a question to
+the forum instead of emailing the author(s).]]
+}
+
+-- Domains supported:  hotmail.com, msn.com, webtv.com, charter.com, compaq.net,
+--                     passport.com
+
+-- ************************************************************************** --
+--  Global Strings
+-- ************************************************************************** --
+
+local globals = {
+  -- Max password length in the login page
+  --
+  nMaxPasswordLen = 16,
+
+  -- Server URL
+  --
+  strLoginUrl = "http://mail.live.com/";,
+
+  strDefaultLoginPostUrl = "https://login.live.com/ppsecure/post.srf";,
+
+  -- Login strings
+  -- TODO: Define the HTTPS version
+  --
+  strLoginPostData = "login=%s&domain=%s&passwd=%s&sec=&mspp_shared=&PwdPad=%s&PPSX=Pas&LoginOptions=3",
+  strLoginPaddingFull = "xxxxxxxxxxxxxxxx",
+  strLoginFailed = "Login Failed - Invalid User name and/or password",
+
+  -- Expressions to pull out of returned HTML from Hotmail corresponding to a problem
+  --
+  strRetLoginBadLogin = "(memberservices)",
+  strRetLoginSessionExpired = "(Sign in)",
+  strRetLoginSessionExpiredLive = '(HM%.FppError)',
+  strRetStatBusy = "(form name=.hotmail.)",
+  
+  -- Regular expression to extract the mail server
+  --
+  
+  -- Extract the server to post the login data to
+  --
+  strLoginPostUrlPattern1='action="([^"]+)"',
+  strLoginPostUrlPattern2='type=["]?hidden["]? name="([^"]*)".* value="([^"]*)"',
+  strLoginPostUrlPattern3='g_DO."%s".="([^"]+)"',
+  strLoginPostUrlPattern4='var g_QS="([^"]+)";',
+  strLoginPostUrlPattern5='name="PPFT" id="[^"]+" value="([^"]+)"',
+  strLoginDoneReloadToHMHome1='URL=([^"]+)"',
+  strLoginDoneReloadToHMHome2='%.location%.replace%("([^"]+)"',
+  strLoginDoneReloadToHMHome3="location='([^']+)'",
+--  strLoginDoneReloadToHMHome3='location=.([^"%']+)',
+  strLoginDoneReloadToHMHome4="img src='([^']+)'",
+  strLoginDoneReloadToReloadPage='window%.location=\'([^\']+)\'',
+ 
+  -- Pattern to detect if we are using the live or classic version
+  --
+  strLiveCheckPattern = '(TodayLight%.aspx)',
+  strClassicCheckPattern = '(Windows Live Mail was not able to sign into your account at this time)',
+  strLiveMainPagePattern = '<frame.-name="main" src="([^"]+)"',
+  strLiveLightPagePattern = 'href="(StylesheetTodayLight)',
+
+  -- Get the crumb value that is needed for every command
+  --
+  strRegExpCrumb = '&a=([^"&]*)[&"]',
+  strRegExpCrumbLive = '"sessionidhash" : "([^"]+)"',                    
+  strRegExpUser = '"authuser" : "([^"]+)"',
+
+  -- MSN Inbox Folder Id
+  --
+  strPatMSNInboxId = "HMFO%('(%d+)'%)[^>]+><img src=.http://[^/]+/i.p.folder.inbox.gif";,
+
+  -- Image server pattern
+  --
+  strImgServerPattern = 'img src="(http://[^/]*)/spacer.gif"',
+  strImgServerLivePattern = 'img src="(http://[^/]*)/mail/',
+
+  -- Junk and Trash Folder pattern
+  -- 
+  strPatLiveTrashId = '"sysfldrtrash".-"([^"]+)"',
+  strPatLiveJunkId = '"sysfldrjunk".-"([^"]+)"',
+
+  -- Folder id pattern
+  --
+  strFolderPattern = '<a href="[^"]+curmbox=([^&]+)&[^"]+" >', 
+  strFolderLivePattern = '%("([^"]+)","',
+  strFolderLiveInboxPattern = 'sysfldrinbox".-"([^"]+)"',
+  strFolderLiveLightInboxPattern = 'href="InboxLight%.aspx%?(FolderID=[^&]+[^"]+)"[^>]+><img src=".-i_inbox.gif"',
+  strFolderLiveLightFolderIdPattern = 'FolderID=([^&]+)&[.]*',
+  strFolderLiveLightNPattern = '&n=([^&]+)[.]*',
+  
+  strFolderLiveLightTrashPattern = 'i_trash%.gif" border="0" alt=""/></td>.-<td class="dManageFoldersFolderNameCol"><a href="InboxLight%.aspx%?FolderID=([^&]+)&',
+  strFolderLiveLightJunkPattern = 'i_junkfolder%.gif" border="0" alt=""/></td>.-<td class="dManageFoldersFolderNameCol"><a href="InboxLight%.aspx%?FolderID=([^&]+)&',
+  strFolderLiveLightPattern = 'href="InboxLight%.aspx%?FolderID=([^&]+)&n=[^"]+" title="',  
+  strFolderLiveLightManageFoldersPattern = 'href="ManageFoldersLight%.aspx%?n=([^"]+)"',
+
+  -- Pattern to determine if we have no messages
+  --
+  strMsgListNoMsgPat = "(<td colspan=10>)", --"(There are no messages in this folder)",
+
+  -- Pattern to determine the total number of messages
+  --
+  strMsgListCntPattern = "<td width=100. align=center>([^<]+)</td><td align=right nowrap>",
+  strMsgListCntPattern2 = "([%d]+) [MmNnBbVv][eai]",
+  strMsgListLiveLightCntPattern = '<div class="dItemListHeaderMsgInfo">.- (%d+)</div>',
+
+  -- Used by Stat to pull out the message ID and the size
+  --
+  strMsgLineLitPattern = 
".*<tr>.*<td>[.*]{img}.*</td>.*<td>.*<img>.*</td>.*<td>[.*]{img}.*</td>.*<td>.*<input>.*</td>.*<td>.*</td>.*<td>.*<a>.*</a>.*</td>.*<td>.*</td>.*<td>.*</td>.*<td>.*</td>.*</tr>",
+  strMsgLineAbsPattern = "O<O>O<O>[O]{O}O<O>O<O>O<O>O<O>O<O>[O]{O}O<O>O<O>O<X>O<O>O<O>O<O>O<O>O<O>O<O>O<O>O<O>O<O>O<O>O<O>O<O>X<O>O<O>",
+
+
+  -- Pattern used by Stat to get the next page in the list of messages
+  --
+  strMsgListNextPagePattern = '(nextpg%.gif" border=0></a>)',
+  strMsgListNextPagePatLiveLight = '<a href="([^"]+)"[^>]*><img src="[^_]*_nextpage.gif"',
+
+  -- Pattern used to detect a bad STAT page.
+  --
+  strMsgListGoodBody = 'i%.p%.attach%.gif',
+
+  -- Pattern used in the Live interface to get the message info
+  --
+  strMsgLivePatternOld = ',"([^"]+)","[^"]+","[^"]+",[^,]+,[^,]+,[^,]+,[^,]+,"([^"]+)"',
+  strMsgLivePattern1 = 'class=.-SizeCell.->([^<]+)</div>',
+  strMsgLivePattern2 = 'new HM%.__[^%(]+%("([^"]+)",[tf][^,"]+,"[^"]+",[^,]+,[^,]+',
+  strMsgLiveLightPattern = 'ReadMessageId=([^&]+)&[^>]+>.-</a></td>.-<td [^>]+>.-</td>.-<td [^>]+>([^<]+)</td>',
+
+  -- The amount of time that the session should time out at.
+  -- This is expressed in seconds
+  --
+  nSessionTimeout = 28800,  -- 8 hours!
+
+  -- Defined Mailbox names - These define the names to use in the URL for the mailboxes
+  --
+  strNewFolderPattern = "(curmbox=0)",
+  strFolderPrefix = "00000000-0000-0000-0000-000",
+  strInbox = "F000000001",
+
+  -- Command URLS
+  --
+  strCmdBaseLive = "http://%s/mail/";,
+  strCmdBrowserIgnoreLive = "http://%s/mail/mail.aspx?skipbrowsercheck=true";,
+  strCmdMsgList = "http://%s/cgi-bin/HoTMaiL?a=%s&curmbox=%s";,
+  strCmdMsgListNextPage = "&page=%d&wo=",
+  strCmdMsgListLiveLight = "http://%s/mail/InboxLight.aspx?FolderID=%s";,
+  strCmdMsgListLive = "http://%s/mail/mail.fpp?cnmn=Microsoft.Msn.Hotmail.MailBox.GetFolderData&ptid=0&a=%s&au=%s";, 
+  strCmdMsgListPostLiveOld = "cn=Microsoft.Msn.Hotmail.MailBox&mn=GetFolderData&d=%s,Date,%s,false,0,%s,0,,&MailToken=",
+  strCmdMsgListPostLive = 'cn=Microsoft.Msn.Hotmail.MailBox&mn=GetFolderData&d=%s,Date,%s,false,0,%s,0,"","",true,false&v=1&mt=%s',
+
+  strCmdDelete = "http://%s/cgi-bin/HoTMaiL";,
+  strCmdDeletePost = "curmbox=%s&_HMaction=delete&wo=&SMMF=0", -- &<MSGID>=on
+  strCmdDeleteLive = "http://%s/mail/mail.fpp?cnmn=Microsoft.Msn.Hotmail.MailBox.MoveMessages&ptid=0&a=%s&au=%s";, 
+  strCmdDeletePostLiveOld = 
'cn=Microsoft.Msn.Hotmail.MailBox&mn=MoveMessages&d="%s","%s",[%s],[{"%%5C%%7C%%5C%%7C%%5C%%7C0%%5C%%7C%%5C%%7C%%5C%%7C00000000-0000-0000-0000-000000000001%%5C%%7C632901424233870000",{2,"00000000-0000-0000-0000-000000000000",0}}],null,null,0,false,Date&v=1',
+  -- strCmdDeletePostLive = 
'cn=Microsoft.Msn.Hotmail.MailBox&mn=MoveMessages&d="%s","%s",[%s],[{"%%5C%%7C%%5C%%7C%%5C%%7C0%%5C%%7C%%5C%%7C%%5C%%7C%%5C%%7C00000000-0000-0000-0000-000000000001%%5C%%7C632750213035330000",null}],null,null,0,false,Date,false,true&v=1&mt=%s',
+  strCmdDeletePostLive = 
'cn=Microsoft.Msn.Hotmail.MailBox&mn=MoveMessages&d="%s","%s",[%s],[{"0%%5C%%7C0%%5C%%7C8C9BDFF65883200%%5C%%7C00000000-0000-0000-0000-000000000001",null}],null,null,0,false,Date,false,true&v=1&mt=%s',
+  strCmdDeleteLiveLight = "http://%s/mail/InboxLight.aspx?FolderID=%s&";,
+  strCmdDeletePostLiveLight = "__VIEWSTATE=&mt=%s&MoveMessageSelector=%s&ToolbarActionItem=MoveMessageSelector&", -- SelectedMessages=%s",
+  strCmdMsgView = "http://%s/cgi-bin/getmsg?msg=%s&imgsafe=y&curmbox=%s&a=%s";,
+  strCmdMsgViewRaw = "&raw=0",
+  strCmdMsgViewLive = "http://%s/mail/GetMessageSource.aspx?msgid=%s&gs=true";,
+  strCmdEmptyTrash = "http://%s/cgi-bin/dofolders?_HMaction=DoEmpty&curmbox=F000000004&a=%s&i=F000000004";,
+  strCmdLogout = "http://%s/cgi-bin/logout";,
+  strCmdLogoutLive = "http://%s/mail/logout.aspx";,
+  strCmdFolders = "http://%s/cgi-bin/folders?&curmbox=F000000001&a=%s";,
+  strCmdFoldersLiveLight = "http://%s/mail/ManageFoldersLight.aspx?n=%s";,
+  strCmdMsgUnreadLive = "http://%s/mail/mail.fpp?cnmn=Microsoft.Msn.Hotmail.MailBox.MarkMessages&ptid=0&a=";, 
+  strCmdMsgUnreadLivePost = "cn=Microsoft.Msn.Hotmail.MailBox&mn=MarkMessages&d=false,[%s]",
+  strCmdEmptyTrashLive = "http://%s/mail/mail.fpp?cnmn=Microsoft.Msn.Hotmail.MailBox.EmptyFolder&ptid=0&a=&au=%s";, 
+  strCmdEmptyTrashLivePost = "cn=Microsoft.Msn.Hotmail.MailBox&mn=EmptyFolder&d=%s,0",
+  strCmdEmptyTrashLiveLight = "http://%s/mail/InboxLight.aspx?EmptyFolder=True&FolderID=%s&";, 
+  strCmdEmptyTrashLiveLightPost = "__VIEWSTATE=&mt=%s&query=&MoveMessageSelector=&ToolbarActionItem=&InfoPaneActionItem=EmptyFolderConfirmYes",
+  strCmdMsgReadLive = "http://%s/mail/mail.fpp?cnmn=Microsoft.Msn.Hotmail.MailBox.MarkMessages&ptid=0&a=&au=%s";, 
+  strCmdMsgReadLivePost = "cn=Microsoft.Msn.Hotmail.MailBox&mn=MarkMessages&d=true,[%s]&v=1&mt=%s",
+  strCmdMsgReadLiveLight = "http://%s/mail/ReadMessageLight.aspx?AllowUnsafe=True&Aux=&FolderID=%s&InboxSortAscending=False&InboxSortBy=Date&ReadMessageId=%s";,
+}
+
+-- ************************************************************************** --
+--  State - Declare the internal state of the plugin.  It will be serialized and remembered.
+-- ************************************************************************** --
+
+internalState = {
+  bStatDone = false,
+  bLoginDone = false,
+  strUser = nil,
+  strPassword = nil,
+  browser = nil,
+  strMailServer = nil,
+  strImgServer = nil,
+  strDomain = nil,
+  strCrumb = "",
+  strMBox = nil,
+  strMBoxName = nil,
+  bEmptyTrash = false,
+  bEmptyJunk = false,
+  loginTime = nil,
+  bMarkMsgAsUnread = false,
+  bLiveGUI = false,
+  bLiveLightGUI = false,
+  strTrashId = nil,
+  strJunkId = nil,
+  statLimit = nil,
+  strUserId = "",
+  strMT = "",
+}
+



Home | Main Index | Thread Index | Old Index