Postfix与Dovecot

Posted dinghailong128

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Postfix与Dovecot相关的知识,希望对你有一定的参考价值。

配置主机名称

oot@localhost ~]# vim /etc/hostname

mail.linuxprobe.com

oot@localhost ~]# hostname

mail.linuxprobe.com

[root@localhost ~]# iptables -F

[root@localhost ~]# service iptables save

iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

 

 

安装DNS服务

[root@localhost ~]# yum install bind-chroot

[root@localhost ~]# vim /etc/named.rfc1912.zones

zone "linuxprobe.com" IN {

        type master;

        file "linuxprobe.com.zone";

        allow-update { none; };

}

 

[root@localhost ~]# cd /var/named

[root@localhost named]# ls

chroot  dynamic   named.empty      named.loopback

data    named.ca  named.localhost  slaves

 

[root@localhost named]# cp -a named.localhost linuxprobe.com.zone

[root@localhost named]# vim linuxprobe.com.zone

$TTL 1D

@       IN SOA  @ linuxprobe.com. root.linuxprobe.com. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        NS      ns.linuxprobe.com.

ns      IN A    192.168.10.10

@       IN MX   10 mail.linuxprobe.com.

mail    IN A    192.168.10.10

 

[root@localhost named]# systemctl restart named

~[root@localhost named]# systemctl enable named

ln -s ‘/usr/lib/systemd/system/named.service‘ ‘/etc/systemd/system/multi-user.target.wants/named.service‘

 

[root@localhost named]# vim /etc/postfix/main.cf

75 myhostname = mail.linuxprobe.com

83 mydomain = linuxprobe.com

98 myorigin = $mydomain

115 inet_interfaces = all

163 mydestination = $myhostname, $mydomain

 

[root@localhost named]# systemctl restart postfix

[root@localhost named]# systemctl enable postfix

 

[root@localhost named]# useradd xiaoguo

[root@localhost named]# su - xiaoguo

[xiaoguo@mail ~]$ exit

logout

t@localhost named]# passwd xiaoguo

 

 

[root@localhost named]# yum install dovecot

[root@localhost named]# vim /etc/dovecot/dovecot.conf

24 protocols = imap pop3 lmtp

25 disable_plaintext_auth=no

48 login_trusted_networks = 192.168.10.0/24

 

[root@localhost named]# vim /etc/dovecot/conf.d/10-mail.conf

25    mail_location = mbox:~/mail:INBOX=/var/mail/%u

 

[root@localhost named]# su - xiaoguo

Last login: Tue Aug 13 22:14:52 CST 2019 on pts/0

[xiaoguo@mail ~]$ mkdir -p mail/.iamp/INBOX

[xiaoguo@mail ~]$ exit

logout

 

[root@localhost named]# systemctl restart dovecot

[root@localhost named]# systemctl enable dovecot

ln -s ‘/usr/lib/systemd/system/dovecot.service‘ ‘/etc/systemd/system/multi-user.target.wants/dovecot.service‘

[root@localhost named]# iptables -F

 

以上是关于Postfix与Dovecot的主要内容,如果未能解决你的问题,请参考以下文章

liunx postfix与sendmail 开启与关闭

15 使用Postfix与Dovecot部署邮件系统

使用Postfix与Dovecot部署邮件系统

Postfix与SendGrid集成,但后来停止发送电子邮件

Postfix邮件系统安装与配置:Postfix,Cyrus-IMAP,Cyrus-sasl,Dovecot和SPF

烂泥:Postfix邮件服务器搭建之软件安装与配置