Linux服务器---邮件服务安装postfix

简介: 安装postfix      postfix是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。1、安装postfix       [root@localhost ~]# rpm -qa | grep postfix      [root@localhos...
安装postfix
      postfix是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。
1、安装postfix 
      [root@localhost ~]#  rpm -qa | grep postfix
      [root@localhost ]#  yum install -y postfix
      Loaded plugins: fastestmirror, refresh-packagekit, security                                                 
      Complete!
      [root@localhost]# 

2、配置postfix,编辑配置文件“/etc/postfix/main.cf”
      [root@localhost ~]#  gedit /etc/postfix/main.cf
      mydomain = david.cn      //dns中的域名
      myhostname = mailsrv.david.cn   //dns中的域名
      mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
      inet_interfaces = all   //允许处理所有网路信息
      inet_protocols = all    //允许ipv4和ipv6
      mynetworks = 192.168.0.0/24, 127.0.0.0/8     //允许接入的ip段


3、设置防火墙,postfix使用25端口 
      [root@localhost ~]#  gedit /etc/sysconfig/iptables
       -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT

      [root@localhost ~]#  service iptables restart
      iptables:将链设置为政策 ACCEPT:filter nat                [确定]
      iptables:清除防火墙规则:                                 [确定]
      iptables:正在卸载模块:                                   [确定]
      iptables:应用防火墙规则:                                 [确定]
      iptables:载入额外模块:nf_conntrack_ftp                   [确定]

4、启动服务
      [root@localhost ~]#  service postfix start
      启动 postfix:                                             [确定]
      [root@localhost ~]#

5、连接测试
      [root@localhost ~]#  telnet 192.168.0.113 25    //ip是本机地址,25是端口号
      Trying 192.168.0.113...
      Connected to 192.168.0.113.
      Escape character is '^]'.
      220 mailsrv.david.cn ESMTP Postfix

6、发信
      [root@localhost ~]#  mail david     //给david发信,确保此用户存在Linux系统中。发信人是当前登录的用户root
      Subject: test04       //标题
      hello david           //内容
      .                       //结束
      EOT
      [root@localhost ~]#  mail -u david      //查看用户david的信件
      Heirloom Mail version 12.4 7/29/08.  Type ? for help.
      "/var/mail/david": 5 messages 1 new
          1 root                  Thu Aug 16 17:07  21/692   "test"
          2 root                  Thu Aug 16 17:08  20/631   "test"
         3 root                  Thu Aug 16 17:10  20/602   "test"
          4 root                  Fri Aug 17 08:15  20/570   "test3"
      >N  5 root                  Fri Aug 17 09:46  18/539   "test04"    //此信件是刚才收到的,由root用户发出
      &
相关文章
|
9天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
60 0
|
10天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
28 0
|
10天前
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
14 0
|
10天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
15 0
|
10天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
35 0
|
10天前
|
Java Linux
Springboot 解决linux服务器下获取不到项目Resources下资源
Springboot 解决linux服务器下获取不到项目Resources下资源
|
13天前
|
Linux
linux下搭建tftp服务器教程
在Linux中搭建TFTP服务器,需安装`tftp-server`(如`tftpd-hpa`)。步骤包括:更新软件包列表,安装`tftpd-hpa`,启动并设置开机自启,配置服务器(编辑`/etc/default/tftpd-hpa`),添加选项,然后重启服务。完成后,可用`tftp`命令进行文件传输。例如,从IP`192.168.1.100`下载`file.txt`: ``` tftp 192.168.1.100 <<EOF binary put file.txt quit EOF ```
28 4
|
2天前
|
关系型数据库 MySQL Linux
Linux联网安装MySQL Server
Linux联网安装MySQL Server
12 0
|
6天前
|
Linux 数据安全/隐私保护
Linux基础与服务器架构综合小实践
【4月更文挑战第9天】Linux基础与服务器架构综合小实践
1187 6
|
17天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器