下載地址
下載列表
https://james.apache.org/download.cgi
直接下載基于guide版本
https://www.apache.org/dyn/closer.lua/james/server/3.8.0/james-server-jpa-guice.zip
設(shè)置簽名
解壓,并切換到j(luò)ames-server-jpa-guice目錄下,在powershellli執(zhí)行
keytool -genkey -alias james -keyalg RSA -keystore conf/keystore
密碼設(shè)置為:
james72laBalle
默認(rèn)使用derby,如果需要切換到MYSQL數(shù)據(jù)庫的話,放到后面講
修改domainlist.xml文件
原內(nèi)容
<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文件
原內(nèi)容
<context>
<!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended.
You can configure it to (for example) <postmaster>postmaster@myDomain.com</postmaster> -->
<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>postmaster@myDomain.com</postmaster> -->
<postmaster>postmaster@bo.com</postmaster>
</context>
修改pop3server.xml文件(可選)(默認(rèn)是關(guān)閉的)
開啟pop3協(xié)議
原內(nèi)容
<pop3server enabled="false">
修改為
<pop3server enabled="true">
啟動
在james-server-jpa-guice目錄下執(zhí)行
java -javaagent:james-server-jpa-app.lib/openjpa-3.2.0.jar -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048 -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-app.jar
使用mysql數(shù)據(jù)庫
吐槽
放到后面來講是因?yàn)橐雑dbc這塊浪費(fèi)了很長時(shí)間
官網(wǎng)推薦是使用 -cp的命令引入jdbc的jar包來啟動,我搗鼓了很久都沒有啟動成功,一直提示找不到main方法所以放棄了-cp的方式。
java -javaagent:james-server-jpa-app.lib/openjpa-3.2.0.jar -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048 -Dlogback.configurationFile=conf/logback.xml -cp "james-server-jpa-app.jar:james-server-jpa-app.lib/*:jdbc-driver.jar" org.apache.james.JPAJamesServerMain
解決
修改文件
1、將mysql的jdbc的jar包放到j(luò)ames-server-jpa-app.lib下,并命名為jdbc.jar
2、使用工具打開james-server-jpa-app.jar文件,定位到META-INF目錄下,編輯MANIFEST.MF文件
3、滾動到最下方,在Main-Class: org.apache.james.JPAJamesServerMain的上方,james-ser
ver-jpa-app.lib/awaitility-4.2.0.jar后面增加一句 james-server-jpa-app.lib/jdbc.jar
如下圖文章來源:http://www.zghlxwxcb.cn/news/detail-824969.html
創(chuàng)建數(shù)據(jù)庫
在數(shù)據(jù)庫中創(chuàng)建名為james的數(shù)據(jù)庫文章來源地址http://www.zghlxwxcb.cn/news/detail-824969.html
修改 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.Driver
database.url=jdbc:mysql://192.168.xx.xx:3306/james?zeroDateTimeBehavior=convertToNull
database.username=root
database.password=root
vendorAdapter.database=MYSQL
到了這里,關(guān)于windows安裝運(yùn)行Apache James(基于guide的版本)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!