邮件系统 设为首页
加入收藏
总编信箱
| 第一邮局 | 免费邮箱 | 邮箱评测 | 企业邮局 | 移动邮件 | 邮件系统 | 邮件营销 | 反垃圾邮件 | 邮件客户端 | 邮件安全 |
当前位置:第一邮局>邮件系统>Postfix>文章内容

debian31r2 postfix automatic setup script

来源:Mail1.com.cn 编辑:Mail 发布时间:2007-04-30 [收藏] [推荐] [评论(0条)]

#!/bin/bash

################################################################################################
# Somthing to say
#
# Author:sosogh
#
# Date:2007.2.10
#
# The script will ask you some questions(it is the software asking you question in fact) ,
# so "donot" go anywhere when excute this script
#
# This script is just to implement the setup of the mail system . It is not to show the usage
# of every software.The usage of every software leaves to you.
#
# I have test the scrpit on my vmware and my real pc,it worked well.If u want to use this script,
#
# MAKE SURE THAT TEST IT ON YOUR VMWARE BEFORE YOU INSTALL IT ON YOUR REAL PC.
#
# AND I DON'T GUARANTEE THAT IT WILL WORK WELL ON YOUR PC
#
################################################################################################

###########################################################################################
#
# I leave it up to you for any other issues. Absolutely no warranty of any kind.
# Use entirely at your own risk.
# The author accepts no responsibility for any loss or damage caused by the use, lack of use,
# or misuse, of information contained in this script
#
#############################################################################################


############################################################################################
#
# postfix2.1.5 cyrus-sasl couirer(auth imap pop maildrop) postfixadmin
# Amavis-new Spamassasin Clamav squirrelmail
#
#############################################################################################

######################
# Some notes:
######################

##############################################################################################
#
# The course of SMTP authentication is illustrated as follow:
#
# client pc -- postfix --- sasl -- authdaemon ------ authmysql -------- Mysql
#
#
###############################################################################################

###############################################################################################
#
# The course of POP3 authentication is illustrated as follow:
#
# client pc --- POP3 --- authdaemon ------ authmysql -------- Mysql
#
#
###############################################################################################

###########################################################
#
# My source list is :
# deb http://debian.cn99.com/debian/ stable main
#
###########################################################

##<---------- SECTION 1 prepation -------##

##############
# prepation
##############
sed -i '/^deb http:\/\/security.debian.org/s/\(.*\)/#\1/' /etc/apt/sources.list
apt-get update
apt-get -y install sudo
groupadd -g 108 vmail
useradd -g 108 -u 108 vmail

##<---------- SECTION 2 pop3Server -------##

###################################
# Install and set the pop3 server
###################################

apt-get -y install courier-pop courier-authmysql
sed -i 's/^authmodulelist=.*/authmodulelist="authmysql"/' /etc/courier/authdaemonrc
chmod x /var/run/courier/authdaemon
mkdir /vmail
chown vmail.vmail /vmail

###########################
# Configure the Authmysqlrc
###########################

mv /etc/courier/authmysqlrc /etc/courier/authmysqlrc.bakup
echo -e 'MYSQL_SERVER\tlocalhost' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_USERNAME\tpostfixadmin' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_PASSWORD\tpostfixadmin' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_SOCKET\t/var/run/mysqld/mysqld.sock' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_OPT\t0' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_DATABASE\tpostfix' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_USER_TABLE\tmailbox' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_CRYPT_PWFIELD\tpassword' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_UID_FIELD\t108' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_GID_FIELD\t108' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_LOGIN_FIELD\tusername' >> /etc/courier/authmysqlrc
echo -e "MYSQL_HOME_FIELD\t'/vmail/'" >> /etc/courier/authmysqlrc
echo -e 'MYSQL_NAME_FIELD\tname' >> /etc/courier/authmysqlrc
echo -e 'MYSQL_MAILDIR_FIELD\tmaildir' >> /etc/courier/authmysqlrc
echo -e "MYSQL_WHERE_CLAUSE\tactive='1'" >> /etc/courier/authmysqlrc

##<---------- SECTION 3 apache-------##

###########################
# Install apache2
###########################
apt-get -y install apache2 apache2-mpm-prefork

####################################
# Install PHP4 Support For Apache2
####################################
apt-get -y install libapache2-mod-php4 php4-cli php4-common php4-cgi

#####################################
# Configure apache2 for PHP4 Support
#####################################
mkdir /etc/apache2/modules
cp /usr/lib/apache2/modules/libphp4.so /etc/apache2/modules/
echo 'AddType application/x-httpd-php .php' > /etc/apache2/conf.d/php4.conf

##<---------- SECTION 4 Mysql -------##

####################################
# Install Mysql-Server-4.1
####################################
apt-get -y install mysql-server-4.1

#######################################
# Preption for Mysql and Postfixadmin
#######################################
m='/usr/bin/mysql'
pa='postfixadmin'

##################################################################
# Init Mysql and set a root account for Mysql password 123456
##################################################################
/usr/bin/mysql_install_db
/usr/bin/mysqladmin -u root password '123456'

################################################
# Install and Configure Mysql Module for PHP4
################################################
apt-get -y install php4-mysql
sed -i 's#^\(extension=\)\(mysql.so\)#\1/usr/lib/php4/20020429/\2#' /etc/php4/apache2/php.ini
echo 'extension_dir = "./"' >> /etc/php4/apache2/php.ini
/etc/init.d/apache2 restart

##<---------- SECTION 5 postfixadmin -------##

####################################
# Download postfixadmin-2.1.0
####################################
cd /var/www/
wget -c http://high5.net/page7_files/postfixadmin-2.1.0.tgz
tar zxf postfixadmin-2.1.0.tgz
mv postfixadmin-2.1.0 pa

##########################################
# Import the Mailbox infor into Mysql
##########################################
/usr/bin/mysql -uroot -p123456 < /var/www/pa/DATABASE_MYSQL.TXT

####################################
# Change some permissions
####################################
chown -R www-data.www-data /var/www/pa
cd /var/www/pa/
chmod 640 *.php *.css
cd /var/www/pa/admin/
chmod 640 *.php .ht*
cd /var/www/pa/images/
chmod 640 *.png
cd /var/www/pa/languages/
chmod 640 *.lang
cd /var/www/pa/templates/
chmod 640 *.tpl
cd /var/www/pa/users/
chmod 640 *.php

####################################
# Init Postfixadmin
####################################
cd /var/www/pa/
cp config.inc.php.sample config.inc.php
/usr/bin/php4 /var/www/pa/setup.php > /dev/null

上一篇:使用nfs使得mx邮件服务器跟mail storage 分开   下一篇:postfix中限制认证用户使用的sender address
[365Key收藏] [雅虎收藏+] [返回顶部] [打印本页] [关闭窗口]  
邮箱   相关文章
·使用nfs使得mx邮件服务器跟mail
·postfix中限制认证用户使用的sen
·postfix中如何获得一个邮件的信
·Postfix SMTP身份验证完整方案解
·postfix限制特定用户收发邮件的
·Red Hat 企业版4.1 antivir-ma
·基於FreeBSD6.1功能完善的mail s
·Postfix 日志脚本
·邮件帐号管理的shell script
·postfix邮件系统解决方案(源代码
·debian 3.0(sarge)下postfix邮件
·SPF在Postfix上的实现
免费邮箱 163邮箱  21CN邮箱  Gmail  Hotmail  QQ邮箱  SoGou邮箱  新浪邮箱  雅虎邮箱  
邮箱评测 企业邮箱评测  
企业邮局 企业邮箱  企业邮箱资讯  
移动邮件 技术前沿  手机邮件  
邮件系统 CMail Server  WinMail  SendMail  Qmail  Postfix  MDaemon Server  Lotus Notes  IMail Server  Foxmail Server  Exchange Server  Domino  Winwebmail  
邮件营销 网络营销  营销案例  营销技巧  邮件营销  
反垃圾邮件 Anti-Spam技术产品  新闻资讯  
邮件客户端 DreamMail  Foxmail  IncrediMail  KooMail  Outlook  The Bat!  
邮件安全
用户名: 新注册) 密码: 匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论
  热点文章
·Postfix SMTP身份验证完整方案解
·debian 3.0(sarge)下postfix邮件
·postfix邮件系统解决方案(源代码
·ExtMail Solution for FreeBSD
·Linux邮件服务器软件的分析评测
·SPF在Postfix上的实现
·postfix限制特定用户收发邮件的
·使用nfs使得mx邮件服务器跟mail
·ExtMail Solution HOWTO for Lin
·在DEBIAN 下安装POSTFIX 邮件系
·Postfix的TLS安装与设定
·Red Hat 企业版4.1 antivir-ma
网站首页 -  网站地图 -  域名注册 -  虚拟主机 -  企业邮箱  -  网站投稿  -  广告联系 -  帮助中心  -  

Copyright 2007-2008 Mail1.com.cn All Rights Reserved
本站内容均来自网络,如果侵犯版权请来信告知,核实后我们会在24小时删除 联系方式:
第一邮局QQ群:14743955 E-mail:www@onlinex.com.cn