windows安装运行Apache James(基于spring的版本)

下载地址

下载列表
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执行

bash 复制代码
keytool -genkey -alias james -keyalg RSA -keystore conf/keystore

密码设置为:

bash 复制代码
james72laBalle

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

创建数据库

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

修改 conf/james-database.properties

注释

java 复制代码
#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

添加

java 复制代码
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

添加jdbc的jar包

将mysql的jar包,扔到lib文件夹下

这里我用的是mysql-connector-j-8.0.33.jar

修改domainlist.xml文件

原内容

xml 复制代码
<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
   <autodetect>false</autodetect>
   <autodetectIP>false</autodetectIP>
   <defaultDomain>localhost</defaultDomain>
</domainlist>

修改为

xml 复制代码
<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
   <autodetect>false</autodetect>
   <autodetectIP>false</autodetectIP>
   <defaultDomain>bo.com</defaultDomain>
</domainlist>

修改mailetcontainer.xml文件

@@@@第一处@@@@

原内容

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>postmaster@myDomain.com</postmaster> -->
        <postmaster>postmaster</postmaster>
    </context>

修改为

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>postmaster@myDomain.com</postmaster> -->
        <postmaster>postmaster@bo.com</postmaster>
    </context>

@@@@第二处@@@@

直接注释掉这一段内容

原内容

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

修改为

xml 复制代码
       <!-- <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
          <processor>relay-denied</processor>
          <notice>550 - Requested action not taken: relaying denied</notice>
       </mailet>-->

启动

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

相关推荐
Par@ish9 小时前
【网络安全】Apache StreamPipes 严重漏洞使攻击者可夺取管理员控制权
安全·web安全·apache
oMcLin14 小时前
Ubuntu 22.04 配置 Apache 反向代理时无法访问后端应用:Nginx 与 Apache 配置冲突排查
nginx·ubuntu·apache
xiaoliuliu123452 天前
Apache JMeter 2.9 简单上手教程(附下载包)
jmeter·apache
DigitalOcean2 天前
Ubuntu/Debian VPS 上 Apache Web 服务器的完整配置教程
ubuntu·apache
java_logo3 天前
Apache Flink Docker 容器化部署指南
docker·flink·apache·apache flink·apache flink部署·flink部署文档·flink部署教程
彭于晏Yan3 天前
Apache Kafka使用
kafka·apache
彦楠3 天前
Apache Commons Lang 中 Pair 类的使用教程
java·apache
Apache IoTDB3 天前
Apache IoTDB 社区荣获开放原子开发者大会多项殊荣丨「开源、产学研用融合」双认可
开源·开放原子·apache·iotdb
SelectDB3 天前
5 倍性能提升,Apache Doris TopN 全局优化详解|Deep Dive
数据库·apache
zhougl9963 天前
Vuex 模块命名冲突:问题解析与完整解决方案
linux·服务器·apache