用Apache James 3.3.0 搭建个人邮箱服务器

  • 准备域名

  比如域名为example.net,则邮箱格式为test@example.net。在自己的域名管理界面,添加一条A记录(mail.example.net  xxx.xxx.xxx.xxx),指向服务器公共IP地址;再添加一条MX记录(空,mail.example.net)。若没有域名,无法收发外网邮件。

  如果只需要在内网收发邮件,可以在C:\Windows\System32\drivers\etc目录下的host文件中,添加一条记录(本机IP example.net)来充当域名。

  • 下载apache james 3.3.0,解压后,目录如下图所示

  

  • 配置james

  进入conf目录

  domainlist.xml,将相应位置内容修改为

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

  mailetcontainer.xml,将相应位置的内容修改为

<context>
  <postmaster>postmaster@example.net</postmaster>
</context>

smtpserver.xml,将相应位置内容修改为

<helloName autodetect="true">example.net</helloName>

  • 启动james

由于james需要java运行环境,所以需要提交安装jdk 1.7及以上版本

进入bin目录,用命令窗口启动run.bat文件

  • 添加邮箱账号

james-cli.bat -h localhost -p 9999 adddomain example.net
james-cli.bat -h localhost -p 9999 adduser test1@example.net 111111

执行后,即添加了一个邮箱账号test1@example.net,密码为111111

  • 用foxmail测试

安装foxmail后,右上角菜单-账号管理-账号-新建-手动设置,信息如下所示,其中POP服务器、SMTP服务器均填写之前配置的域名mail.example.net

 

 

附上apache james 3.3.0及java jdk链接: https://pan.baidu.com/s/1bsg-6uo8rDvPlUEJm65-pg 提取码: ktu4 

 

posted @ 2019-04-01 16:49  AI柚子  阅读(3489)  评论(2编辑  收藏  举报