1.设置主机名
[root@www ~]# vim /etc/sysconfig/network
[root@www ~]# hostname mail.baidu.com
[root@www ~]# vim /etc/hosts
192.168.0.1     www.baidu.com www baidu.com
2.配置DNS
[root@www ~]# yum -y remove bind
[root@www ~]# yum -y install bind       
[root@mail ~]# vim /etc/named.conf
listen-on port 53 { 127.0.0.1; any; };
allow-query     { localhost; any; };
[root@mail ~]# vim /etc/named.rfc1912.zones
zone "baidu.com" IN {
type master;
file "baidu.com.zone";
allow-update { none; };
};
[root@mail ~]# named-checkconf /etc/named.conf
[root@mail ~]# cd /var/named/
[root@mail named]# cp named.localhost baidu.com.zone -a
[root@mail named]# vim baidu.com.zone 
$TTL 1D
@       IN SOA  dns1.baidu.com. root.baidu.com. (
0       ; serial
1D      ; refresh
1H      ; retry
1W      ; expire
3H )    ; minimum
@       NS      dns1.baidu.com.
dns1    A       192.168.0.1
www     A       192.168.0.100
@       MX 5    mail.baidu.com.
mail    A       192.168.0.1
pop    A       192.168.0.1
imap   A 192.168.0.1
[root@mail named]# named-checkzone baidu.com /var/named/baidu.com.zone 
zone baidu.com/IN: loaded serial 0
OK
[root@mail named]# service named start
Starting named:                                            [  OK  ]
[root@mail named]# chkconfig named on
[root@mail named]# nslookup 
> server
Default server: 192.168.0.17
Address: 192.168.0.17#53
> exit
[root@mail named]# vim /etc/resolv.conf 
nameserver 192.168.0.1
[root@mail named]# nslookup 
> server
Default server: 192.168.0.1
Address: 192.168.0.1#53
> set type=ns
> baidu.com
Server: 192.168.0.1
Address: 192.168.0.1#53
baidu.com nameserver = dns1.baidu.com.
> set type=mx
> baidu.com
Server: 192.168.0.1
Address: 192.168.0.1#53
baidu.com mail exchanger = 5 mail.baidu.com.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.配置postfix
[root@mail ~]# rpm -qa | grep postfix
postfix-2.6.6-2.el6.x86_64
75 myhostname = mail.baidu.com
83 mydomain = baidu.com
99 myorigin = $mydomain
116 inet_interfaces = all
119 inet_protocols = ipv4
164 mydestination = $myhostname, $mydomain, localhost
264 mynetworks = 192.168.0.0/24
419 home_mailbox = Maildir/
[root@mail ~]# service postfix restart
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [FAILED]
[root@mail ~]# postfix stop
postfix/postfix-script: stopping the Postfix mail system
[root@mail ~]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@mail ~]# netstat -tnlp |grep :25
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      8731/master 
4.使用dovecot实现110/143收信
# yum -y install dovecot
[root@mail ~]# /etc/init.d/dovecot start
正在启动 Dovecot Imap:                                    [确定]
[root@mail ~]# chkconfig dovecot on
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      8789/dovecot        
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      8789/dovecot        
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      8789/dovecot        
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      8789/dovecot        
tcp        0      0 :::110                      :::*                        LISTEN      8789/dovecot        
tcp        0      0 :::143                      :::*                        LISTEN      8789/dovecot        
tcp        0      0 :::993                      :::*                        LISTEN      8789/dovecot        
tcp        0      0 :::995                      :::*                        LISTEN      8789/dovecot 
测试:是否能够收发邮件
发信件
[root@mail ~]# telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.baidu.com ESMTP Postfix
ehlo localhost
250-mail.baidu.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:root@baidu.com
250 2.1.0 Ok
rcpt to:a@baidu.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject:a test mail 
hi a.
.
250 2.0.0 Ok: queued as 12C1B2E0002
quit
221 2.0.0 Bye
Connection closed by foreign host.
收邮件
[root@mail ~]# telnet localhost 110
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready. <2310.1.50eb9602.Wwof2gVP8FFYVTmyZ5vj7A==@mail.baidu.com>
user a
+OK
pass 1
+OK Logged in.
list
+OK 1 messages:
1 436
.
retr 1
如果用其它PC登录可不可以收发邮件
ssh 192.168.0.17
[root@desktop17 ~]# yum -y install telnet
[root@dns1 ~]# telnet 192.168.0.1
Trying 192.168.0.1...
telnet: connect to address 192.168.0.1: Connection refused
[root@dns1 ~]# telnet 192.168.0.1 25
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
220 mail.baidu.com ESMTP Postfix
ehlo localhost
250-mail.baidu.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:test2@baidu.com
250 2.1.0 Ok
rcpt to:a@baidu.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject:a test mail telnet
hi a.
.
250 2.0.0 Ok: queued as B2AEA2E0002
quit
221 2.0.0 Bye
Connection closed by foreign host.
[root@dns1 ~]# telnet 192.168.0.1 110
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
+OK Dovecot ready. <2365.1.50eb9703.T8b8hHgcZ5ZFExiwEfiz8w==@mail.baidu.com>
user a
-ERR Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
不允许pop3明文登录
[root@mail ~]# vim /etc/dovecot/conf.d/10-auth.conf 
9 disable_plaintext_auth = no
[root@www ~]# service dovecot reload
[root@dns1 ~]# telnet 192.168.0.1 110
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
+OK Dovecot ready. <2437.1.50eb9825.5Ls9iuJ+nWBnJ9+cIwCTLA==@mail.baidu.com>
user a
+OK
pass 1
+OK Logged in.
list
+OK 2 messages:
1 436
2 286
.
retr
-ERR There's no message 0.
retr
-ERR There's no message 0.
retr 2
+OK 286 octets
Return-Path: <test2@baidu.com>
X-Original-To: a@baidu.com
Delivered-To: a@baidu.com
Received: from localhost (s17 [192.168.0.17])
by mail.baidu.com (Postfix) with ESMTP id B2AEA2E0002
for <a@baidu.com>; Tue,  8 Jan 2013 11:47:48 +0800 (CST)
subject:a test mail telnet
hi a.
.
5.配置WEB客服端 
#yum -y remove httpd
# yum -y install httpd php
# vim /etc/httpd/conf/httpd.conf
ServerName mail.baidu.com
# service httpd start
# chkconfig httpd on
创建httpd虚拟主机
# vim /etc/httpd/conf/httpd.conf
<Directory /mail>
Options Indexes
AllowOverride None
Order allow,deny
Allow from 192.168.0.0/24
</Directory>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin root@baidu.com
DocumentRoot /mail
ServerName mail.baidu.com
ErrorLog logs/mail.baidu.com-error_log
CustomLog logs/mail.baidu.com.example.com-access_log common
</VirtualHost>
# mkdir /mail
# yum -y install php
# service httpd start
# chkconfig httpd on
-------------------------------
创建web,支持通过网页收发邮件
# scp zh_CN-1.4.13-20071220.tar.bz2 squirrelmail-1.4.13.tar.bz2 root@192.168.0.16:/root
# tar xf squirrelmail-1.4.13.tar.bz2
# mv /root/squirrelmail-1.4.13/* /mail/
打中文补丁包
# mkdir /root/zh
# tar xf zh_CN-1.4.13-20071220.tar.bz2  -C /root/zh
cd /root/zh
# ./install 
Please enter path to your squirrelmail installation:/mail
创建配置文件 :
# cd /mail/config
# cp config_default.php  config.php 
# vim /mail/config/config.php 
118 $domain = 'baidu.com';
1000 $squirrelmail_default_language = 'zh_CN';
1015 $default_charset = 'zh_CN.UTF-8';
487 $data_dir = '/mail/data/';
--邮件数据
505 $attachment_dir = '/mail/attach/'; --邮件附件
# mkdir /mail/{data,attach} -p
# chown -R apache.apache /mail/data/ /mail/attach/

centos6 postfix配置相关推荐

  1. Centos6.8配置HTTPS

    Centos6.8配置HTTPS HTTPS服务 http+openssl 环境要求: CA证书: 192.168.1.103 网站服务器: 192.168.1.104 客户端: 192.168.1. ...

  2. postfix配置积累(不断的积累)

    postfix 配置 1.mail_name 默认是Postfix.在收件人信头可以查看,如果不想让别人知道你是用postfix发的,则可以改成其它名字,如:postconf -e mail_name ...

  3. Linux学习-postfix配置

    本文基本centos6.10,postfix2.11.11 postfix基本配置 myhostname:定义主机名,判断当前主机工作在什么位置,跟mx记录对应的主机名称一致 mydomain:自己所 ...

  4. centos6.9配置LAMT页面500错误解决

    阿拉做实验的时候在CentOS7上配置LAMT正确,在CentOS6.9上却总是显示500错误.二者配置文件除主机名外一模一样.配置文件如下: <VirtualHost *:80>Serv ...

  5. CentOS6.3配置yum源

    全新以最小化包安装了64位的CentOS6.3系统,作为本地的Web服务器使用,现记录全过程 第二步,配置网易163的yum源 1. 下载repo文件     下载地址:http://mirrors. ...

  6. Postfix配置文档

    环境:RedHat Linux+Postfix+Cyrus-sasl+Dovecot+Stunnel 在安装Linux时,如果选择全部安装的话,Postfix与Dovecot以及Stunnel将会自动 ...

  7. Postfix 配置参数速查

    本附录按照字母顺序,列出可在main.cf配置文件里设定的参数,并简略说明各参数的意义或用途.本附录只能算是postfix参数的"速查参考". 所有参数都有一个默认值(虽然某些默认 ...

  8. centos6.5配置Hadoop环境,运行wordcount例子

    安装vmware12,centos6.5(还是6.5好,稳定流畅,7界面好看但是虚拟机里面卡死了),删除自带openjdk下载安装jdk1.7 配置环境变量 vim /etc/profile-> ...

  9. VMware下CentOS6.8配置GFS文件系统

    1.GFS介绍 GFS简要说明,它有两种: 1. Google文件系统:GFS是GOOGLE实现的是一个可扩展的分布式文件系统,用于大型的.分布式的.对大量数据进行访问的应用.它运行于廉价的普通硬件上 ...

最新文章

  1. 基于视频理解TSM和数据集20bn-jester-v1的27类手势识别
  2. php根据单词截取英文语句,php按单词截取字符串的方法
  3. SQL Server 2008 修改安装路径后安装出错的解决方法
  4. 关于 ng-template 通过 @input 传入另一个 Component 不能工作的问题调试
  5. Could not find a package,configuration file provided by G2O ,G2OConfig.cmake,g2o-config.cmake
  6. 16进制数组转字符串
  7. Android 系统性能优化(79)---提升Android应用的启动速度与设计
  8. ubuntu15.10 gvim php,IDE---Gvim之ubuntu下配置php的ide开发工具
  9. 【报告分享】2022金融科技趋势研究报告.pdf(附下载链接)
  10. java便签小程序原码_localStorage实现便签小程序
  11. AcWing321.棋盘分割(区间DP)题解
  12. 队列,链队列,链式存储的队列
  13. 虚拟服务器数据库怎么导入数据库,BlueHost虚拟主机使用SSH怎么导入MySQL数据库...
  14. windows7 android 驱动,Windows7安卓刷机驱动安装教程图文详解
  15. python内嵌浏览器_内嵌web浏览器
  16. 为什么在计算机里打开U盘会闪退,U盘闪退怎么办?
  17. 拭血长短句手札【2013-2017】微信公众号 shixuemp
  18. 有趣的数字绕口令,提高孩子记忆力,锻炼出好口才!
  19. 印度软件巨头Infosys的成功之道
  20. Grafana 在 Kubernetes 中的使用

热门文章

  1. python3 zipfile_python3-zipfile模块打包
  2. FMS安装与简单应用
  3. oracle exfsys 下 rlm$evtcleanup,记一次数据库无法增删改趋于HANG住状态的故障诊断和处理 -电脑资料...
  4. WEEE常见问题解答
  5. 解决c++错误:redefinition of class xxx
  6. React实现PPT预览(伪)
  7. 如何用python快速爬取速卖通商品信息
  8. 仿Android5.0 水波扩散效果(Ripple)简单实现
  9. .NET Word 文件格式转换
  10. Current charset is UTF-8. If password has been set using other charset... 解决办法