zoukankan      html  css  js  c++  java
  • Postfix与Dovecot

    配置主机名称

    [root@localhost ~]# vim /etc/hostname
    mail.linuxprobe.com
    [root@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@linuxprobe ~]# yum install bind-chroot
    [root@linuxprobe ~]# systemctl restart named
    [root@linuxprobe ~]# systemctl enable named
    ln -s '/usr/lib/systemd/system/named.service' '/etc/systemd/system/multi-user.target.wants/named.service'
     10 options {
     11         listen-on port 53 { any; };
     12         listen-on-v6 port 53 { ::1; };
     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";
     17         allow-query     { any; };
     18 
    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@linuxprobe named]# nmtui

     配置Postfix服务程序

    [root@linuxprobe ~]# yum install postfix
    Loaded plugins: fastestmirror, langpacks
    ding                                              | 3.6 kB     00:00     
    Loading mirror speeds from cached hostfile
    Package 2:postfix-2.10.1-6.el7.x86_64 already installed and latest version
    Nothing to do
    [root@linuxprobe ~]# systemctl restart postfix
    [root@linuxprobe ~]# systemctl enable postfix
    [root@linuxprobe ~]# systemctl disable iptables
    [root@localhost ~]# vim /etc/postfix/main.cf
    75 myhostname = mail.linuxprobe.com
    83 mydomain = linuxprobe.com
    98 myorigin = $mydomain
    113 inet_interfaces = all
    163 mydestination = $myhostname, $mydomain
    
    [root@localhost ~]# systemctl restart postfix
    [root@linuxprobe ~]# useradd ding
    [root@linuxprobe ~]# su - ding
    [ding@mail ~]$ exit
    logout
    [root@linuxprobe ~]# passwd ding
    Changing password for user ding.
    New password: 
    BAD PASSWORD: The password is shorter than 8 characters
    Retype new password: 
    passwd: all authentication tokens updated successfully.

    配置Dovecot服务程序

    [root@linuxprobe ~]# yum install dovecot -y
    [root@linuxprobe ~]# systemctl restart dovecot
    [root@linuxprobe ~]# systemctl enable dovecot
    ln -s '/usr/lib/systemd/system/dovecot.service' '/etc/systemd/system/multi-user.target.wants/dovecot.service'
    [root@localhost ~]# 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 ~]# vim /etc/dovecot/conf.d/10-mail.conf
    25    mail_location = mbox:~/mail:INBOX=/var/mail/%u
    
    [root@localhost ~]# systemctl restart dovecot
    [root@linuxprobe ~]# su - ding
    Last login: Thu Feb  6 17:28:06 CST 2020 on pts/0
    [ding@mail ~]$ mkdir -p mail/.imap/INBOX
    [ding@mail ~]$ ls
    mail
    [ding@mail ~]$ ll
    total 0
    drwxrwxr-x. 3 ding ding 18 Feb  6 17:29 mail
    [ding@mail ~]$ exit
    logout
    [root@linuxprobe ~]# 
  • 相关阅读:
    应用安全
    协议
    应用安全
    数据库-redis
    应用安全
    WEB中间件--Jboss未授权访问,加固,绕过
    WEB中间件--tomcat爆破,burp和python脚本,getshell,war包
    WEB中间件漏洞--IIS
    文件包含漏洞(RFI)
    sql注入记录------类型转换错误---convert()函数,一句话图片马制作
  • 原文地址:https://www.cnblogs.com/dinghailong128/p/12178409.html
Copyright © 2011-2022 走看看