sim clients with the same IP address
MaxClientsPerIP 8
# If you want to log all client commands, set this to
"yes
".
# This directive can be duplicated to also log server responses.
VerboseLog no
# List dot-files even when the client doesn
't send
"-a
".
DisplayDotFiles yes
# Don
't allow authenticated users - have a public anonymous FTP only.
AnonymousOnly no
# Disallow anonymous connections. Only allow authenticated users.
NoAnonymous no
# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is
"ftp
".
"none
" disables logging.
SyslogFacility ftp
# Display fortune cookies
# FortunesFile /usr/share/fortune/zippy
# Don
't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to
"yes
" on very busy servers or
# if you don
't have a working DNS.
DontResolve yes
# Maximum idle time in minutes (default = 15 minutes)
MaxIdleTime 15
# LDAP configuration file (see README.LDAP)
# LDAPConfigFile /etc/pureftpd-ldap.conf
LDAPConfigFile /usr/local/pureftpd/etc/pureftpd-ldap.conf
# MySQL configuration file (see README.MySQL)
# MySQLConfigFile /etc/pureftpd-mysql.conf
MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf
# Postgres configuration file (see README.PGSQL)
# PGSQLConfigFile /etc/pureftpd-pgsql.conf
PGSQLConfigFile /usr/local/pureftpd/etc/pureftpd-pgsql.conf
# PureDB user database (see README.Virtual-Users)
# PureDB /etc/pureftpd.pdb
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
# Path to pure-authd socket (see README.Authentication-Modules)
# ExtAuth /var/run/ftpd.sock
# If you want to enable PAM authentication, uncomment the following line
# PAMAuthentication yes
# If you want simple Unix (/etc/passwd) authentication, uncomment this
# UnixAuthentication yes
# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
# UnixAuthentication can be used only once, but they can be combined
# together. For instance, if you use MySQLConfigFile, then UnixAuthentication,
# the SQL server will be asked. If the SQL authentication fails because the
# user wasn
't found, another try # will be done with /etc/passwd and
# /etc/shadow. If the SQL authentication fails because the password was wrong,
# the authentication chain stops here. Authentication methods are chained in
# the order they are given.
#
'ls
' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth
LimitRecursion 2000 8
# Are anonymous users allowed to create new directories ?
AnonymousCanCreateDirs no
# If the system is more loaded than the following
value,
# anonymous users aren
't allowed to download.
MaxLoad 4
# Port range for passive connections replies. - for firewalling.
# PassivePortRange 30000 50000
# Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
# Symbolic host names are also accepted for gateways with dynamic IP
# addresses.
# ForcePassiveIP 192.168.0.1
# Upload/download ratio for anonymous users.
# AnonymousRatio 1 10
# Upload/download ratio for all users.
# This directive superscedes the previous one.
# UserRatio 1 10
# Disallow downloading of files owned by
"ftp
", ie.
# files that were uploaded but not validated by a local admin.
AntiWarez yes
# IP address/port to listen to (default=all IP and port 21).
# Bind 127.0.0.1,21
Bind 127.0.0.1,8021
# Maximum bandwidth for anonymous users in KB/s
# AnonymousBandwidth 8
# Maximum bandwidth for *all* users (including anonymous) in KB/s
# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.
# UserBandwidth 8
# File creation mask. : .
# 177:077 if you feel paranoid.
Umask 133:022
# Minimum UID for an authenticated user to log in.
MinUID 100
# Allow FXP transfers for authenticated users only.
AllowUserFXP yes
# Allow anonymous FXP for anonymous and non-anonymous users.
AllowAnonymousFXP no
# Users can
't delete/write files beginning with a dot (
'.
')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.
ProhibitDotFilesWrite no
# Prohibit *reading* of files beginning with a dot (.history, .ssh...)
ProhibitDotFilesRead no
# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...
AutoRename no
# Disallow anonymous users to upload new files (no = upload is allowed)
AnonymousCantUpload no
# Only connections to this specific IP address are allowed to be
# non-anonymous. You can use this directive to open several public IPs for
# anonymous FTP, and keep a private firewalled IP for remote administration.
# You can also only allow a non-routable local IP (like 10.x.x.x) to
# authenticate, and keep a public anon-only FTP server on another IP.
#TrustedIP 10.1.1.1
# If you want to add the PID to every logged line, uncomment the following
# line.
#LogPID yes
# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39]
"GET /ftp/linux.tar.bz2
" 200 21809338
# This log file can then be processed by www traffic analyzers.
# AltLog clf:/var/log/pureftpd.log
# Create an additional log file with transfers logged in a format optimized
# for statistic reports.
# AltLog stats:/var/log/pureftpd.log
#AltLog stats:/var/log/pureftpd.log
# Create an additional log file with transfers logged in the standard W3C
# format (compatible with most commercial log analyzers)
# AltLog w3c:/var/log/pureftpd.log
# Disallow the CHMOD command. Users can
't change perms of their files.
#NoChmod yes
# Allow users to resume and upload files, but *NOT* to delete them.
#KeepAllFiles yes
# Automatically create home directories if they are missing
#CreateHomeDir yes
# Enable virtual quotas. The first number is the max number of files.
# The second number is the max size of megabytes.
# So 1000:10 limits every user to 1000 files and 10 Mb.
#Quota 1000:10
# If your pure-ftpd has been compiled with standalone support, you can change
# the location of the pid file. The default is /var/run/pure-ftpd.pid
#PIDFile /var/run/pure-ftpd.pid
# If your pure-ftpd has been compiled with pure-upload
script support,
# this will make pure-ftpd write info about new uploads to
# /var/run/pure-ftpd.upload.pipe so pure-upload
script can read it and
# spawn a
script to handle the upload.
#CallUpload
script yes
# This option is useful with servers where anonymous upload is
# allowed. As /var/ftp is in /var, it save some space and protect
# the log files. When the partition is more that X percent full,
# new uploads are disallowed.
MaxDiskUsage 99
# Set to
'yes
' if you don
't want your users to rename files.
#NoRename yes
# Be
'customer proof
' : workaround against common customer mistakes like
#
'chmod 0 public_html
', that are valid, but that could cause ignorant
# customers to lock their files, and then keep your technical support busy
# with silly issues. If you
're sure all your users have some basic Unix
# knowledge, this feature is useless. If you
're a hosting service, enable it.
CustomerProof yes
# Per-user concurrency limits. It will only work if the FTP server has
# been compiled with --with-peruserlimits (and this is the case on
# most binary distributions) .
# The format is : :
# For instance, 3:20 means that the same authenticated user can have 3 active
# sessions max. And there are 20 anonymous sessions max.
# PerUserLimits 3:20
pureftpd-mysql.conf配置文件
###############################################################################
# #
# Sample Pure-FTPd Mysql configuration file. #
# See README.MySQL for explanations. #
# #
###############################################################################
# Optional : MySQL server name or IP. Don
't define this for unix sockets.
#MYSQLServer 127.0.0.1
# Optional : MySQL port. Don
't define this if a local unix socket is used.
#MYSQLPort 3306
# Optional : define the location of mysql.sock if the server runs on this host.
MYSQLSocket /var/lib/mysql/mysql.sock
# Mandatory : user to bind the server as.
MYSQLUser pureftpd
# Mandatory : user password. You must have a password.
MYSQLPassword qKiscCbwbXAkWp.
# Mandatory : database to open.
MYSQLDatabase pureftpd
# Mandatory : how passwords are stored
# Valid
values are :
"cleartext
",
"crypt
",
"md5
" and
"password
"# (
"password
" = MySQL password() function)
# You can also use
"any
" to try
"crypt
",
"md5
" *and*
"password
"#MYSQLCrypt leartext
MYSQLCrypt crypt
# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.
# Query to execute in order to fetch the password
MYSQLGetPW SELECT Password FROM users WHERE User=
"\L
"# Query to execute in order to fetch the system user name or uid
MYSQLGetUID SELECT Uid FROM users WHERE User=
"\L
"# Optional : default UID - if set this overrides MYSQLGetUID
#MYSQLDefaultUID 1000
# Query to execute in order to fetch the system user group or gid
MYSQLGetGID SELECT Gid FROM users WHERE User=
"\L
"# Optional : default GID - if set this overrides MYSQLGetGID
#MYSQLDefaultGID 1000
# Query to execute in order to fetch the home directory
MYSQLGetDir SELECT Dir FROM users WHERE User=
"\L
"# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User=
"\L
"# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User=
"\L
"# Optional : ratios. The server has to be compiled with ratio support.
# MySQLGetRatioUL SELECT ULRatio FROM users WHERE User=
"\L
"# MySQLGetRatioDL SELECT DLRatio FROM users WHERE User=
"\L
"# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
#
values are in KB/s .
MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User=
"\L
"MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User=
"\L
"# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match.
# MySQLForceTildeExpansion 1
# If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
# MySQLTransactions On
####################################建立ftp用户组##############################
pw groupadd ftpusers -g 2000
pw useradd ftp -u 2000 -g ftpusers -s /sbin/nologin
#################将以下代码保存成文本文件并命名成
script.mysql####################
INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv,
Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv,
Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv,
Index_priv, Alter_priv)
valueS
(
'localhost
',
'ftp
',PASSWORD(
'password
'),
'Y
',
'Y
',
'Y
',
'Y
',
'N
',
'N
',
'N
',
'N
',
'N
',
'N
',
'N
',
'N
',
'N
',
'N
');
FLUSH PRIVILEGES;
CREATE DATABASE ftpusers;
USE ftpusers;
CREATE TABLE admin (
Username varchar(35) NOT NULL default
'',
Password char(32) binary NOT NULL default
'',
PRIMARY KEY (Username)
) TYPE=MyISAM;
INSERT INTO admin
valueS (
'Administrator
',MD5(
'password
'));
CREATE TABLE users (
User char(16) NOT NULL default
'',
Password char(32) binary NOT NULL default
'',
Uid int(11) NOT NULL default
'2000
',
Gid int(11) NOT NULL default
'2000
',
Dir char(128) NOT NULL default
'',
QuotaFiles int(10) NOT NULL default
'500
',
QuotaSize int(10) NOT NULL default
'30
',
ULBandwidth int(10) NOT NULL default
'80
',
DLBandwidth int(10) NOT NULL default
'80
',
status enum(
'0
',
'1
') NOT NULL default
'1
',
ipaccess varchar(15) NOT NULL default
'*
',
comment tinytext NOT NULL,
PRIMARY KEY (User),
UNIQUE KEY User (User)
) TYPE=MyISAM;
INSERT INTO `users`
valueS (
'test1
',MD5(
'123456
'),2001,2000,
'/home/test1
',500,30,80,5,1,
'*
',
'*
');
##############################################################################################################################################################
#################################添加ftp用户数据库#############################
upload
script.mysql
mysql -u root -ppassword <
script.mysql
#################################启动pure-ftpd##################################
/usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf
也可以通过
/usr/local/etc/rc.d/pure-ftpd.sh start
提示一下信息证明pure-ftpd已经工作
Running: /usr/local/sbin/pure-ftpd -A -c50 -B -C8 -D -E -fftp -H -I15
-lmysql:/usr/local/etc/pureftpd-mysql.conf -L2000:8 -m4 -Q1:10 -s -U133:022
-u100 -Ow3c:/var/log/pureftpd.log -j -k99 -Z
#################################测试pureftp####################################
ftp 192.168.0.205
Connected to 192.168.0.205.
220---------- 欢迎来到 Pure-FTPd [TLS] ----------
220-您是第 1 个使用者,最多可达 50 个连接
220-现在本地时间是 13:17。服务器端口: 21。
220-这是私人系统 - 不开放匿名登录
220-这部主机也欢迎IPv6的连接
220 在 15 分钟内没有活动,您被会断线。
Name (192.168.0.205:chb):
输入用户名、密码
##################################设置ftp管理界面##############################
upload
chinaPHP_Manager
ee config.php
require
'language.php
';
$LANG = $ZH_CN; //Language (Options are $DUTCH, $ENGLISH, $PT_BR, $RUSSIAN
//$SPANISH, $COREAN, $FRENCH, $HUNGARIAN, $GERMAN
// $TURKISH, $DANISH , $NORWEGIAN or $ZH_CN)
$LocationImages =
"images
"; // Location of images
$DBHost =
"localhost
"; // Ip-adres of MySQL server
// (Dont change this if you are using the default database)
$DBLogin =
"ftp
"; // Username of MySQL user
$DBPassword =
"password
"; // Password of MySQL user
$DBDatabase =
"ftpusers
"; // Name of database
$FTPaddress =
"192.168.0.205:21
"; // Domain name or ip-address of your ftp server
$DEFUserID =
"2000
"; // nobody // Default user id of virtual ftp user.
$DEFGroupID =
"2000
"; // guest // Default group is of virtual ftp user.
##############################设置ftp管理的虚拟主机############################
ee /usr/local/etc/apache/httpd.conf
添加
documentRoot
"/home/chb/ftp
" ServerName
allow from all
Options +Indexes
###################################增加ftp启动项###############################
ee /etc/rc.conf
添加
pureftpd_enable=
"YES
" qmail服务器安装
###################################下载软件包##################################
Part 1 - Download the Software(
)
mkdir /downloads
cd /downloads
tar zxvf qmailrocks.tar.gz
##################################安装qmail主程序##############################
Part 2 - Installing Qmail Itself
/downloads/qmailrocks/
scripts/install/qmr_install_freebsd-s1.
script############qmr_install_freebsd-s1.
script内容##############
#!/bin/sh
#An automation
script to start the installation of qmail, ucspi-tcp and daemontools
#Specially formulated for Redhat, Fedora, RHEL and Whitebox Linux. :)
echo
"Creating initial qmail directories...
"echo
sleep 2
cd /downloads/qmailrocks
mkdir -p /var/qmail
mkdir /usr/src/qmail
echo
"Done!
"echo
sleep 2
echo
"Creating all needed users and groups...
"echo
sleep 2
#######
#
script to add users and groups for FreeBSD
#Add all need Qmail users and groups
pw groupadd nofiles
pw useradd alias -g nofiles -d /var/qmail/alias -s /sbin/nologin
pw useradd qmaild -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmaill -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmailp -g nofiles -d /var/qmail -s /sbin/nologin
pw groupadd qmail
pw useradd qmailq -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmailr -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmails -g qmail -d /var/qmail -s /sbin/nologin
#Add vpopmail users/groups
pw groupadd vchkpw
pw useradd vpopmail -g vchkpw -m -d /usr/home/vpopmail -s /sbin/nologin
#######
echo
"Done!
"echo
sleep 2
echo
"Unpacking qmail, ucspi-tcp and daemontools...
"echo
sleep 2
cd /usr/src/qmail
tar zxvf /downloads/qmailrocks/qmail-1.03.tar.gz
tar zxvf /downloads/qmailrocks/ucspi-tcp-0.88.tar.gz
mkdir -p /package
chmod 1755 /package
cd /package
tar zxvf /downloads/qmailrocks/daemontools-0.76.tar.gz
echo
"Done!
"echo
sleep 2
echo
"Next, we setup special logging directories...
"echo
sleep 2
mkdir /var/log/qmail
cd /var/log/qmail
mkdir qmail-send qmail-smtpd qmail-pop3d
chown -R qmaill:wheel /var/log/qmail
chmod -R 750 /var/log/qmail
echo
"Done!
"echo
sleep 2
echo
"And set up the supervise
script directories...
"echo
sleep 2
mkdir /var/qmail/supervise
cd /var/qmail/supervise
mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log
chmod +t qmail-smtpd qmail-send qmail-pop3d
echo
"Setting conf-split and conf-spawn
"echo
sleep 2
echo 211 > /usr/src/qmail/qmail-1.03/conf-split
echo 255 > /usr/src/qmail/qmail-1.03/conf-spawn
echo
"All steps completed!
"echo
sleep 2
######################### qmr_install_freebsd-s1.
script内容#########################
###############################################################################
/downloads/qmailrocks/
scripts/util/qmail_patches.
script ############### qmail_patches.
script内容##############
#!/bin/sh
#An automation
script to start the installation of qmail, ucspi-tcp and daemontools
#Specially formulated for Redhat, Fedora, RHEL and Whitebox Linux. :)
echo
"Creating initial qmail directories...
"echo
sleep 2
cd /downloads/qmailrocks
mkdir -p /var/qmail
mkdir /usr/src/qmail
echo
"Done!
"echo
sleep 2
echo
"Creating all needed users and groups...
"echo
sleep 2
#######
#
script to add users and groups for FreeBSD
#Add all need Qmail users and groups
pw groupadd nofiles
pw useradd alias -g nofiles -d /var/qmail/alias -s /sbin/nologin
pw useradd qmaild -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmaill -g nofiles -d /var/qmail -s /sbin/nologin
pw useradd qmailp -g nofiles -d /var/qmail -s /sbin/nologin
pw groupadd qmail
pw useradd qmailq -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmailr -g qmail -d /var/qmail -s /sbin/nologin
pw useradd qmails -g qmail -d /var/qmail -s /sbin/nologin
#Add vpopmail users/groups
pw groupadd vchkpw
pw useradd vpopmail -g vchkpw -m -d /usr/home/vpopmail -s /sbin/nologin
#######
echo
"Done!
"echo
sleep 2
echo
"Unpacking qmail, ucspi-tcp and daemontools...
"echo
sleep 2
cd /usr/src/qmail
tar zxvf /downloads/qmailrocks/qmail-1.03.tar.gz
tar zxvf /downloads/qmailrocks/ucspi-tcp-0.88.tar.gz
mkdir -p /package
chmod 1755 /package
cd /package
tar zxvf /downloads/qmailrocks/daemontools-0.76.tar.gz
echo
"Done!
"echo
sleep 2
echo
"Next, we setup special logging directories...
"echo
sleep 2
mkdir /var/log/qmail
cd /var/log/qmail
mkdir qmail-send qmail-smtpd qmail-pop3d
chown -R qmaill:wheel /var/log/qmail
chmod -R 750 /var/log/qmail
echo
"Done!
"echo
sleep 2
echo
"And set up the supervise
script directories...
"echo
sleep 2
mkdir /var/qmail/supervise
cd /var/qmail/supervise
mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log
chmod +t qmail-smtpd qmail-send qmail-pop3d
echo
"Setting conf-split and conf-spawn
"echo
sleep 2
echo 211 > /usr/src/qmail/qmail-1.03/conf-split
echo 255 > /usr/src/qmail/qmail-1.03/conf-spawn
echo
"All steps completed!
"echo
sleep 2
############################## qmail_patches.
script内容###########################
###############################################################################
cd /usr/src/qmail/qmail-1.03
make man
make setup check
./config-fast mail.tjhaina.net
/usr/ports/mail/qmail
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cd /usr/src/qmail/ucspi-tcp-0.88/
make
make setup check
/usr/ports/sysutils/ucspi-tcp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cd /package/admin/daemontools-0.76
package/install
reboot
/usr/ports/sysutils/daemontools
################################Part 3 - EZmlm##################################
Part 3 - EZmlm
cd /downloads/qmailrocks/
tar zxvf ezmlm-0.53-idx-0.41.tar.gz
cd ezmlm-0.53-idx-0.41
make
make setup
/usr/ports/mail/ezmlm
############################Part 4 - Qmail-Autoresponder ##########################
Part 4 - Qmail-Autoresponder
#pkg_add -r qmail-autoresponder
cd /downloads/qmailrocks
pkg_add qmail-autoresponder-0.96.1.tbz
/usr/ports/mail/qmail-autoresponder
################################art 5 - Vpopmail#################################
Part 5 - Vpopmail(I would like to install vpopmail with MySQL integration)
mkdir -p ~vpopmail/etc
mysql -u root -p
CREATE DATABASE vpopmail;
GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY
'password
';
quit
mysql -u vpopmailuser -p
quit
upload
iGENUS.mysql
mysql -u root -p < /home/chb/iGENUS.mysql
%%%%%%%%%%%%%%%%%%iGENUS.mysql%%%%%%%%%%%%%%%%%%%%%
DROP DATABASE vpopmail;
CREATE DATABASE vpopmail;
USE vpopmail;
CREATE TABLE `address` (
`id` int(11) unsigned NOT NULL auto_increment,
`pw_id` int(5) NOT NULL default
'0
',
`name` varchar(64) NOT NULL default
'',
`email` varchar(128) NOT NULL default
'',
UNIQUE KEY `id` (`id`),
KEY `pw_id` (`pw_id`)
) TYPE=MyISAM PACK_KEYS=1
CREATE TABLE `admin` (
`id` int(10) unsigned NOT NULL auto_increment,
`site_id` int(10) unsigned NOT NULL default
'0
',
`domain` varchar(128) NOT NULL default
'',
`quota` smallint(5) unsigned NOT NULL default
'0
',
`total` smallint(5) unsigned NOT NULL default
'0
',
`createtime` timestamp(14) NOT NULL,
`login` char(1) NOT NULL default
'',
`cur_total` smallint(5) NOT NULL default
'0
',
`cur_quota` smallint(5) NOT NULL default
'0
',
`gid` varchar(11) NOT NULL default
'',
`expiration_time` timestamp(14) NOT NULL,
`flag` int(10) unsigned NOT NULL default
'0
',
`maxmsg` int(10) unsigned NOT NULL default
'0
',
PRIMARY KEY (`id`),
UNIQUE KEY `domain` (`domain`)
) TYPE=MyISAM PACK_KEYS=1
CREATE TABLE `card` (
`id` int(5) unsigned NOT NULL auto_increment,
`pw_id` int(5) unsigned NOT NULL default
'0
',
`LinkMan` varchar(64) NOT NULL default
'',
`CompanyName` varchar(100) NOT NULL default
'',
`address` varchar(255) NOT NULL default
'',
`Position` varchar(32) NOT NULL default
'',
`PhoneNumber` varchar(16) NOT NULL default
'',
`Mobile` varchar(12) NOT NULL default
'',
`Email` varchar(128) NOT NULL default
'',
`Partaker` varchar(32) NOT NULL default
'',
`Memo` varchar(255) NOT NULL default
'',
PRIMARY KEY (`id`)
) TYPE=MyISAM
CREATE TABLE `lastauth` (
`user` char(32) NOT NULL default
'',
`domain` char(64) NOT NULL default
'',
`remote_ip` char(18) NOT NULL default
'',
`timestamp` bigint(20) NOT NULL default
'0
',
PRIMARY KEY (`user`,`domain`)
) TYPE=MyISAM;
CREATE TABLE `logs` (
`pw_id` int(5) default
'0
',
`ip` varchar(15) NOT NULL default
'',
`action` varchar(15) NOT NULL default
'',
`time` datetime default NULL,
`content` varchar(64) NOT NULL default
'',
`email` varchar(128) NOT NULL default
'' ) TYPE=MyISAM;
CREATE TABLE `message` (
`id` int(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default
'',
`body` text NOT NULL,
`createtime` datetime NOT NULL default
'0000-00-00 00:00:00
',
`updatetime` datetime NOT NULL default
'0000-00-00 00:00:00
',
`pw_domain` varchar(64) NOT NULL default
'',
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM
CREATE TABLE `personal` (
`id` int(11) unsigned NOT NULL auto_increment,
`pw_id` int(5) NOT NULL default
'0
',
`truename` varchar(10) NOT NULL default
'',
`fax` varchar(20) NOT NULL default
'',
`telephone` varchar(15) NOT NULL default
'',
`sex` int(1) NOT NULL default
'0
',
`year` int(4) NOT NULL default
'0
',
`MONTH` int(2) NOT NULL default
'0
',
`DAY` int(2) NOT NULL default
'0
',
`education` varchar(4) NOT NULL default
'',
`marital` int(1) NOT NULL default
'0
',
`occupation` varchar(15) NOT NULL default
'',
`companyname` varchar(30) NOT NULL default
'',
`province` varchar(6) NOT NULL default
'',
PRIMARY KEY (`id`)
) TYPE=MyISAM PACK_KEYS=1
CREATE TABLE `scheduler` (
`id` int(11) unsigned NOT NULL auto_increment,
`begin_time` int(11) unsigned default NULL,
`end_time` int(11) unsigned default NULL,
`title` varchar(255) NOT NULL default
'',
`body` varchar(255) NOT NULL default
'',
`pw_id` int(11) unsigned NOT NULL default
'0
',
PRIMARY KEY (`id`)
) TYPE=MyISAM
CREATE TABLE `stow` (
`id` int(5) unsigned NOT NULL auto_increment,
`pw_id` int(5) unsigned NOT NULL default
'0
',
`Name` varchar(128) NOT NULL default
'',
`http` varchar(255) NOT NULL default
'http://
',
`memo` varchar(255) NOT NULL default
'',
PRIMARY KEY (`id`)
) TYPE=MyISAM
create table vpopmail (
pw_id int(5) unsigned NOT NULL auto_increment,
pw_name varchar(32) NOT NULL default
'',
pw_domain varchar(64) NOT NULL default
'',
pw_passwd varchar(40) NOT NULL default
'',
pw_uid int(11) default NULL,
pw_gid int(11) default NULL,
pw_gecos varchar(64) default NULL,
pw_dir varchar(160) default NULL,
pw_shell varchar(20) default NULL,
pw_clear_passwd varchar(16) default NULL,
createtime timestamp(14) NOT NULL,
PRIMARY KEY (pw_id),
KEY pw_name (pw_name,pw_domain) )
TYPE=MyISAM PACK_KEYS=1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cd /downloads/qmailrocks
tar zxvf vpopmail-5.4.9.tar.gz
cd vpopmail-5.4.9
./configure \
--disable-roaming-users \
--enable-logging=p \
--disable-ip-alias-domains \
--disable-passwd \
--enable-clear-passwd \
--disable-domain-quotas \
--enable-auth-module=mysql \
--enable-many-domains \
--enable-auth-logging \
--enable-sql-logging \
--enable-valias \
--disable-mysql-limits
make
make install-strip
chown vpopmail:vchkpw ~vpopmail/etc
echo
"localhost|0|vpopmailuser|password|vpopmail
" > ~vpopmail/etc/vpopmail.mysql
chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql
chmod 640 ~vpopmail/etc/vpopmail.mysql
/home/vpopmail/bin/vadddomain 你的域名
之后回提示输入域管理员的密码
/home/vpopmail/bin/vadduser 邮件用户@你的域名
之后回提示输入邮件用户的密码
/usr/ports/mail/vpopmail
#############################Part 6 - Vqadmin###################################
Part 6 - Vqadmin
cd /downloads/qmailrocks
tar zxvf vqadmin-2.3.6.tar.gz
cd vqadmin-2.3.6
./configure \
--enable-cgibindir=/usr/local/www/cgi-bin \
--enable-htmldir=/usr/local/www/html
make
make install-strip
Now you will need to add the following to your server
's Apache configuration file (usually called httpd.conf)
ee /usr/local/etc/apache/httpd.conf
在末尾添加
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
cd /usr/local/www/cgi-bin/vqadmin
ee .htaccess
AuthType Basic
AuthUserFile /usr/local/etc/apache/conf/vqadmin.passwd
AuthName vQadmin
require valid-user
satisfy any
mkdir /usr/local/etc/apache/conf
chown www .htaccess
chmod 644 .htaccess
htpasswd -bc /usr/local/etc/apache/conf/vqadmin.passwd admin password
chmod 644 /usr/local/etc/apache/conf/vqadmin.passwd
apachectl stop
apachectl start
/usr/ports/mail/vqadmin
##############################Part 7 - Maildrop###################################
Part 7 - Maildrop
cd /downloads/qmailrocks
tar zxvf maildrop-1.6.3.tar.gz
cd maildrop-1.6.3
./configure \
--prefix=/usr/local \
--exec-prefix=/usr/local \
--enable-maildrop-uid=root \
--enable-maildrop-gid=vchkpw \
--enable-maildirquota
make
make install-strip
make install-man
/usr/ports/mail/maildrop
##############################Part 8 - Qmailadmin#############################
Part 8 - Qmailadmin
cd /downloads/qmailrocks
tar zxvf qmailadmin-1.2.3.tar.gz
cd qmailadmin-1.2.3
./configure \
--enable-cgibindir=/usr/local/www/cgi-bin \
--enable-htmldir=/usr/local/www/html/directory \
--enable-autoresponder-path=/usr/local/bin/qmail-autoresponder
make
make install-strip
/usr/ports/mail/qmailadmin
####################################Part 9 - Finalizing Qmail#######################
Part 9 - Finalizing Qmail
/downloads/qmailrocks/
scripts/finalize/freebsd/finalize_freebsd.
script ################# finalize_freebsd.
script##############
#!/bin/sh
echo
"This
scripts will perform 3 functions:\n
1. Copy all supervise
scripts to their proper locations.\n
2. Copy the qmail rc and qmailctl
scripts to their proper locations and create needed symlinks.\n
3. Set all needed permisions on all supervise
scripts.\n
"echo
echo
"Press ENTER to proceeed
"read
echo
sleep 2
echo
"Copying supervise
scripts to their correct locations...
"echo
sleep 2
cp /downloads/qmailrocks/
scripts/finalize/freebsd/pop3d_run /var/qmail/supervise/qmail-pop3d/run
cp /downloads/qmailrocks/
scripts/finalize/freebsd/pop3d_log /var/qmail/supervise/qmail-pop3d/log/run
cp /downloads/qmailrocks/
scripts/finalize/freebsd/smtpd_run /var/qmail/supervise/qmail-smtpd/run
cp /downloads/qmailrocks/
scripts/finalize/freebsd/smtpd_log /var/qmail/supervise/qmail-smtpd/log/run
cp /downloads/qmailrocks/
scripts/finalize/freebsd/send_run /var/qmail/supervise/qmail-send/run
cp /downloads/qmailrocks/
scripts/finalize/freebsd/send_log /var/qmail/supervise/qmail-send/log/run
echo Done!
echo
sleep 2
echo
"Copying rc and qmailctl
scripts to proper locations...
"echo
sleep 2
cp /downloads/qmailrocks/
scripts/finalize/rc /var/qmail/
cp /downloads/qmailrocks/
scripts/finalize/qmailctl /var/qmail/bin/
echo Done!
echo
sleep 2
echo
"Setting needed permisions...
"echo
sleep 2
chmod 755 /var/qmail/rc /var/qmail/bin/qmailctl
chmod 751 /var/qmail/supervise/qmail-pop3d/run
chmod 751 /var/qmail/supervise/qmail-pop3d/log/run
chmod 751 /var/qmail/supervise/qmail-smtpd/run
chmod 751 /var/qmail/supervise/qmail-smtpd/log/run
chmod 751 /var/qmail/supervise/qmail-send/run
chmod 751 /var/qmail/supervise/qmail-send/log/run
echo ./Maildir > /var/qmail/control/defaultdelivery
echo 255 > /var/qmail/control/concurrencyremote
chmod 644 /var/qmail/control/concurrencyremote
echo 30 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
ln -s /var/qmail/bin/qmailctl /usr/bin
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /var/qmail/supervise/qmail-pop3d /service
echo
"Done!
"echo
sleep 2
echo
"script Complete!
"echo
################# finalize_freebsd.
script##############
#######################################################
ee /var/qmail/supervise/qmail-pop3d/run
Find
"mail.example.com
" and change it to your server
's hostname. For example: mail.mydomain.com.
ee /var/qmail/supervise/qmail-smtpd/run
Find
"mail.example.com
" and change it to your server
's hostname. For example: mail.mydomain.com
qmailctl stop
echo
'127.:allow,RELAYCLIENT=
""' >> /etc/tcp.smtp
qmailctl cdb
echo b.s.d@163.com > /var/qmail/alias/.qmail-root
where
"some_address
" is the system user or email address you want these addresses aliased to.
echo b.s.d@163.com > /var/qmail/alias/.qmail-postmaster
where
"some_address
" is the system user or email address you want these addresses aliased to.
echo b.s.d@163.com > /var/qmail/alias/.qmail-mailer-daemon
where
"some_address
" is the system user or email address you want these addresses aliased to.
ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous
chmod 644 /var/qmail/alias/.qmail*
##########################Part 10 - Uninstalling Sendmail###########################
Part 10 - Uninstalling Sendmail
killall sendmail
mv /usr/sbin/sendmail /usr/sbin/sendmail.old
mv /usr/lib/sendmail /usr/lib/sendmail.old(this may not apply if there is no sendmail link or binary in this location)
chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old
Now we will need to instruct FreeBSD not to attempt to start Sendmail upon startup. This is done by make the following
modification to the /etc/rc.conf file:
Change sendmail_enable=
"YES
" to sendmail_enable=
"NONE
" ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
#ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
########################Part 11 - Starting up qmail#################################
Part 11 - Starting up qmail
/downloads/qmailrocks/
scripts/util/qmr_inst_check
################# qmr_inst_check内容###################
#!/bin/sh
# Qmailrocks, 2003-12-05
# I
've modified Dave Sill
's
script slightly to accomodate
# the variations between his Qmail installation and the
# Qmailrocks.org installation. The Qmailrocks version
# of this
script takes into account the slightly different
# loggind directory setup and a few permissions differences.
#
scripts/qmr_inst_check
# Dave Sill, 2003-11-10
#
# set to n if you
're not running a pop3 server, y if you are
CHECKPOP=y
CHECKSEND=y
QMHOME=/var/qmail
LBIN=/usr/local/bin
OK=1
if [ $# -eq 1 ]; then
if [
"$1
" =
"-v
" ]; then
VERB=y
else
VERB=n
fi
fi
if [ ! -d $QMHOME ]; then
echo
"! Couldn
't find qmail
's home directory, $QMHOME!
"else
if [
"$VERB
" = y ]; then
echo
"$QMHOME exists
"fi
for i in alias bin boot control doc man queue supervise users; do
if [ ! -d $QMHOME/$i ]; then
echo
"! Couldn
't find $QMHOME/$i!
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$QMHOME/$i exists
"fi
done
if [ ! -f $QMHOME/rc ]; then
echo
"! $QMHOME/rc is missing
"OK=0
elif [ ! -x $QMHOME/rc ]; then
echo
"! $QMHOME/rc is not executable
"echo
"...try: chmod 755 $QMHOME/rc
"OK=0
elif [ `head -1 $QMHOME/rc|cat -vet` !=
'#!/bin/sh$
' ]; then
echo
"! $QMHOME/rc has bad magic cookie
"echo
"...try: dos2unix $QMHOME/rc
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$QMHOME/rc is executable and has a valid magic cookie
"fi
fi
for i in alias qmaild qmaill qmailp qmailq qmailr qmails; do
grep
"^$i:
" /etc/passwd >/dev/null
if [ $? -ne 0 ]; then
echo
"! Couldn
't find $i user in /etc/passwd
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$i user exists
"fi
done
for i in qmail nofiles; do
grep
"^$i:
" /etc/group >/dev/null
if [ $? -ne 0 ]; then
echo
"! Couldn
't find $i group in /etc/group
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$i group exists
"fi
done
for i in tcprules tcpserver; do
if [ ! -x $LBIN/$i ]; then
echo
"! Couldn
't find $LBIN/$i from ucspi-tcp
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$i from ucspi-tcp is installed
"fi
done
for i in multilog softlimit setuidgid supervise svok svscan tai64nlocal; do
if [ ! -x $LBIN/$i ]; then
echo
"! Couldn
't find $LBIN/$i from daemontools
"OK=0
elif [
"$VERB
" = y ]; then
echo
"$i from daemontools is installed
"fi
done
if [ ! -d /servic