Cjwdev.Mail – Progress Report 1

November 6, 2009 — Leave a comment

So I’ve explained what you can do with my SmtpSender and SmtpReceiver class in the last few posts, now its time to fill you in on where exactly this project is at.

In short – this is not going to be ready for BETA testing for at least another month. I have been working on the class library for the last month or so in my spare time but to be honest have not spent much time on it at all for the last 2 weeks.

I have got the basics of the SmtpReceiver class up and running – it can successfully accept a standard email from another SMTP server and from telnet. Of course there is a lot more testing and coding that needs to be done with this but for now I am happy to leave this class where it is an concentrate on the SmtpSender class.

The thing that has caused the whole project to take longer than I anticipated is: DNS. As I explained in a previous blog post, when you send an email your computer (or the email server) first has to query a DNS server to find out the address of the email server that handles incoming emails for the domain you are sending an email to. This process (known as an MX Lookup) is what I am currently working on. I have been studying the DNS RFC ( http://www.faqs.org/rfcs/rfc1035.html )  and have finally got my class to successfully send a query to a DNS server – parsing the response is the next challenge. The fact that DNS is a binary protocol is what is slowing me down so much, if it was just a case of sending command strings (like with SMTP) then this would be much easier but as it is I have got to work with bits and bytes whilst constantly referring to the RFC to see what each bit/byte means and what it is for.

Of course all of this means that I have had to develop my own DNS related classes to handle the sending and receving of DNS queries, so I will be making these available on my website as well just in case they are useful to anyone else.  I’m sure you will be able to find more flexible ‘general purpose’ DNS libraries and examples on the internet (as mine will be centred around performing MX lookups) but I figure there is no harm in offering them to people.

So in summary: the current part of this project that I am working on is the parsing of the MX Lookup response from the DNS server. Once this is complete then I will be moving on to working on the actual transfer of the SMTP message to the recipient’s email server, which should be quite straight forward but will require a lot of testing and more RFC studying (http://www.faqs.org/rfcs/rfc2821.html ). I will update this blog with my progress in a few days. In the mean time, please feel free to leave comments with your feedback on the classes I am developing or on this blog in general. Thanks!

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s