It is currently September 23rd, 2020, 12:46 pm

POP mail checker

Help with creating, editing & fixing problems with skins

Will the functions as proposed result in Hans' Chinese staff actually attending with greater haste?

1. Of course... 1.5 billion Chinese couldn't possibly be as bad as Hans' office staff.
0
No votes
2. Hey Hans... with such a ridiculous wishlist, wouldn't it just be easier to fire your staff?!?!
0
No votes
3. The Carribean sounds nice!
0
No votes
4. The Carribean... aint that somewhere just past NZ?
0
No votes
5. With the imminent arrival of Chinese Year of the Dragon, that boy better be careful his staff don't read this poll otherwise those flame-snorting colleagues will surely seek to singe some butt.
0
No votes
6. Not only will Hans' staff members respond favorably, but they're the ones most likely to help assist with coding improvement!
0
No votes
7. Hey didn't the Chinese send !Bang !Bang !Wang into space in recent years? (And they're probably the only self-funded nation capable of financing such an operation)
0
No votes
8. I love Chinese food, and I'm sure the office staff can't be nearly as bad as suggested by the foreigner.
0
No votes
9. Not only will Hans' staff repond favorably to the email utility proposed, they're likely to go one step further and devlop RainmeterTime ala Apple!
1
100%
10. Emails, I hate the bastards... they're always chewing up the foliage in my garden... and ooooooh to stnad of them without footwear... not my favorite pastime.
0
No votes
 
Total votes: 1
wabl
Posts: 2
Joined: December 15th, 2011, 5:06 am
Location: Zhuhai, China

POP mail checker

Post by wabl »

Hi all,
I can gain access to my Zimbra/Exchange email through a pre-poulated URL, site popmailchecker. In order to gain access, I enter my email address, password and server.

Unfortunately the site does not sequentially order these emails. There is also no total email count. I am seeking to return four fields... SUBJECT, SENDER, SENDER'S EMAIL, and DATE.

Having done my best to develop several non-lua methods, I have hit the brick wall and am now seeking some assistance. Here are the key particulars:

URL SOURCE CODE that i need to parse:

Code: Select all

<body bgcolor="#FFFFFF">
<center><img src="http://www.pepjob.com/mail/popmail.gif" width=598 height=62 usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="343,42,600,64" href="http://www.pepjob.com" alt="PEPJob.com :: Your #1 Online Career Resource" title="PEPJob.com :: Your #1 Online Career Resource" target="_blank"></map></center>
<p><div align="center">
<table bgcolor="#93BEE2" width=300><tr><td align=center><font face="Arial" size=2 color="#FFFFFF"><img src="http://www.pepjob.com/mail/inboxlogo.gif"></font></td></tr></table><p>
<center><font size='2'>Welcome! You are now logged in as <font color='#3B88C9'>paul@wilson.com.</font> on webmail.email.com.</font></center>
<form action=/cgi-bin/mail/mailchek.cgi method=POST>
<input type=HIDDEN name="action" value="killmail">
<center><table border="1" cellpadding="0" width="100%" bgcolor="#EEFFEE">
<tr align=center><td><b><img src="http://www.pepjob.com/mail/deletetable.gif"></b></td><td><b><img src="http://www.pepjob.com/mail/subjecttable.gif"></b></td><td><b><img src="http://www.pepjob.com/mail/fromtable.gif"></b></td> <td><b><img src="http://www.pepjob.com/mail/datetable.gif"></b></td></tr>
<tr><td><input type=CHECKBOX name=M1></td> <td><a href=/cgi-bin/mail/mailchek.cgi?action=showmail&MID=1><font color=red>Holiday Aftertaste with Video Converter </font></a></td> <td>(Xilisoft Newsletter) newsletter@news.xilisoft.com</td> <td>Fri, 13 Jan 2012 02:00:20 PST </td></tr><tr><td><input type=CHECKBOX name=M3></td> <td><a href=/cgi-bin/mail/mailchek.cgi?action=showmail&MID=3><font color=red>Hurry our Winter Sale ends soon - final reductions! </font></a></td> <td>(Expansys.com) marketing@expansys.fn1.co.uk</td> <td>Fri, 13 Jan 2012 11:39:35 +0000 (GMT) </td></tr><tr><td><input type=CHECKBOX name=M2></td> <td><a href=/cgi-bin/mail/mailchek.cgi?action=showmail&MID=2><font color=red>Test </font></a></td> <td>(Franc Steff) franc@steffl.co.uk</td> <td>Fri, 13 Jan 2012 21:59:11 +1100 (EST) </td></tr></table><p>
<table border=0><tr>
<td align=left><input type='image' src='http://www.pepjob.com/mail/deletemarked.gif' alt='Delete Marked E-mails' value="Delete Marked" name=B1></form></td><td width=40>&nbsp;</td>
<td align=right><form method=POST action=/cgi-bin/mail/mailchek.cgi>
<input type=hidden name=action value=killmail>
<input type=hidden name="ALL" value=1>
<input type='image' src='http://www.pepjob.com/mail/deleteall.gif' alt='Delete All E-mails' value="Delete All Messages" name=B1></form></td></tr></table></center></div>
</body><body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<p><center><table width="40%" cellpadding=0 cellspacing=0 border=0><tr align=center><td>
<table width="100%" cellpadding=0 cellspacing=3 border=0><tr align=center>
<td><font face="Arial black" size="2" color="#FFFFFF"><A HREF=/cgi-bin/mail/mailchek.cgi?action=inbox><img src="http://www.pepjob.com/mail/inbox.gif" alt="Inbox"></A></font> </td>
<td><font face="Arial black" size="2" color="#FFFFFF"><A HREF=/cgi-bin/mail/mailchek.cgi?action=compose><img src="http://www.pepjob.com/mail/compose.gif" alt="Compose"></A></font> </td>
<td><font face="Arial black" size="2" color="#FFFFFF"><A HREF=/cgi-bin/mail/mailchek.cgi?action=logout><img src="http://www.pepjob.com/mail/logout.gif" alt="Logout"></A></font> </td>
<td><font face="Arial black" size="2" color="#FFFFFF"><A HREF=/cgi-bin/mail/mailchek.cgi?action=help><img src="http://www.pepjob.com/mail/help.gif" alt="Help"></A> </td></tr></table>
</td></tr></table></center>


<p><center><font size=1>POPmailChecker&#174  Copyright&#169 2001 PEPJob.com&#174. All rights reserved</font> </center>
............................................................................

I have worked tirelessly on this, not only to achieve the right result, but to learn on the job being a complete newbie to rainmeter. With regards to this skin, I have attempted various methods and codes including:

A. PRE-POULATED URL
(got this via Deviant Art somewhere - apolgies to the author for failing to recall their name)
Url=http://pepjob.com/cgi-bin/mail/mailchek.cgi?action=login&USER=#Username#&PASSWORD=#Password#&POPSERVER=#Server#

B. REGEX CODE TO OBTAIN ONLY THE ID VALUES
GetID=(?(?=.*<.*[BOX].*</tr>).*\bname\b.*\bM([0-9]+?).*</tr>)

C. REGEX CODE TO OBTAIN: ID VALUES, SENDER, SENDER'S EMAIL, SUBJECT, DATE
GetEntry=(?(?=.*<.*[BOX].*</tr>).*\bname\b.*\bM([0-9]+?).*<a\s(.*)><font color=red>(.*)</font>.*<td>.(.*)\)\s(.*)</td>.*<td>(.*)</td>.*</tr>)

D. RETURNING ID MEASURES USING LOOKAHEADMETHOD, SUMMING RESULTS
[TotalEmails]
Measure=Calc
Formula=TRUNC(SQRT((Measure1 + Measure2 + Measure3 + Measure4 + Measure5 + Measure6 + Measure7 + Measure8 + Measure9 + Measure10 + Measure11 + Measure12 + Measure13 + Measure14 + Measure15 + Measure16 + Measure17 + Measure18 + Measure19 + Measure20 + Measure21 + Measure22 + Measure23 + Measure24 + Measure25 + Measure26 + Measure27 + Measure28 + Measure29 + Measure30 + Measure31 + Measure32 + Measure33 + Measure34 + Measure35 + Measure36 + Measure37 + Measure38 + Measure39 + Measure40 + Measure41 + Measure42 + Measure43 + Measure44 + Measure45 + Measure46 + Measure47 + Measure48 + Measure49 + Measure50) * 2))

OBJECTIVES-WISHLIST
1. Format the Date, so that it converts all the Date/Time into my local time.
2. Sequentially lists emails according to the time locally received.
3. Display total emails.
4. Display the list of emails with headings according to Time()-Date(), and display as per the following example; RECEIVED IN THE LAST HOUR, RECEIVED EARLIER TODAY (>TODAY 6:00am AND <LAST HOUR), RECEIVED LAST NIGHT (specifing local times for this sub-list yesterday 22:00 - today 6:00), RECEIVED YESTERDAY (YESTERDAY 0:00 - 22:00pm), RECEIVED IN LAST WEEK (Excluding those listed previous ~ yesterday 0:00) & OTHER (More than a week old). Clearly the development of such categories, will need to intuitively look a the current time, and develop a sequence such emails remain listed as chronologically received, and such that no email is repeated.
5. View a medium length snippet of the message content for those items received in the last hour (say 100 characters).
6. View a short length snippet of the message content for those items received in the last hour (say 50 characters).
7. FILTER EMAILS: Develop code to enter Sender Email Adresses into an external table, and then have options to either (filter them as being omitted, color formatted, included to the exclusion of those senders not specified on the list). Why? I can potentially color code word emails as distinct from personal emails, or just display work, or exclude work. I can always Copy & SaveAs to develop a duplicate .ini skin, and display a separate list of emails elsewhere on my screen, so for example, perhaps my work emails will be listed on the LH endge of my screen in Blue, whilst personal emails could be listed via a separate filtered .ini on the RH edge (and be formatted in a different StringStyle to give a different look.
8. Include a hyperlink, that will open my copy of Windows 7 2010 MS Outlook, and hopefully open the email direct.
9. Sound a .wav alert upon receiving a new email (MailNew.wav).
10. Display an hourly alert for 5 seconds displaying a message like "5 UNREAD EMAILS". This message will display this brief message every hour overriding any program window that the user may have open at that time. The alert will appear to self-close, be non-clickable and be accompanied by a separate .wav sound (say MailAlert.wav). Via a separate, .ini file that will be pre-set as that will controlled with Bangs setting the fontcolor (example 255,0,0,255) via a CALC that measures the computer's current time x:00am/pm - x:00:05am/pm, otherwise this meter will display as transparent and non-clickable (colour 0,0,0,1). As the nominal email list will be affixed/set as 'On Desktop', this 5 second alert will most likely need to be a separate (either linked or independent) .ini that will be set as 'Topmost/non-draggable/click through'.


Beacuse there are so many things potentially happening I suspect that the source code should first be downloaded (refreshed ever 5 minutes), such that once downloaded my PC is saved from performing time intensive operations I'm not forever logging onto an external webmail URL consuing unnecessary resource.

Oh... there may be those out there wondering why the requirement for so many options... well I guess it's because the Chinese staff never seem to check their emails to my infuriation, and I'd like their emails (particualrly work emails) to be in their face and automatically accessible without them doing a thing. Will it work... probably not!

Will await potential comment, advice and suggestions! Thanking all and sundry inadvance.
poiru
Developer
Posts: 2875
Joined: April 17th, 2009, 12:18 pm

Re: POP mail checker

Post by poiru »

The POP3 protocol is very rudimentary and does not easily allow many features you want (to be able to reliably use get an unread count with POP3, for example, one must download *all* emails from the server and check them locally). The IMAP protocol, on the other hand, is far superior. Of course, this knowledge doesn't exactly help you in this case. The good news is that I'm working on a IMAP-capable Rainmeter plugin. It will likely be included in the first Rainmeter 2.3 beta release, which will probably be released in a little over a week :)
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: POP mail checker

Post by jsmorley »

Even then, this is going to be a very large complicated Lua script. I think if we start with taking the source html you posted, and assume that what you will always get will follow the pattern (with fewer or more messages, but the same pattern) we can get that into Lua and parse it into tables. Then we can look at getting them to sort by date and allow you to display the first xx mails.

That is about as far as I am willing to go in one sitting. To get every "feature" you want, I suspect that it would be about a week long project for almost anyone. I'm hoping that once we get into Lua and get the basics of storing the mails in tables so you can interact with them, a lot of the other feature stuff you can do with the Lua manual in hand... ;-)
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: POP mail checker

Post by jsmorley »

By the way, in looking at:

C. REGEX CODE TO OBTAIN: ID VALUES, SENDER, SENDER'S EMAIL, SUBJECT, DATE
GetEntry=(?(?=.*<.*[BOX].*</tr>).*\bname\b.*\bM([0-9]+?).*<a\s(.*)><font color=red>(.*)</font>.*<td>.(.*)\)\s(.*)</td>.*<td>(.*)</td>.*</tr>)

It appears to me that this really parses for ID Number, A relative Url to a CGI to display the mail on the site, Subject, Sender Name, Sender Email, Date.
wabl
Posts: 2
Joined: December 15th, 2011, 5:06 am
Location: Zhuhai, China

Re: POP mail checker

Post by wabl »

You are correct with your remarks concerning the parse, the truth is I've actually developed many parse options over in recent times, and rather than paste a lot of different code (that clearly will never deliver a satisfactory result... compared to a .lua option), I merely selected various snippets that I thought would potentially show some of my previous efforts)... at 3:30am I misquoted the selected fields.

My original thoughts were to maximize the captured data fields, knowing this would add little time to the query, and then I could subsequently choose what to do with the data.

Like yourself, I also noticed the relative URL links, and then found the pre-populated URLs for for several options to view individual emails rather (including message content). My problem with parsing the individual relative URLs was the fact that I think I would need to parse multiple URLs (one for every email), and this would also lengthen the complexity,and the fetch time. If it were possible to use wild cards within the regexp so that I could query every individual email using the relative links, I would do this as this would not overly contribute to the download fetch time, and then I'd have one more field to play with... MESSAGE CONTENT.
User avatar
Ahnìon
Posts: 13
Joined: December 31st, 2011, 9:34 pm
Location: Norrköping, Sweden

Re: POP mail checker

Post by Ahnìon »

poiru wrote:The POP3 protocol is very rudimentary and does not easily allow many features you want (to be able to reliably use get an unread count with POP3, for example, one must download *all* emails from the server and check them locally). The IMAP protocol, on the other hand, is far superior. Of course, this knowledge doesn't exactly help you in this case. The good news is that I'm working on a IMAP-capable Rainmeter plugin. It will likely be included in the first Rainmeter 2.3 beta release, which will probably be released in a little over a week :)
I just have to point out that this is awesome and will take Rainmeter another notable step towards perfection! :thumbup:
death is a sausage! .