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启动

相关推荐
SelectDB技术团队3 小时前
构建 AI 数据基座:思必驰基于 Apache Doris 的海量多模态数据集管理实践
人工智能·apache·知识图谱
你才是臭弟弟4 小时前
Apache Iceberg+Apache Flink(安装流程)
大数据·flink·apache
你才是臭弟弟5 小时前
Apache Iceberg核心特征
大数据·apache
沉默-_-1 天前
微信小程序页面配置详解
学习·微信小程序·apache·微信开发者工具
SeaTunnel1 天前
Apache SeaTunnel MySQL CDC 支持按时间启动吗?
大数据·数据库·mysql·开源·apache·seatunnel
weixin_462446232 天前
Java 使用 Apache Batik 将 SVG 转换为 PNG(指定宽高)
java·apache·svg转png
学习3人组2 天前
Apache Superset开源现代化数据BI工具
开源·apache
SelectDB技术团队2 天前
AI 能力揭秘(五):Apache Doris 原生向量检索的设计及实现
人工智能·apache
Apache IoTDB2 天前
Apache IoTDB V2.0.6/V1.3.6 发布|新增查询写回功能,优化查询与同步性能
apache·iotdb
世界尽头与你3 天前
CVE-2025-48976_ Apache Commons FileUpload 安全漏洞
网络安全·渗透测试·apache