SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-19-2006, 11:28 AM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Talking STV Import: Simple Email Checker for POP3, IMAP and WEBMAIL (v 0.2, 27/May/2006)

I've created a simple email checker in Java which can read the email headers from email accounts and displays the header info in a list on screen.
The internal screen called MailCheck can be linked into a menu easily by using for instance Nielm's Dynamic Menu import.
Selecting the Refresh button on the screen will poll the email accounts for messages and update the display.
You configure the email accounts in a file named mailaccounts.xml located in the root folder of the SageTV installation.
For each message the following is shown:
<displayname>
<from-address>
<subject>
<sent-date>.

secure connections
From version 0.2 onwards secure connections are supported for both POP3 and IMAP accounts. You have to run Java 1.5 or higher for this to work. For secure POP3 you have to specify the protocol element with value pop3s in the mailaccounts.xml. Inside yor Mailaccount element create a protocol element like this:
Code:
<object class="nl.cmkprojects.sage.mail.MailAccount"> 
  <void property="displayName"> 
   <string>2nd pop account</string> 
  </void> 
  <void property="host"> 
   <string>pop.zonnet.nl</string> 
  </void> 
  <void property="protocol"> 
   <string>pop3s</string> 
  </void> 
  <void property="password"> 
   <string>secret</string> 
  </void> 
  <void property="username"> 
   <string>janedoe</string> 
  </void> 
 </object>
Similarly you specify value imaps for secure imap server access.
The first time you use a secure connection you may be prompted to accept a server certificate that was not trusted, because a lot of mail servers use a self signed security certificate that can not be validated down to a trusted Certificate Authority. If you accept the shown certificate, then it will be added to a local certificates storage and the next time you refresh the message header fetching will succeed.

webmail
For checking webmail accounts like hotmail, gmail,.. you have to install a webmail POP3 converter program like MrPostman. This great free program can be downloaded from here
http://mrpostman.sourceforge.net/
Using MrPostman extends the usability of MailCheck to include webmail from
Hotmail , mail.com, Yahoo, gmail (Google mail), indiatimes.com, juno,
rediffmail, Gossamer mail, Outlook Web Access (Exchange 5.5) ,
Outlook Web Access 2003, Caramail, Lycos.fr, SquirrelMail and others.
After installing MrPostman, you create a pop3 account with host set to localhost (if you run MrPostman on same machine as SageTV), port to 11110.
That's the default port MrPostman is listening on. For username you specify your email address, e.g. johndoe@hotmail.com.
Once in a while you might have run the update function in MrPostman to get script update (typically when they update the website hosting your webmail).
Code:
<object class="nl.cmkprojects.sage.mail.MailAccount"> 
  <void property="displayName"> 
   <string>My hotmail</string> 
  </void> 
  <void property="host"> 
   <string>localhost</string> 
  </void> 
  <void property="protocol"> 
   <string>pop3</string> 
  </void> 
  <void property="portl"> 
   <string>1110</string> 
  </void> 
  <void property="host"> 
   <string>localhost</string> 
  </void> 
  <void property="password"> 
   <string>secret</string> 
  </void> 
  <void property="username"> 
   <string>johndoe@hotmail.com</string> 
  </void> 
 </object>
The java code uses Log4j api to log error and debug messages in the mailcheck.log. You can change the log level in the file log4j.properties.

The STVI and supporting files can be downloaded from here (also some screenshorts):
http://forums.sagetv.com/forums/down...?do=file&id=83

Installation
  • download zip file from location in the link above
  • make copy of mailaccounts.xml if you already use a previous version of this plugin
  • extract the zip file in the root folder of your sageTV installation
  • modify the account details in the mailaccounts.xml file
  • restart SageTV.
  • if you use a STV with mailcheck already imported, you have to go back to an old STV that does not contain mailcheck before importing this STVI, because as with all STVIs, updating an STVI gives unpredictable results
  • import the mailcheck_import.stvi in the detailed setup screen. If you already use Nielm's Dynamic Menu plugin then you can than simply create a menu item and link it to the internal screen named MailCheck. If not you may have to modify the stv file manually to create a menu item linking to the MailCheck screen.

History
v 0.1 - 05-19-2006
  • first version
v 0.2 - 05-27-2006
  • IMAP support
  • SSL support (secure connections)
  • override default protocol port
  • option menu with next and previous buttons to browse through the list of message headers.

note !!!: If you downloaded the zip file between 27-05-2006 and before 07-06-2006, you might have downloaded v0.1 because I made a mistake with uploading.

have fun !!

Last edited by koelec; 06-07-2006 at 12:25 PM. Reason: clarifications
Reply With Quote
  #2  
Old 05-20-2006, 12:33 AM
Homebuilder Homebuilder is offline
Sage Advanced User
 
Join Date: Sep 2005
Posts: 180
Awesome!!

I was just thinking about it would be great to have this feature in sage!

Any chance of being able to read the emails in sage?

My wish list fantasy would be able to record an audio/video reply or have voice recognition replies.

When I was thinking about this, I was wondering if we could somehow skim the info out of another program such as outlook or mozilla thunderbird... Only problem I have is while I can think of features, I have no coding skills...

Thanks again for this feature!!
Reply With Quote
  #3  
Old 05-20-2006, 01:48 AM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
Any chance of being able to read the emails in sage?
It depends on the content type. Normal text content would be easy to do,
but other MIME types would require special rendering that goes beyond the capabilities of builtin SageTV STV widgets I guess. Anyway I will experiment with adding reading the email to this plugin, and see if it is usable.

Quote:
My wish list fantasy would be able to record an audio/video reply or have voice recognition replies.
My intention was to create a simple email checker and not a full email client, because a PVR application being controlled by a remote is not ideal for writing text.
Reply With Quote
  #4  
Old 05-22-2006, 01:36 AM
BruenerXII's Avatar
BruenerXII BruenerXII is offline
Sage User
 
Join Date: Apr 2006
Location: Canada
Posts: 73
help

I have it all installed, used Nielm's Dynamic Menu to link it up. I can see the screen "Email Check" but nothing shows up..
I think that i am setting up my mailaccounts.xml settings wrong.

I should just have to set the 4 bold underlined area's?

<?xml version="1.0" encoding="UTF-8" ?>
- <java version="1.4.2_04" class="java.beans.XMLDecoder">
- <object class="nl.cmkprojects.sage.mail.MailAccount">
- <void property="displayName">
- <!-- text you want to be shown as first line in each message header
-->
<string>My pop account</string>
</void>
- <!-- pop3 host, e.g. pop.zonnet.nl
-->
- <void property="host">
<string>pop.zonnet.nl</string>
</void>
- <void property="password">
<string>secret</string>
</void>
- <void property="username">
<string>johndoe</string>
</void>
</object>


My email pop is pop.cogeco.ca
could you help me out as to what/where to fill in.

Thanx

Last edited by BruenerXII; 05-22-2006 at 01:55 AM.
Reply With Quote
  #5  
Old 05-22-2006, 02:02 AM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Yes, the four bold items that's what you need to specify.
Only the host, username and password fields are relevant for connecting to the mailserver. In your case use pop.cogeco.ca for the host address.
Be sure you leave the xml format in tact. You can check this by loading the mailaccounts.xml file into the Internet Explorer. It will give an error if not formatted correctly.

Also check the mailcheck.log file located in the same folder the mailaccount.xml file resides. There may be an exception being logged revealing the cause you don't see any messages.

Finally, it may seem trivial, but be sure you actually have messages on the mail account that were not fetched already by f.i. Outlook express.
Reply With Quote
  #6  
Old 05-22-2006, 02:22 AM
BruenerXII's Avatar
BruenerXII BruenerXII is offline
Sage User
 
Join Date: Apr 2006
Location: Canada
Posts: 73
GOT IT!

Thanx koelec I got it working now
I must have screwed up the xml format like u said. I just copied over a fresh mailaccounts.xml out of the zip file, started over again and now it works great.

BTW KICK ASS JOB!!
This is exactly what i have been looking for. Something to check and see wether or not i have any email before i go and pull out the keyboard and mouse to look!
Reply With Quote
  #7  
Old 05-22-2006, 10:50 AM
cmaffia's Avatar
cmaffia cmaffia is offline
Sage Expert
 
Join Date: May 2004
Posts: 612
Send a message via Yahoo to cmaffia
Great work!
Can you confirm if this will do multiple email accounts .. or does this do that already if I ad to it?
Is that what the "My email" field is for...to differenciate between email accounts?

EDIT: Just tried adding another account to the XML and when I open in IE..says format is incorrect.
Guess I will wait for your response :-)
__________________
Server: Dual Tuner: PVR-150MCE/PVR-250MCE/SageTV v5.02/Asus Pundit-R 2.4GHZ/512MB DDR RAM/250 GB Maxtor HD (8MB Buffer) External Seagate 400GB HD via USB 2.0/Onboard ATI 9100 using SVIDEO TV-Out/Nvidia DVD decoder/Actisys 200L IR Blaster (Dish receiver) USBUIRT (DirectTV receiver)/Lite-On 4X DVD-R/RW/Windows XP Pro SP2/Adesso Mini IR Keyboard w/integrated mouse/Tivo "Peanut" Remote via USBUIRT/Dish Network Model 301/DirectTV subscriber/Webserver Plugin v2.8

Last edited by cmaffia; 05-22-2006 at 10:56 AM.
Reply With Quote
  #8  
Old 05-22-2006, 11:00 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
koelec,

will this work with secure connections (Gmail ?)


Thanks,

Dirk
Reply With Quote
  #9  
Old 05-22-2006, 12:14 PM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
Can you confirm if this will do multiple email accounts .. or does this do that already if I ad to it?
Is that what the "My email" field is for...to differenciate between email accounts?
Yes, this version works for multiple accounts. Just copy the <object class="nl.cmkprojects.sage.mail.MailAccount"> ... until </object> part
and insert it just before the </java> end tag and specify different values
for displayname, host, password and username.


Quote:
will this work with secure connections (Gmail ?)
The current version probably not. But I will check this and add this feature and support for IMAP soon.
Reply With Quote
  #10  
Old 05-22-2006, 12:51 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by koelec
The current version probably not. But I will check this and add this feature and support for IMAP soon.
Cool, that would be great !

Dirk
Reply With Quote
  #11  
Old 05-22-2006, 06:25 PM
cmaffia's Avatar
cmaffia cmaffia is offline
Sage Expert
 
Join Date: May 2004
Posts: 612
Send a message via Yahoo to cmaffia
This doesn't seem to work with my POP3 account with my ISP which requires me to authenticate to the mail server (it is an option in my Outlook setup) :-(
__________________
Server: Dual Tuner: PVR-150MCE/PVR-250MCE/SageTV v5.02/Asus Pundit-R 2.4GHZ/512MB DDR RAM/250 GB Maxtor HD (8MB Buffer) External Seagate 400GB HD via USB 2.0/Onboard ATI 9100 using SVIDEO TV-Out/Nvidia DVD decoder/Actisys 200L IR Blaster (Dish receiver) USBUIRT (DirectTV receiver)/Lite-On 4X DVD-R/RW/Windows XP Pro SP2/Adesso Mini IR Keyboard w/integrated mouse/Tivo "Peanut" Remote via USBUIRT/Dish Network Model 301/DirectTV subscriber/Webserver Plugin v2.8
Reply With Quote
  #12  
Old 05-23-2006, 04:52 AM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
(
Quote:
This doesn't seem to work with my POP3 account with my ISP which requires me to authenticate to the mail server (it is an option in my Outlook setup) :-(
Next version will support secure connections.
Reply With Quote
  #13  
Old 06-03-2006, 06:57 AM
cmaffia's Avatar
cmaffia cmaffia is offline
Sage Expert
 
Join Date: May 2004
Posts: 612
Send a message via Yahoo to cmaffia
Any update as to when the new version will be released?

Quote:
Originally Posted by koelec
(
Next version will support secure connections.
__________________
Server: Dual Tuner: PVR-150MCE/PVR-250MCE/SageTV v5.02/Asus Pundit-R 2.4GHZ/512MB DDR RAM/250 GB Maxtor HD (8MB Buffer) External Seagate 400GB HD via USB 2.0/Onboard ATI 9100 using SVIDEO TV-Out/Nvidia DVD decoder/Actisys 200L IR Blaster (Dish receiver) USBUIRT (DirectTV receiver)/Lite-On 4X DVD-R/RW/Windows XP Pro SP2/Adesso Mini IR Keyboard w/integrated mouse/Tivo "Peanut" Remote via USBUIRT/Dish Network Model 301/DirectTV subscriber/Webserver Plugin v2.8
Reply With Quote
  #14  
Old 06-03-2006, 07:14 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by cmaffia
Any update as to when the new version will be released?
Seems like the new v0.2 has been secretly released a few days ago ...

I just downloaded it, two questions ...
  • I cant find the outcommented protocol element in the example mailaccounts.xml for secure connections
  • why would I need a pop-proxy like MrPostman for Gmail ? Gmail offers regular POP3 access, it works fine with my normal email client ...

Once I find out about the protocol element, I'll give it a try ...

Dirk
Reply With Quote
  #15  
Old 06-05-2006, 01:38 PM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
Any update as to when the new version will be released?
Sorry, I forgot to create thead message to announce the new version.
It was released on may 27th, see head of this thread.
Reply With Quote
  #16  
Old 06-05-2006, 01:42 PM
mkanet's Avatar
mkanet mkanet is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,359
Any chance we could see a couple of screenshots?

Tbanks!
__________________
Upgraded to Comcast X1 + Netflix/Amazon Video streaming

***RIP SageTV***
Reply With Quote
  #17  
Old 06-05-2006, 01:48 PM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
  • I cant find the outcommented protocol element in the example mailaccounts.xml for secure connections
My mistake. I just updated the thread head message to describe config in more details.
Quote:
  • why would I need a pop-proxy like MrPostman for Gmail ? Gmail offers regular POP3 access, it works fine with my normal email client ...
For gmail you don't need MrPostman, because gmail supports the pop3 protocol directly. But, what about webmail providers that do not support pop3 or imap, like hotmail and others. To get these working with the email check plugin you need MrPostman.
Reply With Quote
  #18  
Old 06-05-2006, 01:58 PM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
Originally Posted by mkanet
Any chance we could see a couple of screenshots?

Tbanks!
That's a good idea. But I have to fake the email headers for obvious reasons.
I'm rather busy at the moment, but somewhere this week there must be time for this.
Reply With Quote
  #19  
Old 06-06-2006, 01:52 PM
mkanet's Avatar
mkanet mkanet is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,359
Are there any screen shots somebody could post please??
__________________
Upgraded to Comcast X1 + Netflix/Amazon Video streaming

***RIP SageTV***
Reply With Quote
  #20  
Old 06-07-2006, 09:56 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by koelec
For gmail you don't need MrPostman, because gmail supports the pop3 protocol directly.
Yeah, I was just confused because your description stated "For checking webmail accounts like hotmail, gmail,.. you have to ..."

It seems the download does not contain the latest file, I get

Code:
Wed 6/7 11:47:46.258 setUI(sage.bz@1dce7a9[MailCheck]) histIdx=2 uiHistory=[sage.bz@162f2fe[Main Menu], sage.bz@1f1a90a[Dynamic Menu by nielm], sage.bz@1dce7a9[MailCheck]]
java.lang.NoSuchMethodException: <unbound>=MailAccount.setProtocol("pop3s");
Wed 6/7 11:47:46.422 Continuing ...
java.lang.NoSuchMethodException: <unbound>=MailAccount.setPort("995");
Wed 6/7 11:47:46.422 Continuing ...
I checked the jar file, the class MailAccount does not have the above methods. Did you change the plugin description and added the new zip file at the same time ? There's a bug with the upload system which will not update the zip file in this case, so you'll have to do each step separately. Just a guess ...

Dirk
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.