下载地址

下载列表
https://james.apache.org/download.cgi
直接下载基于spring版本
https://www.apache.org/dyn/closer.lua/james/server/3.8.0/james-server-app-3.8.0-app.zip

设置签名

解压,并切换到james-server-spring-app-3.8.0目录下,在powershellli执行

keytool -genkey -alias james -keyalg RSA -keystore conf/keystore

密码设置为:

james72laBalle

修改数据库为MYSQL配置(可跳过,默认使用derby)

创建数据库

在数据库中创建名为james的数据库

修改 conf/james-database.properties

注释

#database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver#database.url=jdbc:derby:../var/store/derby;create=true#database.username=app#database.password=app#vendorAdapter.database=DERBY

添加

database.driverClassName=com.mysql.cj.jdbc.Driverdatabase.url=jdbc:mysql://192.168.xx.xx:3306/james?zeroDateTimeBehavior=convertToNulldatabase.username=rootdatabase.password=rootvendorAdapter.database=MYSQL

添加jdbc的jar包

将mysql的jar包,扔到lib文件夹下
这里我用的是mysql-connector-j-8.0.33.jar

修改domainlist.xml文件

原内容

<domainlist class="org.apache.james.domainlist.jpa.JPADomainList"> <autodetect>false</autodetect> <autodetectIP>false</autodetectIP> <defaultDomain>localhost</defaultDomain></domainlist>

修改为

<domainlist class="org.apache.james.domainlist.jpa.JPADomainList"> <autodetect>false</autodetect> <autodetectIP>false</autodetectIP> <defaultDomain>bo.com</defaultDomain></domainlist>

修改mailetcontainer.xml文件

@@@@第一处@@@@

原内容

<context><!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended.You can configure it to (for example) postmaster@myDomain.com --><postmaster>postmaster</postmaster></context>

修改为

<context><!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended.You can configure it to (for example) postmaster@myDomain.com --><postmaster>postmaster@bo.com</postmaster></context>

@@@@第二处@@@@

直接注释掉这一段内容

原内容

 <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor"><processor>relay-denied</processor><notice>550 - Requested action not taken: relaying denied</notice> </mailet>

修改为

 <!-- relay-denied550 - Requested action not taken: relaying denied -->

启动

执行bin目录下的run.bat启动