安装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    //允许ipv4ipv6

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:将链设置为政策 ACCEPTfilter 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用户发出

&

Linux服务器---邮件服务postfix安装的更多相关文章

  1. Linux服务器---邮件服务openwebmail安装

    安装openwebmail  openwebmail提供了可视化的邮件管理系统,它运行在Apache环境下. 1.安装必备软件 [root@localhost ~]# yum install –y p ...

  2. Linux服务器---邮件服务spam

    安装spam spam(SpamAssassin)利用perl来进行文字分析,他会检测邮件的标题.内容.送信人,这样就可以过滤出垃圾邮件 1.安装spam.由于spam的依赖太多,用户一定要使用yum ...

  3. Linux服务器---邮件服务openwebmail配置

    配置openwebmail 通过修改配置文件openwebmail.conf,实现个性化邮箱定制.用户可以自由的更改邮箱logo.域名.容量 .签名等信息. 1.重定向index,快速打开邮箱.将下面 ...

  4. netcore一键部署到linux服务器以服务方式后台运行

    @font-face { font-family: octicons-link; src: url("data:font/woff;charset=utf-8;base64,d09GRgAB ...

  5. Linux服务器命令行模式安装Matlab2014a

    Linux服务器命令行模式安装Matlab2014a,有需要的朋友可以参考下. 0.下载安装包 下载Matlab2014a for Linux安装包的ISO镜像文件(感谢万能的度娘)以及破解包(下载地 ...

  6. Linux服务器,服务管理--systemctl命令详解,设置开机自启动

    Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了. 摘要: syst ...

  7. 使用Linux服务器来通过网络安装和激活Windows 7 —— 一些基本原理

    使用Linux服务器来通过网络安装和激活Windows 7 -- 一些基本原理 https://www.pufengdu.org/blog/?p=372

  8. postfix 邮件服务的安装及详解

    该实验系统:cetnos 6.5 sendmail:性能好,设置复杂,适合老手 qmail:体积小260+k ,模块化.需要做二次开发,适合对邮件性能有要求的 postfix:前身是sendmail, ...

  9. 转-阿里云CentOS Linux服务器上用postfix搭建邮件服务器

    http://www.cnblogs.com/dudu/archive/2012/12/12/linux-postfix-mailserver.html 注:本文的邮件服务器只用于发送邮件,也就是ST ...

随机推荐

  1. LeetCode-37.Sudok Solver

    Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy  ...

  2. Java基础知识(重载和覆盖)

    重载(overload): 在一个类中,如果出现了两个或者两个以上的同名函数,只要它们的参数的个数,或者参数的类型不同,即可称之为该函数重载了. 即当函数同名时,只看参数列表.和返回值类型没关系. 重 ...

  3. idea-常用插件-nginx

    1.mac上nginx安装 brew search nginx brew install nginx 当然也可以编译安装 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/e ...

  4. "当前不会命中断点,没有与此行关联的可执行代码"可能和"断点位置不准确"有关

    今天用VS调试代码遇到一件怪事,在函数结束前的return那一行打了断点,却报"当前不会命中断点,没有与此行关联的可执行代码".看了自己是debug模式,而且没有开启优化,不应该出 ...

  5. ie6-ie8支持CSS3选择器的解决办法

    引入nwmatcher.js和selectivizr.js <!--[if lt IE 10]> <script src="html5shiv.js">&l ...

  6. spring——事务管理

    1.spring支持编程式事务管理和声明式事务管理. 编程式事务管理:编程式事务管理使用TransactionTemplate或者直接使用最底层的PlatformTransactionManager. ...

  7. linux中 /dev/null命令

    /dev/null :代表空设备文件 >  :代表重定向到哪里,例如:echo "123" > /home/123.txt1  :表示stdout标准输出,系统默认值是 ...

  8. crontab-rsync

    写一个shell脚本放到crontab中,该脚本利用rsync把远程同步到本地的话,需要把本地的公钥放到远程的authorized_keys:否则,手动执行脚本没问题,但是crontab执行就不会有效 ...

  9. node微信公众号开发---自动回复

    微信开发的特点:1.post请求 (一定要注意,这里和配置域名的时候不一样,配置域名是get请求)2.数据包是xml格式的3.你给微信返回的数据也是xml格式的 var parseString = r ...

  10. MySQL--6运算符和函数小结

    按功能划分: