apache james 与数据库相关的配置

1.将用户信息保存到数据库而不是文件

<users-store>
	<repository name="LocalUsers"
		class="org.apache.james.userrepository.JamesUsersJdbcRepository"
		destinationURL="db://maildb/users">
		<sqlFile>file://conf/sqlResources.xml</sqlFile>
	</repository>
</users-store>
<database-connections>
	<data-source name="maildb"
		class="org.apache.james.util.dbcp.JdbcDataSource">
		<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
		<dburl>jdbc:sqlserver://localhost:1433;SelectMethod=Cursor;DatabaseName=JAMES
		</dburl>
		<user>sa</user>
		<password>123@qwe</password>
		<max>20</max>
	</data-source>
</database-connections>

上述配置的前提是:在%james-2.3.2%lib下有相关的jdbc驱动包。

2.如何将发送的邮件保存到数据库

<!--文件方式
		<inboxRepository>
			<repository destinationURL="file://var/mail/inboxes/" type="MAIL"/>
		</inboxRepository>-->
		<!-- Alternative inbox repository definition for DB use. -->
		<!-- The format for the destinationURL is "db://<data-source>/<table>" -->
		<!-- <data-source> is the datasource name set up in the database-connections block, below -->
		<!-- <table> is the name of the table to store user inboxes in -->
		<!-- The user name is used as <repositoryName> for this repository config. -->
		<!--database-->
		<inboxRepository>
			<repository destinationURL="db://maildb/inbox/" type="MAIL"/>
		</inboxRepository>

还有一个就是

<spoolrepository destinationURL="db://maildb/spool/spool" type="SPOOL"/>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值