Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing a simple email server

What would be a good starting point for me to learn about creating an email server?

Basically, what I want to do is have a server (such as foo.com) recieving mail for me so if I send an email to ([email protected]) it will dump the contents of the email into /mail/blah/subject and then send it off to my REAL email account.

I'm looking to do this as a programming exercise, so links to RFCs, etc. would be nice. Reinventing the wheel is a good way to learn about wheels.

EDIT: Feel free to retag this appropriately.

like image 348
Clark Gaebel Avatar asked Sep 22 '10 01:09

Clark Gaebel


1 Answers

Edit: I provided some headings and divided RFCs by topic. I hope it's more accessible now. It's quite a list, and I wish I could format it any better, but unfortunately, that's about it.

Since you mentioned you don't really know what you need, let me clarify:

  • If you only want to implement a simple "proxy" server that sits in between your MUA (email client) and "real" server, you can probably get away with only implementing basic SMTP functionality. This will allow you to send messages, i.e. to submit messages to an MTA.

  • POP3 is for email clients to pull messages off of your server, while IMAP is an alternative to POP3 with a somewhat different feature set, mainly providing an on- or offline mode which can be thought of like managing remote folders (i.e. mailboxes).

  • MIME specifies the format of the contents of e-mail messages in presence of multi-part messages, attachments etc.

Internet Message format (also defines e-mail address format)

http://www.faqs.org/rfcs/rfc822.html

http://www.faqs.org/rfcs/rfc2822.html


SMTP:

http://www.faqs.org/rfcs/rfc821.html

Update to SMTP/RF821:

http://www.faqs.org/rfcs/rfc5321.html

SMTP-AUTH:

http://www.faqs.org/rfcs/rfc2554.html

Message submission (i.e. for the application to be acting as a MUA):

http://www.faqs.org/rfcs/rfc2476.html


IMAPv4:

http://www.faqs.org/rfcs/rfc1730.html

IMAPv4rev1:

http://www.faqs.org/rfcs/rfc2060.html


POP3:

http://www.faqs.org/rfcs/rfc1081.html

http://www.faqs.org/rfcs/rfc1939.html

http://www.faqs.org/rfcs/rfc1957.html

POP3 extensions:

http://www.faqs.org/rfcs/rfc2449.html

Authorization for POP/IMAP:

http://www.faqs.org/rfcs/rfc2195.html

TLS for POP3 and IMAP:

http://www.faqs.org/rfcs/rfc2595.html

AUTH-RESP-CODE for POP3:

http://www.faqs.org/rfcs/rfc3206.html

POP3 simple authentification:

http://www.faqs.org/rfcs/rfc5034.html


MIME, which is composed of 5 RFCs:

http://www.faqs.org/rfcs/rfc2045.html

http://www.faqs.org/rfcs/rfc2046.html

http://www.faqs.org/rfcs/rfc2047.html

http://www.faqs.org/rfcs/rfc4288.html

http://www.faqs.org/rfcs/rfc4289.html

http://www.faqs.org/rfcs/rfc2049.html

like image 116
Jim Brissom Avatar answered Sep 27 '22 19:09

Jim Brissom