`
eimhee
  • 浏览: 2167873 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ubuntu 下安装邮件服务器EXIM4+dovecot

阅读更多

先简单介绍一下EXIM4, EXIM4 是一个邮件传送代理(MTA), EXIM4可以替代linux 下的SendEmail, 配置很简单,

需要注意的是EXIM4只是用来传送邮件, 收取邮件需要安装POP, IMAP软件。

 

官方解释

exim 写道
Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet. It is freely available under the terms of the GNU General Public Licence. In style it is similar to Smail 3, but its facilities are more general. There is a great deal of flexibility in the way mail can be routed, and there are extensive facilities for checking incoming mail. Exim can be installed in place of Sendmail, although the configuration of Exim is quite different.

 

 

关于EXIM4的中文资料比较少, 我发了不少时间在这上面,才配置好了。

 

设置DNS解析添加MX记录

我这里用的是bind 9 ,

配置如下:

 

@ IN NS example.com.
@ IN MX mail.example.com.
mail IN A 46.249.37.131

 

反向解析, 这一步骤不是必须的, 但如果你不想GOOGLE把你的邮件当垃圾服务器, 这个需要加上

 

@ IN NS example.com.
131 IN PTR example.com.
131 IN PTR mail.example.com.

 

remove sendmail

rm -f /usr/lib/sendmail

 

 

安装 EXIM4

 
Install the exim4 package from the Main repository using your favorite package manager (see InstallingSoftware).
 
sudo apt-get install exim4

 

配置EXIM4使用下面这个命令

 

 
sudo dpkg-reconfigure exim4-config

 

 

The user interface will be displayed. The user interface lets you configure many parameters. For example, In exim4 the configuration files are split among multiple files. If you wish to have them in one file you can configure accordingly in this user interface.

All the parameters you configure in the user interface are stored in /etc/exim4/update-exim4.conf.conf file. If you wish to re-configure the program, either re-run the configuration wizard or manually edit this file using your favourite editor. Run the following command to generate the master configuration file:

 

 

SMTP Authentication

利用OPENSSl生成证书

 
sudo /usr/share/doc/exim4-base/examples/exim-gencert

 

编辑 /etc/exim4/conf.d/main/03_exim4-config_tlsoptions

在最后面加上

 
MAIN_TLS_ENABLE = yes

 

编辑 /etc/exim4/conf.d/auth/30_exim4-config_examples

去掉 plain_saslauthd_server 和 login_saslauthd_server 的注释

 

 
plain_saslauthd_server:
driver = plaintext
public_name = PLAIN
server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}
server_set_id = $auth2
server_prompts = :
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
#
login_saslauthd_server:
driver = plaintext
public_name = LOGIN
server_prompts = "Username:: : Password::"
# don't send system passwords over unencrypted connections
server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}
server_set_id = $auth1
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif

 

最后重启EXIM4

 
sudo update-exim4.conf
sudo /etc/init.d/exim4 restart

 

 

设置SASL

Configuring SASL

 

首先安装sasl2-bin

sudo apt-get install sasl2-bin

 

编辑/etc/default/saslauthd, 让SAS能启动

 
START=yes

 

安装后会自动生成一个用 Debian-exim

把它加入组,不然会没有权限的

 
sudo adduser Debian-exim sasl

 

重起SASL

 
sudo /etc/init.d/saslauthd start

 Exim4 is now configured with SMTP AUTH using TLS and SASL authentication.

 

EXIM4就实现了SMTP验证和使用TLS

 

 

这个时候EXIM4的配置应该是这样的  vi /etc/exim4/update-exim4.conf.conf

dc_eximconfig_configtype='internet'
dc_other_hostnames='inkebook.com'
dc_local_interfaces='127.0.0.1:46.249.37.131'
dc_readhost=''
dc_relay_domains='*'
dc_minimaldns='false'
dc_relay_nets='admin@inkebook.com'
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

 

先测试一下能不能发邮件

 

 
echo "my test" | mail -s "test message" admin@inkebook.com

 

tail -f /var/log/exim4

 如果发送成功, 会在日志当中显示出来

 

 

这个时候用客户端还不是收发邮件的, 还需要装dovecot或者courier, 这里用courier

 

apt-get install courier-imap courier-imap-ssl

 

为了让POP也支持, 安装

 

apt-get install courier-pop and courier-pop-ssl

 

生成邮件目录

cd ~
maildirmake Maildir
maildirmake Maildir/.Drafts
maildirmake Maildir/.Sent
maildirmake Maildir/.Trash
maildirmake Maildir/.Templates
chmod -R 700 Maildir

 

现在我们可以用outlook foxmail 来测试了。

 

如果saslauthd认证有问题, 可以用下面方法调试

 

testsaslauthd -f /var/spool/postfix/var/run/saslauthd/mux -u username -p password

 

 

 

我们的邮件服务器到此就配置好了, 可以说在LINUX下配置邮件服务器是一件比较难的事情, 需要这么多步骤。

 

 

1
1
分享到:
评论

相关推荐

    POP IMAP 服务器的构建( Dovecot ).docx

    Dovecot还支持与其他邮件系统如Postfix、Exim的集成,提供完整的邮件接收、发送和管理解决方案。对于大型企业或高流量的邮件服务器,可能还需要考虑负载均衡、备份策略和性能优化。 总的来说,Dovecot作为一个强大...

    邮件服务器,可以自己做收发邮件功能,这个服务器是必须的

    邮件服务器的基本工作原理基于SMTP(Simple Mail Transfer Protocol)协议,用于发送邮件,而POP3(Post Office Protocol version 3)或IMAP4(Internet Message Access Protocol version 4)协议则用于接收邮件。...

    linux as 4 下配置邮件服务器文档

    总之,Linux AS 4下的邮件服务器配置涉及DNS设置、邮件传输服务(如Postfix)、邮件存储服务(如Dovecot)以及Webmail服务(如OpenWebMail)。每个环节都需要细致的配置和调试,以确保系统的稳定和安全运行。通过这...

    使用Debian8搭建Exim4邮箱系统

    Exim4 + mysql + clamav * 用 apt-get , testing main 1. 按裝好debian 8.0最小,不要設定exim 先安装好SSH

    基于Linux的邮件服务器的构建

    例如,我们可能会选用Exim、Postfix或者Sendmail作为MTA(Mail Transfer Agent),Dovecot或Courier作为IMAP/POP3服务器,以及Roundcube或SquirrelMail作为Webmail接口。 安装和配置邮件服务器软件是整个过程中最...

    简单邮件服务器例子

    - **选择软件**:常见的开源邮件服务器软件有Postfix、Exim、Sendmail等。对于初学者,Postfix因其易于配置和管理,成为首选。 - **安装**:在Linux环境下,可以通过包管理器(如`apt-get`或`yum`)安装Postfix。 ...

    在debian下用Exim4发送邮件的方法.docx

    "在 Debian 下用 Exim4 发送邮件的方法" 本文档将详细介绍如何在 Debian 操作系统下使用 Exim4 发送邮件,包括两种方式:直接使用 SMTP 发信和使用 smarthost 发信。同时,也将介绍相关的配置文件修改和注意事项。 ...

    邮箱服务器搭建教程

    常用的邮件服务器软件包括Postfix、Exim、Sendmail等,本教程以Postfix为例介绍安装过程: 1. **安装Postfix**: - 打开终端,输入以下命令安装Postfix: ```bash sudo apt-get update sudo apt-get install ...

    邮件管理_Program.rar_邮件服务器

    - 开源项目:参与像Postfix、Dovecot这样的开源邮件服务器项目的开发和维护,通过实践提升技能。 - 社区论坛:Stack Overflow、Reddit等社区中讨论邮件服务器问题,获取解答和经验分享。 总之,理解邮件服务器的...

    Linux Mail邮件服务器

    在Linux环境中,除了SendMail,还有其他邮件服务器选项,如Postfix、Exim和Dovecot。这些服务器同样基于SMTP协议,但可能提供了更现代的功能和更高的安全性。例如,Postfix以其简单、安全和高效的特性受到青睐,而...

    Linux邮件服务器软件比较

    当前,运行在Linux环境下免费的 邮件服务器,或者称为MTA(Mail Transfer Agent)有若干种选择,比较常见的有Sendmail、Qmail、Postfix、 exim及Zmailer等等。本文希望通过对几种影响相对来说比较大的主流Linux环境下...

    WnerverP范文 SMTP邮件服务器搭建详细图解教程.pdf

    然而,随着技术的发展,现在可能有更多的现代解决方案,如使用开源邮件服务器软件(如Postfix或Exim)或者云托管的邮件服务,这些都提供了更多功能和更高级的安全性。但Windows Server 2003的这一方法仍然对于学习...

    邮件服务器 邮件客户端

    MTA如Postfix或Exim,通常运行在服务器端,处理邮件的接收、发送和转发。它们遵循SMTP(简单邮件传输协议)标准,确保邮件在网络中正确传递。当一个邮件客户端发送邮件时,邮件首先被送到本地MTA,然后MTA通过DNS...

    帮你选择一款最好的免费邮件服务器

    - **背景与目标**:Postfix是在IBM的支持下由Wietse Venema开发的一款邮件服务器软件,旨在为用户提供一种不同于Sendmail的邮件服务选择。 - **性能**:Postfix相较于同类产品具有更快的速度,一台安装了Postfix的...

    ipv6邮件服务器与客户端.rar

    配置IPv6支持的SMTP服务器,如Postfix或Exim,可以确保邮件在全球范围内的顺利发送,尤其是在IPv6逐渐普及的地区。 POP3(Post Office Protocol version 3)和IMAP(Internet Message Access Protocol)则是常用的...

    日常了解的资料\邮件服务器安装与配置 .rar北大青鸟技术教程

    【邮件服务器安装与配置】 邮件服务器是企业内部通信和外部交流的重要工具,它负责接收、存储和转发电子邮件。本教程主要关注的是北大青鸟技术教程中的邮件服务器搭建和管理,适用于初学者和有一定IT背景的技术人员...

    轻松搭建邮件服务器.docx

    1. **选择邮件服务器软件**:常见的邮件服务器软件有Postfix、Exim、Sendmail等。新手推荐使用Postfix,因为其配置相对简单且功能强大。 2. **安装和配置操作系统**:通常,Linux系统是首选,如Ubuntu、CentOS等。...

    企业邮件服务器系统

    4. **防病毒和反垃圾邮件保护**:为了保护网络不受恶意软件和垃圾邮件的侵害,邮件服务器通常集成了防病毒和反垃圾邮件模块,如ClamAV和SpamAssassin。 5. **身份验证和授权**:邮件服务器需要进行用户身份验证,以...

    邮件服务器

    1. 安装与配置:邮件服务器软件如Postfix、Exim、Sendmail或Microsoft Exchange需要正确安装并在服务器上配置。这涉及到设置域名、DNS记录(MX记录指定邮件服务器)、SSL证书以确保通信安全,以及端口设置(如SMTP的...

Global site tag (gtag.js) - Google Analytics