centos5.10 sendmail+openwebmail

1.安装sendmail和sendmail-cf dovecot
yum install sendmail-cf sendmail dovecot-y

2.配置sendmail

[[email protected] ~]# cd /etc/mail
[[email protected] mail]# vim sendmail.mc
修改Addr=127.0.0.0 改为如下的0.0.0.0
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA‘)
修改LOCAL_DOMAIN(`localhost.domain‘)改为如下的域名
LOCAL_DOMAIN(`maxmell.com.cn‘)

修改完成sendmail.mc 执行如下命令
m4 sendmail.mc >sendmail.cf

3.修改local-host-names ,添加域名maxmell.com.cn

[[email protected] mail]# cat local-host-names
# local-host-names - include all aliases for your machine here.
maxmell.com.cn

4.配置访问列表
[[email protected] mail]# cat access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain  RELAY
Connect:localhost   RELAY
Connect:127.0.0.1   RELAY
Connect:tairjiuh.com.tw                 RELAY
Connect:dim.tairjiuh.com.tw  RELAY
Connect:maxmell.com.cn                  RELAY
Connect:21cn.com   RELAY
Connect:192.168.0.204                   RELAY
Connect:192.168.0.102                   RELAY
Connect:maxmell.cn                      RELAY
Connect:192.168.3.106                   RELAY
Connect:163.com                         DISCARD
Connect:sina.com                        DISCARD
Connect:hkdc.net                        DISCARD
Connect:sohu.com                        DISCARD
Connect:china.com                       DISCARD
Connect:yahoo.com                       DISCARD
Connect:hotmail.com                     DISCARD
Connect:joyo.com                        DISCARD
Connect:netease.com                     DENY
Connect:126.com                         DISCARD
Connect:qq.com                          DISCARD

5.启动sendmail

service sendmail restart
service dovecot restart
chkconfig dovecot on
chkconfig sendmail on

注意:防火墙和selinux关闭
iptables -F
iptables -X
service iptables save

[[email protected] mail]#vim  /etc/selinux/config
SELINUX=disabled

6.查看端口
[[email protected] mail]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      4269/dovecot       
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      4269/dovecot       
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      4269/dovecot       
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      4269/dovecot       
tcp        0      0 0.0.0.0:687                 0.0.0.0:*                   LISTEN      2625/rpc.statd     
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2585/portmap       
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      2980/httpd         
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      2907/sshd          
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      2941/sendmail

7.安装openwebmail

7.1 配置openwebmail yum
# cd /etc/yum.repos.d
# wget -q http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo

7.2 下载依赖安装包
# wget http://www.openwebmail.org/openwebmail/download/redhat/rpm/packages/rhel5/perl-Text-Iconv/x86_64/perl-Text-Iconv-1.7-1.el5.rf.x86_64.rpm
rpm -ivh perl-Text-Iconv-1.7-1.el5.rf.x86_64.rpm

7.3  安装openwebmail

# yum install openwebmail
fedora                    100% |=========================| 2.1 kB    00:00    
openwebmail               100% |=========================|  951 B    00:00    
updates                   100% |=========================| 2.3 kB    00:00    
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package openwebmail.i386 0:2.53-1 set to be updated
--> Processing Dependency: openwebmail-data = 2.53-1 for package: openwebmail
--> Processing Dependency: perl-suidperl for package: openwebmail
--> Processing Dependency: perl-Text-Iconv for package: openwebmail
--> Running transaction check
---> Package openwebmail-data.i386 0:2.53-1 set to be updated
---> Package perl-suidperl.i386 4:5.8.8-32.fc8 set to be updated
---> Package perl-Text-Iconv.i386 0:1.5-1.fc8 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing for dependencies:
 openwebmail             i386       2.53-1           openwebmail       2.3 M
 openwebmail-data        i386       2.53-1           openwebmail       7.0 M
 perl-Text-Iconv         i386       1.5-1.fc8        fedora             20 k
 perl-suidperl           i386       4:5.8.8-32.fc8   updates            60 k

Transaction Summary
=============================================================================
Install      4 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)

Total download size: 9.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): perl-Text-Iconv-1. 100% |=========================|  20 kB    00:00    
(2/4): openwebmail-2.53-1 100% |=========================| 2.3 MB    00:03    
(3/4): perl-suidperl-5.8. 100% |=========================|  60 kB    00:00    
(4/4): openwebmail-data-2 100% |=========================| 7.0 MB    00:10    
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID cfb164d8
Importing GPG key 0xCFB164D8 "Thomas Chung <[email protected]>" from http://openwebmail.org/.../RPM-GPG-KEY-openwebmail
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: perl-Text-Iconv              ######################### [1/4]
  Installing: perl-suidperl                ######################### [2/4]
  Installing: openwebmail                  ######################### [3/4]

Permission and Ownership for openwebmail files have been fixed!

7.4 配置openwebmail.conf

[[email protected] etc]# pwd
/var/www/cgi-bin/openwebmail/etc/openwebmail.conf

cp /var/www/cgi-bin/openwebmail/etc/openwebmail.conf /var/www/cgi-bin/openwebmail/etc/openwebmail.conf_ori

7.41 配置openwebmail
1.openwebmail.conf
vim /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

14行 domainnames                     maxmell.com.cn
65行 default_language en 修改成--> default_language zh_TW.Big5
85行 default_iconset Cool3D.English 修改成--> default_iconset Cool3D.Chinese.Traditional

76行 <default_signature>
77行 --
78行 Open WebMail Project (http://openwebmail.org)
79行 </default_signature>
此四行是使用者寄信的预设签名文件,请自行修改
2.
216行 webdisk_rootpath /webdisk 修改成--> webdisk_rootpath /

3.dbm.conf
vim /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
[[email protected] etc]# cat dbm.conf
dbm_ext                 .pag
dbmopen_ext             none
dbmopen_haslock         yes

4.auth_unix.conf

[[email protected] etc]# cat auth_unix.conf
#
# config file for auth_unix.pl
#
# Red Hat, Fedora and CentOS

passwdfile_plaintext /etc/passwd
passwdfile_encrypted /etc/shadow
passwdmkdb  none
check_expire  no
check_nologin  no
check_shell  no
check_cobaltuser no
change_smbpasswd no

5. 初始化openwebmail

Please execute following tool first as a root:
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

After restarting httpd service, login with non-root account from
http://localhost.localdomain/cgi-bin/openwebmail/openwebmail.pl
or http://localhost.localdomain/webmail

If SELinux enabled, you may need to set it ‘permissive‘ in
/etc/sysconfig/selinux or system-config-selinux

Installing: openwebmail-data             ######################### [4/4]

Dependency Installed: openwebmail.i386 0:2.53-1 openwebmail-data.i386 0:2.53-1 perl-Text-Iconv.i386 0:1.5-1.fc8 perl-suidperl.i386 4:5.8.8-32.fc8
Complete!

8.安装http

yum install http
[[email protected] conf]# pwd
/etc/httpd/conf
vim httpd.conf
ServerName localhost:80

9.邮件迁移:

9.1 添加邮件账户
[[email protected] ~]# cat add_mail_user.sh
while read name; do
useradd  $name
echo "$name" | passwd --stdin $name
done <jianing_mail.txt

9.2 筛选邮件账户
cut -d : -f1 passwd >jianing_mail.txt

最后执行脚本add_mail_user.sh

9.3 将/home 打包
tar -cvf home.tar home/
9.4 将收件箱打包
[[email protected] spool]# pwd
/var/spool
tar -cvf  mail.tar mail/

9.5 .将home.tar 和mail.tar 解压到对应目录

10.安装配置dns

[[email protected] conf.d]# rpm -qa |grep bind
bind-9.3.6-20.P1.el5_8.6
bind-libs-9.3.6-20.P1.el5_8.6
bind-utils-9.3.6-20.P1.el5_8.6
ypbind-1.19-12.el5_6.1

yum install bind bind-lib bind-utils -y

到/etc 目录下面将named.conf 上传
到/var 目录下面将named.tar 上传解压 注意权限

[[email protected] etc]# ll named.conf
-rw-r----- 1 root named 2439 Jul 15 23:35 named.conf

[[email protected] var]# pwd
/var
[[email protected] var]# ll named
total 88
-rw-r----- 1 root  named  524 Jul 15 23:12 172.168.1.zone
-rw-r--r-- 1 root  named  883 Jul 15 23:25 192.168.0
-rw-r--r-- 1 root  named  846 Jul 15 23:26 210.13.193
drwxr-x--- 3 root  named 4096 Jul 15 23:11 chroot
drwxrwx--- 2 named named 4096 Jul 13 03:08 data
-rw-r--r-- 1 root  named  609 Jul 15 23:30 dilina.com.cn
-rw-r--r-- 1 root  named  440 Jul 15 23:31 dns.tairjiuh.com.cn
drwxr-x--- 2 root  named 4096 May 29 11:41 dynamic
-rw-r----- 1 root  named  536 Jul 15 23:12 mageedu.com.zone
-rw-r--r-- 1 root  named  584 Jul 15 23:30 maxartist.com.cn
-rw-r--r-- 1 root  named  705 Jul 15 23:31 maxmell.cn
-rw-r--r-- 1 root  named  889 Jul 15 23:30 maxmell.com.cn
-rw-r--r-- 1 root  named  694 Jul 15 23:27 minjiali.com.cn
-rw-r--r-- 1 root  named  415 Jul 15 23:18 named.broadcast
-rw-r----- 1 root  named 1892 Feb 18  2008 named.ca
-rw-r----- 1 root  named  152 Dec 15  2009 named.empty
-rw-r----- 1 root  named  152 Jun 21  2007 named.localhost
-rw-r----- 1 root  named  168 Dec 15  2009 named.loopback
-rw-r--r-- 1 root  named  416 Jul 15 23:21 named.zero
drwxrwx--- 2 named named 4096 Jan 21 01:40 slaves
-rw-r--r-- 1 root  named 2106 Jul 16 00:17 tairjiuh.com.cn
-rw-r--r-- 1 root  named  536 Jul 15 23:34 tairjiuh.com.tw

[[email protected] named]# /etc/init.d/named start
Starting named:                                            [  OK  ]
 
[[email protected] named]# cat /etc/resolv.conf
nameserver 192.168.1.236--修改本地DNS名字

测试解析
[[email protected] named]# dig -t A dns.tairjiuh.com.tw.

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> -t A dns.tairjiuh.com.tw.
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42179
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;dns.tairjiuh.com.tw.  IN A

;; ANSWER SECTION:
dns.tairjiuh.com.tw. 86400 IN A 59.120.97.103

;; AUTHORITY SECTION:
tairjiuh.com.tw. 86400 IN NS dns.tairjiuh.com.tw.

;; Query time: 1 msec
;; SERVER: 192.168.1.236#53(192.168.1.236)
;; WHEN: Wed Jul 16 17:34:32 2014
;; MSG SIZE  rcvd: 67

centos5.10 sendmail+openwebmail,布布扣,bubuko.com

时间: 2024-10-20 05:25:46

centos5.10 sendmail+openwebmail的相关文章

LNMP环境下SendMail+OpenWebMail的详细配置

随着网络的发展和普及,邮件服务器正在成为人们日常生活中不可缺少的部分.现在,许多企业采用 Lotus Note, Exchange 作为公司内部的邮件服务器.本文主要介绍一种基于Linux系统的邮件服务器软件(sendmail)提供邮件服务. 注意:之前已经配置好了LNMP web环境. 配置过程/步骤: 1. 安装Sendmailyum安装或者rpm包安装:yum -y install sendmail sendmail-devel sendmail-cf sendmail-do m4 2. 

centOs5.10 下安装svn服务器

///////////////////////////===============CentOs5.10 下安装svn服务器================/////////////////////////////////// //一:安装SVN #yum list sub* #yum install subversion //二:查看是否安装成功 #svnserve --version //三:创建svn仓库 #mkdir -p /opt/svn/ # mkdir -p /opt/svn/sv

lamp环境centos5.10,phpprotobuf模块安装

==相关参考== rpm包 http://rpmfind.net/linux/rpm2html/ Linux rpm 命令参数使用详解[介绍和应用] phpize学习 http://blog.sina.com.cn/s/blog_85759f2b0101h3rf.html ==流程== 所用资源:https://github.com/allegro/php-protobuf/ 进入解压目录执行: phpize ./configure make make install # please add

阿里云服务器centos5.10安装lamp环境

==相关命令== 查看linux版本:cat /etc/redhat-release ==配置修改== 一.Apache配置 ----------------------------------------------------- vi /etc/httpd/conf/httpd.conf 编辑文件 Options Indexes FollowSymLinks        在331行 修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI

sendmail邮件服务搭建详细解 &nbsp; 小小子

Sendmail+Openwebmail 1.1.软件安装sendmaills yum install  sendmail*  perl-Compress-Zlib perl-suidperl perl-Text-Iconv –y yum -y install sendmail-cf.i* sendmail-doc.i* 1.2. 配置sendmail服务: 配置系统服务 # 备份系统文件 cp  /etc/mail/sendmail.mc  /etc/mail/sendmail.mc.bak

Linux系统中Kickstart+HTTP+DHCP+TFTP全自动批量安装部署

说明: Kickstart服务器系统:CentOS 5.10 64位 IP地址:192.168.21.128 需要安装部署的Linux系统:CentOS 5.10 64位 eth0(第一块网卡,用于外网)IP地址段:192.168.21.160-192.168.21.200 eth1(第二块网卡,用于内网)IP地址段:10.0.0.160-10.0.0.200 子网掩码:255.255.255.0 网关:192.168.21.2 DNS:8.8.8.8 8.8.4.4 所有服务器均支持PXE网络

linux系统基础优化

1.Linux系统基础优化 一.关闭SELinux功能 Selinux是什么? 安全工具,控制太严格,生产环境不用它,使用其他安全手段. 简介: SELinux带给Linux的主要价值是:提供了一个灵活的,可配置的MAC机制. Security-Enhanced Linux (SELinux)由以下两部分组成: 1) Kernel SELinux模块(/kernel/security/selinux) 2) 用户态工具 SELinux是一个安全体系结构,它通过LSM(Linux Security

Cobbler全自动批量安装部署Linux系统

前言:这篇文章是系统运维www.osyunwei.com的作品,我只是根据实践了一下,出于对原作者的尊重附原文链接如下: 原文链接:http://www.osyunwei.com/archives/7606.html 根据文章的说明是可以完成所属功能的,不过原文章有点小问题,在本文中我已经修改过了,仅供大家参考,有问题大家交流,E-mail:[email protected] 安装之前的一点说明 Cobbler服务器系统:CentOS5.10 64位 IP地址:192.168.21.128 需要

Linux 基础优化与安全总结

1,不用root登录管理系统,而以普通用户身份登录,通过sudo授权管理. 2.更改默认的远程连接SSH服务器端口,禁止root 用户远程连接,甚至更改SSH服务只监听内网IP. 3.定时自动更新服务器时间,使其秘互联网时间同步. 4.配置yum更新源,从国内更新源下载安装软件包. 5.关闭SELinx及iptables sed -i 's/SELINUX=enforcing/SELINUX=disabled' /etc/selinux/config 6.调整文件描述符的数量,进程及文件的打开都