tempad
Readygo技术搜索引擎 >>PHP技术 >> 给自己的公司建个邮件服务器

给自己的公司建个邮件服务器

Readygo技术搜索引擎 网络搜索 efish 2008-1-14 6:26:23

给自己的公司建个邮件服务器

楼主pipiyantai(皮皮)2002-05-14 14:28:53 在 Delphi / VCL组件开发及应用 提问

我们公司有自己的网站,想在网站上建一个邮件服务器,  
   
  可以接收邮件,同时可以发邮件。  
   
  想用Delphi6编写,用NMPOP3,NMSMTP就可以实现吗?  
   
  希望各位给点建议! 问题点数:0、回复次数:16Top

1 楼pipiyantai(皮皮)回复于 2002-05-14 14:31:36 得分 0

分数并不是问题Top

2 楼naughtyboy(重归起跑线)回复于 2002-05-14 14:33:54 得分 0

如何编写SMTP邮件服务器    
   
          许多时候,我想不通为什么不能直接将信件送到对方(POP或IMAP)服务器上,为什么非    
   
  要通    
   
  过一个莫名其妙的SMTP邮件服务器转交一次,实在不服气,如果使用UNIX,这个问题就很好    
   
  解    
   
  决,用sendmail就能完成递送任务,但在Windows下呢?同样的,一定也有办法饶开SMTP   Se    
   
  rver    
   
  直接递送到对方的远程邮局服务器上,难得住别人,难得住我们程序员吗?分析相关协议    
   
  (RFC2645,RFC821,   RFC1846,RFC1939,RFC1725,RFC1730-RFC1733   etc.),我们会知道要完    
   
  成直接递送其实相当简单。    
   
      首先我们看一下Email的递送过程:Email(Encode)   ->   a   SMTP   Relay   Server     ->   Remote    
   
       
   
  SMTP   Server(远程邮局)。非常简单,邮件编码后被递送到一个SMTP转交服务器上,该服务    
   
  器对    
   
  信件分检(到同一邮局的被放在一起)后,根据优先级以及信件的先后次序被发送到远程邮    
   
  局的    
   
  SMTP服务器上。换句话说,只要我们知道了SMTP转交服务器是如何确定远程邮局SMTP服务器    
   
  的地    
   
  址的,就可以轻松地将饶开SMTP   Relay   Server直接递送到远程邮局服务器。    
   
      SMTP   Relay   Server是如何确定远程邮局服务器的地址的呢?如果你熟悉域名解析,就知    
   
  道是    
   
  怎么回事了,我们知道电子邮件的地址由两部分构成postbox@address.com,邮箱(postbox    
   
  )和    
   
  地址(address.com),给域名服务器发送指令查询“address.com”的远程邮局服务器的地    
   
  址即    
   
  可找到远程邮局SMTP服务器的IP   地址,该指令查询是被称作MX(Mail   Exchange)邮件交换服    
   
  务器    
   
  的地址查询。远程邮局SMTP服务器的地址可能不止一个,这时,你可根据信件优先级的不同    
   
  ,将    
   
  对应优先级的信件发到对应地址的远程邮局SMTP服务器,当然,你也可以不管三七二十一,    
   
  随便    
   
  选一个SMTP服务器发送,见后附“域名解析结果样例”。简单吧。这下,自己编写一个SMTP    
   
       
   
  Server不难了吧!    
   
       
   
  问题:头ID是个麻烦的事,有时会产生Invalid   Head   ID   5811的错误。    
   
       
   
  附:域名解析结果样例    
   
       
   
  Answer   List    
   
       
   
  Resource   name   is   :     sina.com    
   
  Type   is   :     MX         Class   is   :     IN    
   
  MX   Priority   :     10                   MX   Server   :     mailcn.sina.com    
   
       
   
  Resource   name   is   :     sina.com    
   
  Type   is   :     MX         Class   is   :     IN    
   
  MX   Priority   :     15                   MX   Server   :     mail.sina.com.cn    
   
       
   
       
   
  Authority   List    
   
       
   
  Resource   name   is   :     sina.com    
   
  Type   is   :     NS         Class   is   :     IN    
   
  Domain   name   is   :     resolver.sina.com    
   
       
   
  Resource   name   is   :     sina.com    
   
  Type   is   :     NS         Class   is   :     IN    
   
  Domain   name   is   :     ns2.sina.com    
   
       
   
       
   
  Additional   Response   List    
   
       
   
  Resource   name   is   :     mailcn.sina.com    
   
  Type   is   :     A         Class   is   :     IN    
   
  IP   Address   is   :     202.106.184.233    
   
       
   
  Resource   name   is   :     mail.sina.com.cn    
   
  Type   is   :     A         Class   is   :     IN    
   
  IP   Address   is   :     202.106.187.150    
   
       
   
  Resource   name   is   :     resolver.sina.com    
   
  Type   is   :     A         Class   is   :     IN    
   
  IP   Address   is   :     206.204.114.135    
   
       
   
  Resource   name   is   :     ns2.sina.com    
   
  Type   is   :     A         Class   is   :     IN    
   
  IP   Address   is   :     209.133.24.135    
   
       
   
       
   
  Top

3 楼jxzqsun(少年时代)回复于 2002-05-15 10:12:10 得分 0

到www.ntbar.com去看看Top

4 楼HuntHoo(猎刀)回复于 2002-05-15 11:21:03 得分 0

干吗不用现成的mail   server.Top

5 楼make11111(孙少平)回复于 2002-05-15 11:40:57 得分 0

直接用asp就可以搞定了Top

6 楼mrzho(mrzhou)回复于 2002-05-15 11:45:17 得分 0

使用MAEMON吧,该软件可以在你的局域网内建立邮局。  
  并且有中文支持,支持SMTP,POP3,WEB等方式。  
  本公司也有自己的域名,但邮箱是有限的通过该方法可以无限拥有邮箱数目,且对内对外都是有效的。Top

7 楼redbirdli(火鸟)回复于 2002-05-15 11:49:32 得分 0

Exchange2000Top

8 楼pipiyantai(皮皮)回复于 2002-05-15 17:39:37 得分 0

俺想自己编一个程序,不想用现成的,  
  用没有做过的同志给指点一下Top

9 楼taidy()回复于 2002-05-17 17:47:59 得分 0

用linux+Qmail+mysql很有挑战性,而且做到大数量级,完全免费!Top

10 楼cg1120(代码最优化-§惟坚韧者始能遂其志§)回复于 2002-05-17 17:53:26 得分 0

unit   MapiControl;    
   
  interface    
   
  uses    
      Windows,   Messages,   SysUtils,   Classes,   Graphics,   Controls,   Forms,   Dialogs;    
   
  Top

11 楼cg1120(代码最优化-§惟坚韧者始能遂其志§)回复于 2002-05-17 17:54:19 得分 0

Attachments^.flFlags   :=   0;    
                          {   Position   has   to   be   -1,   please   see   the   WinApi   Help    
                              for   details.   }    
                          Attachments^.nPosition   :=   Cardinal(-1);    
                          Attachments^.lpFileType   :=   nil;    
                          Inc(Attachments);    
                      end;    
                  end;    
                  lpFiles   :=   PFiles;    
              end    
              else    
              begin    
                  nFileCount   :=   0;    
                  lpFiles   :=   nil;    
              end;    
          end;    
   
          {   Send   the   Mail,   silent   or   verbose:    
              Verbose   means   in   Express   a   Mail   is   composed   and   shown   as   setup.    
              In   non-Express   versions   we   show   the   Login-Dialog   for   a   new    
              session   and   after   we   have   choosen   the   profile   to   use,   the    
              composed   email   is   shown   before   sending    
   
              Silent   does   currently   not   work   for   non-Express   version.   We   have    
              no   Session,   no   Login   Dialog   so   the   system   refuses   to   compose   a    
              new   email.   In   Express   Versions   the   email   is   sent   in   the    
              background.    
            }    
          if   FShowDialog   then    
              MError   :=   MapiSendMail(0,   AppHandle,   MapiMessage,   MAPI_DIALOG   or   MAPI_LOGON_UI   or   MAPI_NEW_SESSION,   0)    
          else    
              MError   :=   MapiSendMail(0,   AppHandle,   MapiMessage,   0,   0);    
   
          {   Now   we   have   to   process   the   error   messages.   There   are   some    
              defined   in   the   MAPI   unit   please   take   a   look   at   the   unit   to   get    
              familiar   with   it.    
              I   decided   to   handle   USER_ABORT   and   SUCCESS   as   special   and   leave    
              the   rest   to   fire   the   "new"   error   event   defined   at   the   top   (as    
              generic   error)    
   
              Not   treated   as   special:    
              MAPI_E_AMBIGUOUS_RECIPIENT,    
                  MAPI_E_ATTACHMENT_NOT_FOUND,    
                  MAPI_E_ATTACHMENT_OPEN_FAILURE,    
                  MAPI_E_BAD_RECIPTYPE,    
                  MAPI_E_FAILURE,    
                  MAPI_E_INSUFFICIENT_MEMORY,    
                  MAPI_E_LOGIN_FAILURE,    
                  MAPI_E_TEXT_TOO_LARGE,    
                  MAPI_E_TOO_MANY_FILES,    
                  MAPI_E_TOO_MANY_RECIPIENTS,    
                  MAPI_E_UNKNOWN_RECIPIENT:    
          }    
   
          case   MError   of    
              MAPI_E_USER_ABORT:    
                  begin    
                      if   Assigned(FOnUserAbort)   then    
                          FOnUserAbort(Self);    
                  end;    
              SUCCESS_SUCCESS:    
                  begin    
                      if   Assigned(FOnSuccess)   then    
                          FOnSuccess(Self);    
                  end    
          else   begin    
                  if   Assigned(FOnMapiError)   then    
                      FOnMapiError(Self,   MError);    
              end;    
   
          end;    
      finally    
          {   Finally   we   do   the   cleanups,   the   message   should   be   on   its   way   }    
          FreeMem(Recipients,   MapiMessage.nRecipCount   *   sizeof(TMapiRecipDesc));    
      end;    
  end;    
   
  {    
      Please   treat   this   as   free.   If   you   improve   the   component    
      I   would   be   glad   to   get   a   copy.    
  }    
   
  end.Top

12 楼anjiechang(anjie)回复于 2002-05-17 17:57:38 得分 0

delphi中不是有现在的控件吗?Top

13 楼pipiyantai(皮皮)回复于 2002-05-24 08:11:13 得分 0

如何使线多线程的功能?  
   
  能够同时响应多用户的操作Top

14 楼pipiyantai(皮皮)回复于 2002-05-24 10:04:15 得分 0

再谈邮件服务器  
   
  邮件服务器是不是应该三层结构:  
   
  1、用户通过Internet   Exploer访问  
  2、Web服务器  
  3、用SQL   Server2000建数据库表  
   
  请大家发表一下自己的看法  
  如多线程的应用,建库注意事项(每个用户一个表)等等Top

15 楼scripting(scripting)回复于 2002-05-24 17:35:29 得分 0

gfzTop

16 楼mrzho(mrzhou)回复于 2002-07-01 08:59:34 得分 0

.Top

责任编辑: efish 参与评论 查找更多:
相关文章
在pb中分页怎样实现? 在pb中分页怎样实现?
50分请教为什么用pos()取出的的字符串(如:45.6)用… 50分请教为什么用pos()取出的的字符串(如:45.6)用strtofloat转换时老是提醒不是有效的浮点值?
这两段代码为什么会互相影响,我真搞糊涂了? 这两段代码为什么会互相影响,我真搞糊涂了?
怎样判断返回的数据集为空? 怎样判断返回的数据集为空?
有安徽的朋友?? 请帮帮忙??小第万分感激!! 有安徽的朋友?? 请帮帮忙??小第万分感激!!
有谁知道SoftICE 4.05 for Windows NT/2000 的Licen… 有谁知道SoftICE 4.05 for Windows NT/2000 的License?
财务软件 财务软件
如何在sql server2000中创建数据库? 如何在sql server2000中创建数据库?
如何制作网络协议的安装程序 如何制作网络协议的安装程序
msgbox的一点问题! msgbox的一点问题!
2秒记住本站域名

玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的readygo.com.cn

分类导航
Readygo技术搜索引擎