tags:

views:

140

answers:

4

My university refused to allow us to access out mail via POP or IMAP etc so I want to write a GTK based C app that sits in my notifcation area and does the job of a mail client notifier. Because I can't use anything like POP or IMAP, what would be a good way to do it? I guess I could scrape the HTML and look for a tag that is only present in unread mail or something?

Any Ideas?

A: 

Well yes, if the only way to access your email is through webmail then any tool you create will have to use the webmail markup to work out new messages.

Personally I'd try and find out why POP/IMAP isn't allowed. As far as I'm concerned that's a really strange policy.

Gareth
A: 

Just set up a port 80 proxy and you're set! ;)

Filip Ekberg
A: 

In precedent job, the only access we had to email was through a webmail (squirrelmail) at the time, I had wrote a Perl script with WWW::Mechanize that went through the pages to fetch the emails, send them via smtp to an external mailbox, delete them, and expunge the trash...

It's was about 20/25 lines of code. Off course, a C version would be a bit bigger because it would not have WWW::Mechanize :-)

mat
+1  A: 

I know you said C/GTK but it's a piece of cake in Python/GTK with urllib2, libcookie, and BeautifulSoup. That way you don't have to deal with raw sockets, and parsing the HTML yourself. Hell if you edit your question with a link to the source I could hack this up for you in no time. But if you're doing this as a socket exercise, more power to you :P

You should note that most server admins don't take too kindly too frequent scraping of their site, and you should probably clear it with them, lest you face the repercussions.

Andrew