tags:

views:

288

answers:

4

I am writing a simple SMTP server and client. Server is in two parts receiver-SMTP and Sender SMTP. both will run in two different daemon services. The two modes this can run in is 'remote' and 'local'.

Since i am new to network programming I am having difficulty in even getting started. Any help in form of text, sample or skeleton code of an SMTP will help me a lot in clearing my doubts,

A: 

Take a look at this

AJ
+1  A: 

If you're set on writing this in C, start with this guide on network programming and sockets. Writing such a server isn't simple and requires a lot of background knowledge.

After you're a bit comfortable with sockets, install WireShark, some open-source SMTP server and try to send it some of the standard SMTP requests - seeing how it responds. This type of "exploration" is extremely valuable when implementing protocols.

Eli Bendersky
A: 

The simple answer would be to google for open source smtp, try and find an existing project that is in the language you want to implement your own in, or in a language you can read and understand, and then work through the code to gain the understanding you need

Sites like sourceforge, freshmeat github, bitbucket will have projects on that will range from small to large. ou can also try some of the other repositories like PHPClasses, CPAN etc. (again depending on your language of choice).

You can also try open source search such as Krugle.

Another reference would be the SMTP RFC RFC 821 which will give you the standard you are writing to regardless of language.

PurplePilot
RFC 821 has been obsoleted many times since its publication. the last standard for the SMTP protocol is RFC5321 (ftp://ftp.rfc-editor.org/in-notes/rfc5321.txt).
Adrien Plisson
+2  A: 

If your primary motive is to learn network programming and writing daemons, then I would recommend reading Beej's Guide to Network Programming and Advanced Programming in the Unix Environment. These don't provide straight up SMTP implementations but will give a good foundation to implement any protocol.

codelogic