Update of /cvsroot/mrpostman/mrpostman/src/org/mrbook/mrpostman/hotmail
In directory sc8-pr-cvs1:/tmp/cvs-serv26574
Modified Files:
HotmailMailSession.java
Log Message:
Applied patch for msn bug - thanks Johnny
Index: HotmailMailSession.java
===================================================================
RCS file: /cvsroot/mrpostman/mrpostman/src/org/mrbook/mrpostman/hotmail/HotmailMailSession.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** HotmailMailSession.java 6 Dec 2003 11:50:37 -0000 1.33
--- HotmailMailSession.java 16 Dec 2003 13:34:43 -0000 1.34
***************
*** 146,150 ****
private CookieJar cj = null;
private boolean authenticated = false;
!
/**
* Flag to indicate whether this app will only retrieve the unread messages
--- 146,150 ----
private CookieJar cj = null;
private boolean authenticated = false;
! private String myCookie = "";
/**
* Flag to indicate whether this app will only retrieve the unread messages
***************
*** 537,540 ****
--- 537,542 ----
if (inboxMatcher.find()) {
inboxUrlStr = inboxMatcher.group(1);
+ myCookie=inboxUrlStr.substring(inboxUrlStr.indexOf('?')+1);
+ logger.info("myCookie URL: " + myCookie);
logger.info("Found 'Original' Inbox url: " + inboxUrlStr);
}
***************
*** 547,550 ****
--- 549,554 ----
if (inboxMatcher.find()) {
inboxUrlStr = inboxMatcher.group(1);
+ myCookie=inboxUrlStr.substring(inboxUrlStr.indexOf('?')+1);
+ logger.info("myCookie URL: " + myCookie);
logger.info("Found 'New' Inbox url: " + inboxUrlStr);
}
***************
*** 687,691 ****
//The same as read but without the 'raw=1' option...
URL url = new URL(baseUrl + msgReadBaseUrl + "msg=MSG"
! + ((MailIdentifier) messageIDS.elementAt(num - 1)).MailID);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", UserAgent);
--- 691,696 ----
//The same as read but without the 'raw=1' option...
URL url = new URL(baseUrl + msgReadBaseUrl + "msg=MSG"
! + ((MailIdentifier) messageIDS.elementAt(num - 1)).MailID
! + "&" + myCookie);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", UserAgent);
***************
*** 744,750 ****
try {
URL url = new URL(baseUrl + msgReadBaseUrl + "msg=MSG"
! + ((MailIdentifier) messageIDS.elementAt(num - 1)).MailID + "&raw=1");
logger.fine("Read URL:\n" + url);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", UserAgent);
conn.setRequestProperty("Accept", "*/*");
--- 749,757 ----
try {
URL url = new URL(baseUrl + msgReadBaseUrl + "msg=MSG"
! + ((MailIdentifier) messageIDS.elementAt(num - 1)).MailID + "&raw=1" + "&" + myCookie);
logger.fine("Read URL:\n" + url);
+ logger.finest("About to open URL");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ logger.finest("Opened URL");
conn.setRequestProperty("User-Agent", UserAgent);
conn.setRequestProperty("Accept", "*/*");
***************
*** 753,759 ****
HTTPRedirectHandler hrh = new HTTPRedirectHandler(conn);
hrh.setCookieJar(cj);
hrh.connect();
cj.addAll(hrh.getCookieJar());
! BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line = null;
--- 760,768 ----
HTTPRedirectHandler hrh = new HTTPRedirectHandler(conn);
hrh.setCookieJar(cj);
+ logger.finest("About to HRH.connect");
hrh.connect();
+ logger.finest("Done");
cj.addAll(hrh.getCookieJar());
! BufferedReader br = new BufferedReader(new InputStreamReader(hrh.getInputStream()));
String line = null;
***************
*** 802,806 ****
pw.flush();
} catch (Exception e) {
! logger.log(Level.SEVERE, "should not happen", e);
}
}
--- 811,815 ----
pw.flush();
} catch (Exception e) {
! logger.log(Level.SEVERE, "Exception during retrieveMessage: " + e.getMessage(), e);
}
}
|