俊星的BLOG

          JAVA MAIL之試用JAMES

          JAMES是一個純java的郵件服務器,APACHE出品,關于JAMES的更多內容請查看官方網站的說明。
          1)、配置config.xml(apps\james\SAR-INF)文件:
          <servernames autodetect="true" autodetectIP="true">
              
          <servername>test.com</servername>
          </servernames>

          <dnsserver>
              
          <servers>
                  
          <!--Enter ip address of your DNS server, one IP address per server -->
                  
          <server>127.0.0.1</server>
                  
          <server>211.148.192.136</server>
              
          </servers>
          </dnsserver>
          2)、啟動JAMSES 服務器:
          運行bin\run.bat,輸出如下:
          Using PHOENIX_HOME:   F:\dev\james-2.3.1
          Using PHOENIX_TMPDIR: F:\dev\james-
          2.3.1\temp
          Using JAVA_HOME:      D:\Program Files\Java\jdk1
          .5.0_16

          Phoenix 
          4.2

          James Mail Server 
          2.3.1
          Remote Manager Service started plain:
          4555
          POP3 Service started plain:
          110
          SMTP Service started plain:
          25
          NNTP Service started plain:
          119
          FetchMail Disabled

          3)創建一個用戶test:
          命令“telnet localhost 4555”,交互過程如下:
          JAMES Remote Administration Tool 2.3.1
          Please enter your login and password
          Login id:
          root
          Password:
          root
          Welcome root. HELP for a list of commands
          adduser test test
          User test added
          quit
          Bye

          4)發送一封郵件:
          命令“telnet localhost 25”,交互過程:
          220 kinkding-d1d01d SMTP Server (JAMES SMTP Server 2.3.1) ready Sat, 25 Apr 2009 11:07:52 +0800 (CS
          ehlo test.com
          250-kinkding-d1d01d Hello test.com (localhost [127.0.0.1])
          250-PIPELINING
          250 ENHANCEDSTATUSCODES
          mail from:<foo@test.com>
          250 2.1.0 Sender <foo@test.com> OK
          rcpt to:<test@test.com>
          250 2.1.5 Recipient <test@test.com> OK
          data
          354 Ok Send data ending with <CRLF>.<CRLF>
          subject:this is hello world email
          har ^_^ good haha
          .
          250 2.6.0 Message received
          quit
          221 2.0.0 kinkding-d1d01d Service closing transmission channel

          5)到服務器查看郵件內容:
          F:\dev\james-2.3.1\apps\james\var\mail\inboxes\test>ls
          4D61696C313234303632393039333837352D30.Repository.FileObjectStore
          4D61696C313234303632393039333837352D30.Repository.FileStreamStore
          F:\dev\james-
          2.3.1\apps\james\var\mail\inboxes\test>more 4D61696C313234303632393039333837352D30.Repos*StreamStore
          Return-Path: <foo@test.com>
          Message-ID: <
          24964246.01240629093921.JavaMail.kinkding@kinkding-d1d01d>
          MIME-Version: 
          1.0
          Content-Type: text/plain
          ; charset=us-ascii
          Content-Transfer-Encoding: 7bit
          Delivered-To: test@test.com
          Received: from localhost (
          [127.0.0.1])
                    by kinkding-d1d01d (JAMES SMTP Server 
          2.3.1) with SMTP ID 760
                    for <test@test.com>
          ;
                    Sat, 25 Apr 2009 11:11:33 +0800 (CST)
          Date: Sat
          , 25 Apr 2009 11:11:33 +0800 (CST)
          From: foo@test.com
          subject:this is hello world email
          har ^_^ good haha

          posted on 2009-04-25 11:51 俊星 閱讀(640) 評論(0)  編輯  收藏 所屬分類: 代碼庫

          主站蜘蛛池模板: 彭山县| 石阡县| 方城县| 武功县| 石渠县| 清丰县| 呼图壁县| 砀山县| 彰化市| 通河县| 潞西市| 香格里拉县| 富源县| 镇巴县| 景泰县| 邢台市| 资溪县| 乾安县| 友谊县| 万荣县| 连山| 乐至县| 古丈县| 望江县| 乌拉特后旗| 深州市| 陕西省| 东阳市| 新营市| 竹山县| 江城| 宜章县| 延边| 木兰县| 宣城市| 禄丰县| 改则县| 竹北市| 天祝| 天长市| 开封县|