码迷,mamicode.com
首页 > 其他好文 > 详细

Postfix

时间:2018-05-20 13:10:30      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:master   安装   refresh   har   director   文件   ilb   cache   域名   

**************************************************************************************************
◆案例1◆ Postfix + Dovecot - 简易邮件服务器搭建
**************************************************************************************************

1.搭建DNS域名解析,解析邮件地址

a).安装bind

yum install -y bind


b).修改DNS配置文件 <只做一个正向邮件交换记录即可>

编辑配置文件,在相应的区域中修改以下标★语句
--------------------------------------------------------------------------------------------------------------
vim /etc/named.conf

10 options {
★ listen-on port 53 { any; };
★ listen-on-v6 port 53 { ::any; };
13 directory "/var/named";
14 dump-file "/var/named/data/cache_dump.db";
15 statistics-file "/var/named/data/named_stats.txt";
16 memstatistics-file "/var/named/data/named_mem_stats.txt";
★ allow-query { any; };
18

★ zone "lyshark.com." IN {
★ type master;
★ file "lyshark.com.zone";
★ };
59
60 #include "/etc/named.rfc1912.zones";
--------------------------------------------------------------------------------------------------------------

cp -a named.localhost lyshark.com.zone

c).编辑配置文件
--------------------------------------------------------------------------------------------------------------
vim /var/named/lyshark.con.zone

$TTL 1D
@ IN SOA dns.lyshark.com. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS dns.lyshark.com.
MX 3 mail.lyshark.com.
dns A 127.0.0.1
mail A 192.168.1.12
--------------------------------------------------------------------------------------------------------------

systemctl restart named


2.配置邮件服务器,邮件服务器是默认安装的直接配置即可

--------------------------------------------------------------------------------------------------------------
vim /etc/postfix/main.cf

myhostname = mail.lyshark.com #当前邮件服务器的主机名
mydomain = lyshark.com #指定邮件域

myorigin = $myhostname #设置允许发信的用户的邮件域
myorigin = $mydomain #例:lyshark@lyshark.com

inet_interfaces = all #侦听所有地址,取消注释
#inet_interfaces = localhost #注释掉


#mydestination = $myhostname, localhost.$mydomain, localhost #设置取出那些邮件,注释本行
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain #取消注释


home_mailbox = Maildir/ #设置邮件的位置

--------------------------------------------------------------------------------------------------------------

3.安装邮件检索代理,来查看接收的邮件

yum install -y dovecot dovecot-devel

systemctl restart dovecot


4.新建用户测试邮件是否正常

useradd -s /sbin/nologin lyshark
passwd lyshark

useradd -s /sbin/nologin alert
passwd alert

Postfix

标签:master   安装   refresh   har   director   文件   ilb   cache   域名   

原文地址:https://www.cnblogs.com/LyShark/p/9062812.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!