JAVA MAIL之试用JAMES

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:<[email protected]>
250   2.1.0  Sender <[email protected]> OK
rcpt to:<[email protected]>
250   2.1.5  Recipient <[email protected]> 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: <[email protected]>
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: [email protected]
Received: from localhost (
[ 127.0.0.1 ] )
          by kinkding-d1d01d (JAMES SMTP Server 
2.3.1 ) with SMTP ID  760
          for <[email protected]>
;
          Sat ,   25  Apr  2009   11 : 11 : 33  + 0800  (CST)
Date: Sat
,   25  Apr  2009   11 : 11 : 33  + 0800  (CST)
From: [email protected]
subject:this is hello world email
har ^_^ good haha

你可能感兴趣的:(JAVA MAIL之试用JAMES)