系统环境:

安装邮件服务器,postfix+squirrelmail+rhat 5.4下测试,本实验目的是,在服务器与客户端之间相互收发邮件和转发邮件;

系  

域  

服务器

客户端

RedHat 5.4

mail.163.com

172.16.1.253

172.16.1.10

所需安装包:

bind  (DNS)

postfix(邮件服务器)

Dovecot(POP/IMAP协议,用于接受邮件)

Saslauthd(安全认证包)

Squirrelmail(基于web的邮件客户端)

1、配置IP

2、配置主机名:mail.163.com

[root@localhost ~]# vim /etc/sysconfig/network

HOSTNAME=mail.163.com

:wq  保存

[root@localhost ~]# hostname mail.163.com

断开终端,再次连接,这样就需要重新启动系统:ctrl+d

[root@mail ~]#

3、配置DNS文件

[root@mail ~]# vim /etc/resolv.conf

nameserver 172.16.1.253

4、配置hosts文件

[root@mail ~]# vim /etc/hosts

127.0.0.1       mail.163.com

5、配置YUM

参照:

http://yanghuawu.blog.51cto.com/2638960/886129

6、安装DNS(bind)

[root@mail ~]# cd /mnt/Server/

[root@mail Server]# rpm -ivh bind-9.3.6-4.P1.el5.i386.rpm

Preparing...                ########################################### [100%]

1:bind                   ########################################### [100%]

[root@mail Server]# rpm -ivh bind-chroot-9.3.6-4.P1.el5.i386.rpm

Preparing...                ########################################### [100%]

1:bind-chroot            ########################################### [100%]

[root@mail Server]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm

Preparing...                ########################################### [100%]

1:caching-nameserver     ########################################### [100%]

[root@mail Server]# cd /var/named/chroot/etc/

[root@mail etc]# ll

total 32

-rw-r--r-- 1 root root   405 Dec 18 05:13 localtime

-rw-r----- 1 root named 1230 Jul 30  2009 named.caching-nameserver.conf

-rw-r----- 1 root named  955 Jul 30  2009 named.rfc1912.zones

-rw-r----- 1 root named  113 Dec 18 05:48 rndc.key

[root@mail etc]# cp -p named.caching-nameserver.conf named.conf

[root@mail etc]# vim named.conf

修改:

15         listen-on port 53 { any; };

27         allow-query     { any; };

28         allow-query-cache { any; };

37         match-clients      { any; };

38         match-destinations { any; };

:wq

[root@mail etc]# vim named.rfc1912.zones

27 zone "163.com" IN {

28         type master;

29         file "163.com.zone";

30         allow-update { none; };

31 };

:wq

[root@mail etc]# cd ../var/named/

[root@mail named]# pwd

/var/named/chroot/var/named

[root@mail named]# cp -p localhost.zone 163.com.zone

[root@mail named]# vim 163.com.zone

$TTL    86400

@               IN SOA  ns.163.com.       root (

42              ; serial (d. adams)

3H              ; refresh

15M             ; retry

1W              ; expiry

1D )            ; minimum

IN NS           ns.163.com.

ns              IN A            172.16.1.253

mail            IN A            172.16.1.253

pop3            IN CNAME        mail

smtp            IN CNAME        mail

@               IN MX 10        mail

:wq

[root@mail named]# service named start

Starting named:                                            [  OK  ]

[root@mail named]# service named restart

Stopping named:                                            [  OK  ]

Starting named:                                            [  OK  ]

[root@mail named]#

[root@mail named]# rndc reload

server reload successful

[root@mail named]# dig -t mx 163.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t mx 163.com

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10922

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; QUESTION SECTION:

;163.com.                       IN      MX

;; ANSWER SECTION:

163.com.                86400   IN      MX      10 mail.163.com.

;; AUTHORITY SECTION:

163.com.                86400   IN      NS      ns.163.com.

;; ADDITIONAL SECTION:

mail.163.com.           86400   IN      A       172.16.1.253

ns.163.com.             86400   IN      A       172.16.1.253

;; Query time: 5 msec

;; SERVER: 172.16.1.253#53(172.16.1.253)

;; WHEN: Tue Dec 18 06:12:41 2012

;; MSG SIZE  rcvd: 95

[root@mail named]# chkconfig named on

确认sendmail是否已关闭,并不随机启动或者卸载

[root@mail named]# service sendmail status

sendmail (pid  2754) is running...

[root@mail named]# service sendmail stop

Shutting down sm-client:                                   [  OK  ]

Shutting down sendmail:                                    [  OK  ]

[root@mail named]# chkconfig sendmail off

[root@mail named]#

7、安装postfix

[root@mail named]# cd /mnt/Server/

[root@mail Server]# ll postfix*

-r--r--r-- 278 root root 3734257 Aug 14  2008 postfix-2.3.3-2.1.el5_2.i386.rpm

-r--r--r-- 278 root root   51012 Aug 14  2008 postfix-pflogsumm-2.3.3-2.1.el5_2.i386.rpm

[root@mail Server]# rpm -ivh postfix-2.3.3-2.1.el5_2.i386.rpm

Preparing...                ########################################### [100%]

1:postfix                ########################################### [100%]

[root@mail Server]# vim /etc/postfix/main.cf

69 #myhostname = host.domain.tld

修改

69 myhostname = mail.163.com  #本机名

77 #mydomain = domain.tld

修改:

77 mydomain = 163.com         #域名

93 #myorigin = $mydomain

修改为

93 myorigin = $mydomain

107 #inet_interfaces = all

修改为

107 inet_interfaces = all

110 inet_interfaces = localhost

修改为

110 #inet_interfaces = localhost

155 mydestination = $myhostname, localhost.$mydomain, localhost

修改为

155 #mydestination = $myhostname, localhost.$mydomain, localhost

156 #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

修改为

156 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

255 #mynetworks = 168.100.189.0/28, 127.0.0.0/8

修改为

255 mynetworks = 127.0.0.0/8     #提供邮件转发功能的网段

在255 mynetworks = 127.0.0.0/8上面添加如下:#使用SMTP认证

broken_sasl_auth_clients = yes

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_application_name = smtpd

smtpd_client_restrictions = permit_sasl_authenticated,reject

#smtpd_clietn_restrictions = permit_sasl_authenticated

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated, reject_unauth_destination

262 mynetworks = 127.0.0.0/8

:wq

[root@mail Server]# service saslauthd start

Starting saslauthd:                                        [  OK  ]

[root@mail Server]# chkconfig saslauthd  on

[root@mail Server]# service postfix start

Starting postfix:                                          [  OK  ]

[root@mail Server]# service postfix restart

Shutting down postfix:                                     [  OK  ]

Starting postfix:                                          [  OK  ]

[root@mail Server]# netstat -tupln |less

tcp    0   0 0.0.0.0:25    0.0.0.0:*   LISTEN    4235/master

8、创建用户

[root@mail Server]# useradd user1

[root@mail Server]# useradd user2

[root@mail Server]# useradd user3

[root@mail Server]# passwd user1

Changing password for user user1.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

[root@mail Server]# passwd user2

Changing password for user user2.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

[root@mail Server]# passwd user3

Changing password for user user3.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

9、安装squirrelmail(图形化邮件客户端)

[root@mail Server]# yum install squirrelmail

[root@mail Server]# service httpd restart

Stopping httpd:                                            [  OK  ]

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using mail.163.com for ServerName

[  OK  ]

[root@mail Server]# chkconfig httpd on

[root@mail Server]# rpm -ql squirrelmail

[root@mail Server]# cd /var/www/html/

[root@mail html]# ln -s /usr/share/squirrelmail/ mail

[root@mail html]# ll

total 4

lrwxrwxrwx 1 root root 24 Dec 18 06:46 mail -> /usr/share/squirrelmail/

[root@mail html]# cd mail/

[root@mail mail]# ll

total 88

drwxr-xr-x  5 root root 4096 Dec 18 06:42 class

drwxr-xr-x  2 root root 4096 Dec 18 06:42 config

drwxr-xr-x  4 root root 4096 Dec 18 06:42 functions

drwxr-xr-x 30 root root 4096 Dec 18 06:42 help

drwxr-xr-x  2 root root 4096 Dec 18 06:42 p_w_picpaths

drwxr-xr-x  3 root root 4096 Dec 18 06:42 include

-rw-r--r--  1 root root  684 May 21  2009 index.php

drwxr-xr-x 47 root root 4096 Dec 18 06:42 locale

drwxr-xr-x 18 root root 4096 Dec 18 06:42 plugins

drwxr-xr-x  2 root root 4096 Dec 18 06:42 src

drwxr-xr-x  3 root root 4096 Dec 18 06:42 themes

[root@mail mail]# cd config/

[root@mail config]# ll

total 204

-rw-r--r-- 1 root root  29548 May 21  2009 config_default.php

lrwxrwxrwx 1 root root     45 Dec 18 06:42 config_local.php -> ../../../../etc/squirrelmail/config_local.php

lrwxrwxrwx 1 root root     39 Dec 18 06:42 config.php -> ../../../../etc/squirrelmail/config.php

-rwxr-xr-x 1 root root 145648 May 21  2009 conf.pl

-rw-r--r-- 1 root root    492 May 21  2009 index.php

打开squirrelmail配置工具

[root@mail config]# ./conf.pl 或[root@mail ~]# /usr/share/squirrelmail/config/conf.pl

SquirrelMail Configuration : Read: config.php (1.4.0)

---------------------------------------------------------

Main Menu --

1.  Organization Preferences

2.  Server Settings

3.  Folder Defaults

4.  General Options

5.  Themes

6.  Address Books

7.  Message of the Day (MOTD)

8.  Plugins

9.  Database

10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off

S   Save data

Q   Quit

Command >> 10

输入d,然后输入cyrus(指定IMAP服务器类型)

输入2.  选择Server Settings然后输入1修改Domain为mail.163.com

3修改Sendmail or SMTP为选2--SMTP

输入4.  选择General Options然后输入5修改Usernames in Lowercase :为 true

输入10  选择Languages然后输入1修改Default Language :为 zh_CN

2修改Default charset  :为 GB2312

R返回上一层

最后输入s保存以上修改,再输入q退出(修改的文件同时保存)

[root@mail config]# vim /etc/httpd/conf/httpd.conf

747 AddDefaultCharset UTF-8

修改为:

747 #AddDefaultCharset UTF-8

:wq

[root@mail config]# service httpd restart

10、网页访问:http://172.16.1.253/mail

用户登陆报错

系统出错

连接IMAP服务器出现错误:localhost。

111 : 鎷掔粷杩炴帴

解决方法

[root@mail config]# yum install dovecot    #用于接受邮件

[root@mail config]# service dovecot restart

重新登录:OK

发邮件报错

系统出错:

Transaction failed

Server replied: 554 5.7.1 <localhost.localdomain[127.0.0.1]>: Client host rejected: Access denied

解决方法:

[root@mail config]# vim /etc/postfix/main.cf

smtpd_client_restrictions = permit_sasl_authenticated,reject

修改为

#smtpd_client_restrictions = permit_sasl_authenticated,reject

:wq

[root@mail config]# service postfix restart

11、查看收发邮件日志

[root@mail config]# tail -f /var/log/maillog

收发邮件成功!

转载于:https://blog.51cto.com/yanghuawu/1092891

postfix+squirrelmail - rhat 5.4相关推荐

  1. debian 6安装postfix squirrelmail

    ---参考文章:http://blog.csdn.net/winscar/article/details/6483322 --->postfix+squirrelmail邮件系统 ------- ...

  2. postfix+squirrelmail实现邮件服务器

    postfix+squirrelmail实现邮件服务器 [root@localhost ~]# vim /etc/sysconfig/network [root@localhost ~]# hostn ...

  3. postfix squirrelmail

    目标建立两个独立的mail服务器,要求可以互发邮件,并且开启smtp认证功能,并且可以使用web页面登陆.限制用户邮箱为100MB,单封邮件1MB 首先我们安装包,安装 bind-9.3.3-7.el ...

  4. 邮件服务器(postfix与squirrelmail)

    Postfix+squirrelmail均为linux自带软件 废话不说~直接开始~(有需求请Q:395061796,竭诚×××~) [root@zhangc ~]# vim /etc/resolv. ...

  5. linux邮件自动回复,debian上 postfix+dovecot+squirrelmail 实现 自动回复

    作者:lxq007 本文主要介绍了基于dovecot 的邮件自动回复 的配置过程. 我使用的系统及安装的软件包为Debian GNU/Linux 4.0.postfix 2.3.4-3 .squirr ...

  6. 配置postfix+dovecot+mysql+postfixadmin+squirrelmail 邮件系统笔记

    最近想搭建一个完整的mailserver,查了很多资料,一直没有成功,网上大部分资料是在redhat系列的操作系统上的,而且很多都是采用rpm包. 我现在的系统是suse Linux有许多包已经安装, ...

  7. 小松鼠邮件(squirrelmail)服务器部署(squirrelmail+Postfix)

    平台:centos6.4 软件: 下载软件:http://www.squirrelmail.org/download.php(官网) squirrel-webmail-1.4.22.tar.bz2 a ...

  8. 邮件接收中Postfix、Dovecot、Squirrelmail、MySQL、AMaVis、Clam AntiVirus和SpamAssasin的功能解析

    参考网址的教程: https://workaround.org/ispmail/lenny/bigpicture 邮件接收过程中各个软件的功能分布流程 在收发电子邮件的过程中,Postfix.Dove ...

  9. centos7+postfix+dovecot+squirrelmail

    Centos7+postfix+dovecot+SquirrelMail 说明:未使用数据库,密码验证采用系统本地用户,本机IP:192.168.10.1,Hostname改成自己的 1.关闭防火墙及 ...

最新文章

  1. mysql数据库死锁 情景一
  2. Theme,skin-----asp.net2.0 new technolog
  3. 我是如何提高工作和研究效率的?分享给大家几个神器
  4. list(map(lambda x:x[:-1], g.readlines())) 理解
  5. oracle管理认证方式,关于Oracle数据库管理员认证方法简述
  6. RSA openssl_public_encrypt false
  7. 大二上数据结构复习2
  8. python选择法_新手小白如何学习Python 选对方法很重要(附教程)
  9. 可以检测手机帧率和温度的软件_腾讯黑鲨游戏手机3评测:深度定制带来的全新游戏体验...
  10. Hadoop权威指南-读书笔记
  11. 安卓3G控制板、核心板、广告机开发一体规格书
  12. 温度转换程序python代码_python温度转换华氏温度实现代码
  13. “三只猫,三分钟,捉三只老鼠,多少只猫,一百分钟,捉一百只老鼠”有感
  14. 一头 一头百兆全双工 自动协商 测试
  15. try{}里有一个return语句,那么紧跟在这个try后的finally{}里的代码会不会被执行,是在return前还是后
  16. python中如何清空_python中如何清空数组(列表)元素
  17. 《与熊共舞》第一章--逆“风”而行
  18. 驾驶员困倦检测危险驾驶检测抽烟喝水打电话检测yolov5
  19. 小说朗读器又增加新功能
  20. IE浏览器下载图片直接打开的问题

热门文章

  1. 手风琴特效这么飒,能用 JavaScript 实现吗?
  2. 服务器虚拟化与虚拟容器,虚拟化与Docker
  3. Nacos源码NacosServiceRegistry
  4. ConcurrentHashMap的源码分析-initTable
  5. TCP/IP的分层负载
  6. 加速静态内容访问速度的CDN
  7. Redis中的主从复制的不足
  8. pom文件内标签的讲解
  9. Nacos配置中心介绍
  10. 悔不当初:回顾进化之路