俊星的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 俊星 閱讀(639) 評論(0)  編輯  收藏 所屬分類: 代碼庫

          主站蜘蛛池模板: 抚远县| 阜南县| 洛宁县| 天气| 年辖:市辖区| 鄂温| 苍南县| 纳雍县| 关岭| 博湖县| 桦南县| 鄂尔多斯市| 德江县| 凤翔县| 龙里县| 咸宁市| 巢湖市| 河曲县| 太和县| 承德市| 班玛县| 泸西县| 连城县| 盐津县| 天长市| 拜城县| 宁津县| 尼勒克县| 阳新县| 兰州市| 和顺县| 兴山县| 西畴县| 黄骅市| 瑞昌市| 高密市| 仪陇县| 加查县| 纳雍县| 四川省| 罗江县|