编写简单的电子邮件服务器 [英] Writing a simple email server

查看:338
本文介绍了编写简单的电子邮件服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



基本上,我想做的是拥有一个服务器(如foo) .com)收到邮件给我,如果我发送电子邮件(blah@foo.com),它会将邮件的内容转储到/ mail / blah / subject中,然后发送到我的真实电子邮件帐户。



我正在寻找一个编程练习,所以链接到RFC等会很好。



编辑:随时重写这个轮。

解决方案

编辑:我按主题提供了一些标题和分割的RFC。我希望现在更方便。这是一个很好的列表,我希望我可以更好的格式化,但不幸的是,这是关于它。



既然你提到你真的不知道你需要什么,让我澄清一下:




  • 如果您只想实现一个简单的代理服务器,它位于您的MUA(电子邮件客户端)和真实服务器,您可能只能实现基本的SMTP功能。这将允许您发送消息,即将消息提交给MTA。


  • POP3用于电子邮件客户端将邮件从服务器中拉出,而IMAP为POP3的一个替代方案,具有一些不同的功能集,主要提供可以被认为像管理远程文件夹(即邮箱)的在线或离线模式。


  • MIME指定多部分消息,附件等存在的电子邮件内容的格式。




Internet邮件格式(也定义电子邮件地址格式)



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



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






SMTP



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



更新到SMTP / RF821



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



SMTP-AUTH



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



邮件提交(即应用程序作为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/rfc195 7.html



POP3扩展程序



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



POP / IMAP的授权



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



TLS for POP3和IMAP



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



POP3的AUTH-RESP-CODE



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



POP3简单验证



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






MIME ,由5个RFC组成:



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


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 (blah@foo.com) 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.

解决方案

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

这篇关于编写简单的电子邮件服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆