Click here to Skip to main content
15,887,875 members
Articles / Web Development / ASP.NET

POP3 Client Over Firewall

Rate me:
Please Sign up or sign in to vote.
3.45/5 (8 votes)
21 Jul 20072 min read 40.4K   736   35   5
A webservice implementation to connect to POP3 servers
Screenshot - POP3Proxy.gif

Introduction

This is a more complex implementation of the same schema I used in XML Serialization and Firewalls.

The solution is composed of a Webservice that works as a proxy (it receives the request, connects to the POP3 server, and returns the processed answers) and a client that receives and presents the results to the user.

Background

Basic experience on Webservices and network programming will help.

Using the Code

The code itself does not present any particular difficulty. But I've tried to keep a design where all component classes are clearly separated.

The Windows client is coded with a reference to the webservice hosted in the local host. This way the solution can be built quickly and easily, but you probably would like to point it to a webserver hosted outside the LAN where it wouldn't be blocked by the same firewall that blocks your browser.

Component Projects

The solution is composed of several projects.

Base Elements

These are the most general classes. You will find the class that implements the EMail structure and the Quoted Text Decoder.

EMail Support

Probably not a good name. Here is where the communication with the POP3 server is handled and its answers are converted to the corresponding EMail objects. The POP3Manager that encapsulates the two previous classes and gives the user a much more friendly interface.

WebService

It exposes the POP3Manager as a Webservice.

Windows Client (User Interface & Application Support)

The first one implements a Windows Forms user interface. The second is a simple class that handles the proxy class for the Web Reference.

Pendings

This is a very basic build in a very early stage of development. The main purpose is to present a working implementation of the described solution. Currently it will show many limitations and bugs (both on the client and server side and many in the email parsing process).

You may notice the SMTP class. It is not implemented yet.

History

If feedback is provided or support requested, I'll keep working in this sample application.

  • July 21st: POP3S (or POP3 over SSL) support added. Check Pop3Manager and Pop3Client for changes. You will find that the protocol itself doesn't require any change, it is the TcpClient that needs to be configured to properly handle the SSL stream. There is a new class named SslManager. It is only providing the most basic support for these tasks and further development could be useful. I still haven't had time to modify the client interface to support this new feature.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Carlos Salvatore
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Organisation (No members)


Comments and Discussions

 
Newssimilar tool for any mail account Pin
benebx23-Aug-08 21:53
benebx23-Aug-08 21:53 
QuestionIs SSL there? Pin
Dan Suthar19-Jul-07 1:35
professionalDan Suthar19-Jul-07 1:35 
AnswerRe: Is SSL there? Pin
carlos@takeapps19-Jul-07 2:52
carlos@takeapps19-Jul-07 2:52 
GeneralRe: Is SSL there? Pin
Dan Suthar19-Jul-07 14:34
professionalDan Suthar19-Jul-07 14:34 
GeneralRe: Is SSL there? Pin
carlos@takeapps21-Jul-07 11:20
carlos@takeapps21-Jul-07 11:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.