Fremus.co.za

Demistifying Life and Web Development

Archive for September, 2009

IMAP and Lumisoft Mimeparser

One of the requirements in a recent project was to give clients the ability to login to any email account from within our application. Email accounts generally use two RFC standards:

  • RFC 1730 – IMAP
  • RFC 1939 – POP

Its important to briefly understand the differences between the two. Think of IMAP (Internet Message Access Protocol) as a network folder where you have access to resources that do not physically reside on your local machine. IMAP never downloads any messages whereas POP (or post office protocol) on the other hand works by downloading email messages to the client’s machine.

Both protocols work with commands – you send commands and receive responses. I found this website useful for IMAP commands. You can check IMAP from a telnet console if you really want to.

With some basic knowledge of the two protocols and also knowing that GMail supports both, I started searching for some sample code. I found this library on CodeProject and found that the first library did not support SSL, which is a GMail requirement. I ended up on Codeplex and found that the library had been extended by someone else and that it included support for SSL. SSL stands for Secure Socket Layer and simply put means that the connection between the client and the server is secure. The solution on CodePlex comes with two C# projects, the library and a console application. The console application gives you a good place to practice and learn some IMAP commands. Once you get a basic understanding of these commands you can start writing web-based applications. Its important to understand that IMAP commands need to be given in a specific sequence. You first login, then you select a folder (INBOX) and then you can run FETCH commands to retrieve message data. Thats the easy part though, because once you get that data back you have to be able to parse the messages which requires a MIME (Multipurpose Internet Mail Extensions) parser. Introduce the Lumisoft Mime parser which parses almost everything.

  • Share/Bookmark
posted by fr3dr1k in Application Development,C# and have No Comments

Things that defined the 90′s…

With my previous post in mind I starting thinking of things that make me think of the 90′s, i.e. 1990-1999. One of those things would have to include the type of music and the specifically the bands that came to prominence in that time. One such band is Live, who in my opinion, are one of the best bands ever. I bought Secret Samadhi so long ago, think it was around 1997. The second track off that album, Lakini’s Juice, had a very distinct opening sound which almost sounded like a scratch, but it was one of the best CD’s I ever bought. It had a melancholic feel to it. For some reason Lightning Crashes makes me think of the movie Powder. Check it out here.

Other bands that had a nineties feel to them were Bush and Creed. I bought RazorBlade Suitcase way back in 1996, with Greedy Fly and Swallow my favourites. Creed’s song Higher is one of my favourites:

What has really changed?

  • Share/Bookmark
posted by fr3dr1k in General and have No Comments

20 Years from now…

I’ll be 49, a year before I reach that half-century mark, given of course that I do reach it. What would have changed, and more importantly, who would have changed? The year would be 2029, and my guess is that the world will still have the same problems and issues to deal with. Madonna would be 71, wow! Would she still be a performer? I don’t know. 2029 would also see 90 years since the start of World War II, with the effects thereof probably lasting as long. I mean the effects of World War II is still present today, if you ask me. Eastern Europe has never really recovered.

Al Pacino and Robert De Niro would probably not be alive anymore, but I’m sure their movies would still be as relevant as they were at their time of release, as they are today. I’m thinking of think of Taxi Driver particularly, which was a great movie back 1976, and still remains one of the best movies ever.

The nineties (1990 and later) would have happened 39 years back, and it is my feeling that the 90′s shaped a totally different generation to ones before it. The internet came to prominence, big time. Yahoo, if they survive, will be 35 years old! Microsoft will be 54 years old, OMG! What version of Windows will be available? Where will Google Chrome OS feature? Insane! Bill Gates will be 74. Will there be a new IP protocol that can handle enough capacity?

  • Share/Bookmark
posted by fr3dr1k in General and have No Comments

Ronaldo – Youtube inspiration

I have recently started using Youtube again and I amazed at how much content is available through this service. I have found the majority of Armin van Buuren’s tracks as well as some or all of Tiesto’s. I even listened some Johnny Cash, John Lennon and Simon and Grafunkel on there. And over the weekend I watched some top gear clips as well. Tonight I also watched a few trailers, and I am amazed at how much content there is.

But my favourite video to watch at the moment is this one from Ronaldo, the Brazilian, not the Portuguese one that plays for Manchester United:

I love it because first of all the music is perfect and secondly because the guy has magic skills that I never knew about. The way he manages to evade or sidestep defenders is amazing. Everytime he faces a defender you have a feeling he will beat them, easily. On 0:21 he plays a ball between a defender’s legs, which causes another defender to fall over the other defender. On 0:33 he simply plays a ball inside and beats a defender and scores, amazing. At 1:10 he steps inside another defender, it looks unreal how the ball sticks to his feet. Its so motivating watching this video.

  • Share/Bookmark
posted by fr3dr1k in General and have No Comments

Do you code through Google?

On my way to work this morning I thought about some code I used yesterday for object serialization and object deserialization, and I must admit that I got the code through a Google search, and that I did not really take much time to understand what the code is doing. So in a way, if asked to reproduce the code, I would not be able. I say in a way, because maybe I could reproduce it (but only if I understood it). Serializing objects means taking an instance of an object and transforming it into a format such as XML or JSON. Once the object has been serialized you can deserialize it again and have an instance of a class available. So in essence the XML representation is an object that has been instantiated. It seems I do understand the concept at least, but the implementation is a bit more tricky.

My point though is that some percentage of code that I use comes from code searched for on Google. Are we really developers then if we just regurgitate other people’s code? The other day I also used an IMAP class library to check an IMAP email account, specifically GMail. I just tweaked the code a bit here and there. The fact that I am just using the library does not mean that I understand where IMAP fits into the Internet Protocol Suite, because POP also forms a part of it, and items such as TCP/IP. It also doesn’t mean I understand that HTTP is a stateless protocol! Or maybe it does I’m not sure.

I often find myself going to MSDN and referencing some piece of code, because I do not know it. For instance I find myself checking out implementations for things like the StreamReader/Writer class or how to implement IEnumerable for a class. Do you ever find yourself doing this?

  • Share/Bookmark
Tags:
posted by fr3dr1k in Application Development,General and have No Comments
Get Adobe Flash playerPlugin by wpburn.com wordpress themes