Opo Perspective - An ASP.NET Webmail: Part 03

In this post I’ll talk a bit about the architecture of Opo Perspective. I wrote in my first post that this application should be very flexible and extensible. Here are some thoughts about this topic. Most of the ideas presented here are already realized, have a look at the source on CodePlex.

The mail messages’ way

The following graphic illustrates how a mail message makes it’s way from the mail server to the web page (click for larger view).

 PerspectiveMessagePipeline

The MailStore is an external place, where the mail messages are received from. This could be any sort of mail server or, if the mail server is running on the same system for example, a directory with the mail messages.

The MailCache is an internal respository where the messages are saved. Messages displayed in the webmail are retrieved from the MailCache.

This is done through the MailService where also could be dealt with some business logic .

IPerspectivePipeline

There are two places where a PerspectivePipeline comes into play. The first one is intended to filter, tag, delete, … mails that are stored in the MailCache. In the graphic there's a SpamPipilinePlugin, which searches the message's header for such inserted by spam filters and adds a "Spam" tag to the message. This is one example how the pipeline could be used.

The second pipeline is intended to manipulate the message before displaying. One possibility would be to convert links in the text body of the message to html hyperlinks so they can be clicked within the message. Or we could prevent images from beeing shown initially and insert a link at the top of the message that loads the images on demand.

Since all involved classes are based on interfaces it's easy to write your own mail store, mail cache or pipeline plugin.

Because messages in Opo Perspective are based on the same interface (IPerspectiveEntity) like contacts, appointments etc. the same plugins can be used for these as well.


Posted by Dave on 1/2/2009 at 10:46 PM
Tags: , ,
Categories: Opo Perspective | .NET
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Developing a C# POP3 client: First Release on CodePlex

Finally a first release of Opo.Net on CodePlex! Yeah! :-)

With this release it's possible to connect to a POP3 server, recieve messages and convert it into Opo.Net.MailMessage instances. Sending mail messages via SMTP is the next step. I think it's now a lot easier becaus some classes can be reused for the other way round.

A very simple example for using the Pop3Client:

Pop3Client pop3 = new Pop3Client("pop.example.org", 110, "accountName", "password");
pop3.Connect();
pop3.Login();
string mimeData = pop3.GetMessage(1) // recieve first message on server
pop3.Logout();
pop3.Disconnect(); 
IMailMessageConverter converter = new MimeMailMessageConverter();
IMailMessage message = converter.ConvertFrom(mimeData);

Console.WriteLine("Subject: " + message.Subject);
Console.WriteLine("From: " + message.From.ToString());
Console.WriteLine("To: " + message.To.ToString());
Console.WriteLine("");
Console.WriteLine(message.Body);

This will output something like this:

Subject: Test message
From: "Example Email 1" <email1@example.org>
To: "Example Email 2" <email2@example.org>, "Example Email 3" <email3@example.org>

This is the message body.

Posted by Dave on 11/7/2008 at 10:17 PM
Tags: , , , ,
Categories: .NET
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (2) | Post RSSRSS comment feed