|
Blue Forest http://www.lslnet.com at 12:08 on July 28, 2006
Freebsd environment based on the anti-virus qmail Anti-Spam System Construction Freebsd 4.7 environment based on the anti-virus qmail Anti-Spam System Construction
Part I : INTRODUCTION
1. Copyright Information
Documents belonging to the copyright Peijun [peijun.jiang] all. Please journals fringe of the information and to ensure the integrity of the files!
On the author :
‘Peijun’ Peijun.Jiang for :
Peijun.jiang act tom.com mail address :
Local : www.chianunix.net along www.cnfug.org www.anti-spam.org.cn
UNIX revenue lovers for enterprise software development group in the joint venture as systems manager, was in charge of Mail, Firewall, FTP and Web services such as maintenance work.
2. Update records
May 14, 2003% of the initial draft
June 5, 2003 to set up parameters for the installation of a reasonable adjustment
September 8, 2003 increased by Mail From patch adding a batch adding user accounts and Wmail
December 1, 2003 accession to set up a simple DNS
January 12, 2004 by adding spam filtering and virus filter
The second part of the preparation before installation :
1. Necessary software
. ucspi-tcp-0.88.tar.gz http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
. cmd5checkpw-0.22.tar.gz http://members.elysium.pl/brush/cmd5checkpw/dist/cmd5checkpw-0.22.tar.gz
. qmail-1.03.tar.gz http://cr.yp.to/software/qmail-1.03.tar.gz
. qmail-smtpd-auth-0.30.tar.gz http://members.elysium.pl/brush/qmail-smtpd-auth/dist/qmail-smtpd-auth-0.30.tar.gz
. qmail-1.03.patch http://www.ckdhr.com/ckd/qmail-103.patch
. vpopmail-5.3.16.tar.gz http://www.inter7.com/devel/vpopmail-5.3.16.tar.gz
. autorespond.tar.gz http://www.netmeridian.com/e-huss/autorespond.tar.gz
. ezmlm-0.53.tar.gz http://cr.yp.to/software/ezmlm-0.53.tar.gz
. sqwebmail-3.5.0-CN.tar.gz http://www.cooco.net/files/sqwebmail-3.5.0-CN.tar.gz
. Qmail-smtpd.c http://www.cooco.net/files/qmail-smtpd.c
. Qmail-smtpd.path http://www.cooco.net/files/qmail-smtpd.patch
. mysql-3.23.53.tar.gz http://www.mysql.org/Downloads/MySQL-3.23/mysql-3.23.53.tar.gz
. wmail-1.00rc1.20030811-quota.tar.gz http://www.cooco.net/files/wmail-1.00rc1.20030811-quota.tar.gz
. qmailadmin-1.0.6.tar.gz http://www.inter7.com/qmailadmin/qmailadmin-1.0.6.tar.gz
. finished document http://www.cooco.net/files/en-us
2. Note
. After all the procedures download catalog on /down
. the installation of FreeBSD and /var /home am grateful to the large number of hours, because /home catalog is stored as a list of all users of mail, log is stored catalog /var
. Document all the operations are carried out under the root权限, operation and maximum careful not to cause unnecessary trouble due to misoperation
Part III : DNS set
. We use the DNS service for our parent company, I do not own DNS service for only A records and MX records relevant to my analysis on the relevant IP address. Nslooks -q=mx mail.localhost.com orders can be used to check the IP address of the company have been binding on us.
. Note : mail.localhost.com domain name for our company, following the same.
You can set up their own DNS service for the following methods :
DNS, bringing their use of the 8.3.3 version of FreeBSD 4.7, all configuration files acquiescence in /etc/namedb catalog. The IP address for my DNS service 192.168.80.53, Mail server for the IP address 192.168.80.80. Analysis of a domain name localhost.com as my mail server domain name.
1. Switch to open the startup named
#cd /etc
#ee Rc.conf 4003rd adding some parameters
Named_enable= "yes"
2. The solutions used to generate documents localhost.rev make-localhost
#cd /etc/namedb
#sh /etc/namedb/make-localhost
3. Set up the main configuration file
#mv Named.conf named.conf.old
#touch Named.conf
Add some content #ee named.conf 4003rd
Options --
Directory "/etc/namedb";
Datasize 40M;
Forward only;
Forwarders (
61.134.1.4; 4003rd this IP address for my ISP DNS
};
};
Zone. " "--
Type hint;
File "named.root";
};
Zone "0.0.127.in-addr.arpa" --
Type master;
File "localhost.rev";
};
Zone "localhost.com"
Type master;
File "/etc/namedb/hosts/localhost.com.hosts";
};
Zone "80.168.192.in-addr.arpa" --
Type master;
File "/etc/namedb/rev/192.168.80.rev";
};
4. /etc/namedb Catalog building hosts the catalog to understand the configuration file is stored
#mkdir /etc/namedb/hosts
#cp /etc/namedb/localhost.rev /etc/namedb/hosts/locolhost.com.hosts 4003rd use of existing configuration files for tinkering on the list
#ee /etc/namedb/hosts/localhost.com.hosts 4003rd reads
$TTL 3600
@ IN SOA dns.localhost.com. Root.dns.localhost.com. (
//Serial Number 20031231
3600 //DNS refresh time
900 4003rd re-test interval
3600000 4003rd due time
3600) //Minimum
IN NS dns.cnunix.com.cn.
IN MX 10 mail
Dns IN A 192.168.80.53
Www IN A 192.168.80.80
Mail IN A 192.168.80.80
@ IN A 192.168.80.80
5. In /etc/namedb catalog creation reb catalog solution to the distribution of anti-document storage
#mkdir /etc/namedb/reb
#cp /etc/namedb/localhost.rev /etc/namedb/reb/192.168.80.rev
#ee /etc/namedb/reb/192.168.80.rev 4003rd reads
$TTL 3600
@ IN SOA dns.localhost.com. Root.dns.localhost.com. (
20031231
3600
900
3600000
3600 )
IN NS dns.localhost.com.
53 IN PTR dns.localhost.com.
80 IN PTR www.localhost.com.
80 IN PTR mail.localhost.com.
80 IN PTR localhost.com.
6. Update root servers
#cd /etc/namedb
#fetch Ftp://ftp.rs.internic.net/domain/named.root
7. Laws /etc/resolv.conf
#nameserver 192.168.80.53
8. DNS service for routine maintenance of order
If the suggested new start 4003rd #ndc pid is NamedID that has been successfully launched
#ndc Stop 4003rd stop service named
#ndc Restart 4003rd restart named services
9. Analytical test named
#nslookups
";www.cnunix.com.cn
";mail.cnunix.com.cn
";dns.cnunix.com.cn
If the analysis shows normal to 192.168.80.53
";sohu.com
";sina.com.cn
If analysis of the corresponding IP addresses to domain names, domain analysis also shows the dns outside of the normal.
Part IV : installation of basic services
1. Install webmin
Webmin you is a very convenient remote management server process, all the work is carried out in the form of Web-based, supported by many countries including the Chinese language. I mainly use him my Mysql database and qmail Queue management, I have been using, it is also very convenient and practical.
#cd /down
#tar Zxvf webmin-1.070.tar.gz
#mv Webmin-1.070 /usr/local/webmin
#cd /usr/local/webmin
#./setup.sh
According suggested that the importation of installation path, habits port, the provision of user and password management, can also set up the way the transport acquiescence.
2. Mysql installing and
1. Mysql installation
The database is based on the binary files of the packages installed, the authors have previously used method of installation mode ports, the two installation methods are provided to all this, for you to choose. However, the authors suggest the use of binary packages installed, in the mysql installation process parameters can be customized according to their own needs.
1.1, the use of ports installed
#cd /usr/ports/database/mysql323-server
#make Install
#cd Work/mysql-3.23.52
#scripts/mysql_install_db
#cp Support-files/my-medium.cnf /etc/my.cnf
#/usr/local/bin/safe_mysqld & 4003rd activated mysql services
1.2, the use of binary code installation
A. Team-building and users
#pw Groupadd mysql
#pw Useradd mysql g mysql s /nonexitent
B. For the translation
#cd /down
#tar Zxvf mysql-3.23.53.tar.gz
#cd Mysql-3.23.53
#./configure --prefix=/usr/local/mysql
#make
#make Install
2. Installed Mysql
2.1, running the script, adding Contents
#scripts/mysql_install_db
#mkdir /usr/local/mysql/var
2.2, altered documents and catalogs authority
#chown R root /usr/local/mysql
#chown R mysql /usr/local/mysql/var
#chgrp R mysql /usr/local/mysql
2.3, mysql complex system configuration files to /etc catalog
#cp. /support-files/my-medium.cnf /etc/my.cnf
2.4, adding activated Script
#echo "/usr/local/mysql/bin/safe_mysqld --user=mysql --skip-networking &" ";>; /etc/rc.local
Note : --skip-networking parameters of the machine can be restricted only link mysql increase mysql security.
2.5, mysql service launched
#/usr/local/mysql/bin/sase_mysqld --skip-networking & --user=mysql
2.6, change root passwords
#/usr/local/mysql/bin/mysqladmin U root password 'EPI'
2.7, mysql-copy documents and the 1986-1991 Judge incdule documents to the system catalog
#cp /usr/local/mysql/lib/mysql/* /usr/lib
#cp /usr/local/mysql/incdule/mysql/* /usr/incdule
Note : copies of the 1986-1991 Judge mysql documents and the catalog is the first document to the system to prevent unable to find the 1986-1991 Judge mysql incdule catalog and the catalogs and wrong.
2.8, the user mysql operating added vpopmail
#/usr/local/mysql/bin/mysql U root -p123456
Mysql>;create database vpopmail;
Mysql>;grant all on vpopmail.* to vpopmail@localhost identified by "123456";
3. Installation TCPSERVER
The package is similar to the structure of inetd order style client / server application process tool, which is designed for the purpose has been completely replaced by inetd better performance and safety. Tcpserver provide parallel process to prevent the restriction on the amount of memory and CPU resources are depleted Tcpserver TCP also provides access control, similar to the tcp-wrappers/tcpd hosts.allow and hosts.deny, but much faster speed.
1, the installation
#cd /down
#tar Zxvf ucspi-tcp-0.88.tar.gz
#cd Ucspi-tcp-0.88
#make Setup check
2, document generation cdb
#cd /etc
#touch Tcp.smtp
#ee Tcp.smtp 4003rd adding some content
127.0.0.1:allow, RELAYCLIENT= ""
#/usr/local/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp "/etc/tcp.smtp
4. Installation cmd5checkpw
Cmd5checkpw and checkpassword compatible, cmd5checkpw CRAM-MD5 only added to the authentication model, the latest version is 0.22, it was necessary to have security loopholes in the previous version, we must use the latest version.
#cd /down
#mkdir /usr/man
#mkdir /usr/man/man8
#tar Zxvf cmd5checkpw-0.22.tar.gz
#cd Cmd5chedkpw-0.22
#make
#make Install
If you do not have to open mail /etc/passwd of users, there would be no need to install checkpassword, because I do not, so I did not install. If you want to use, we can look at ways :
#cd /down
#tar Zxvf checkpassword-0.90.tar.gz
#cd Checkpassword-0.90
#make Setup check
5. Installation Qmail
Qmail is a UNIX-based mail transfer agent [Mail Transfer Agent, MTA], using the standard Simple Mail Transfer Protocol [Simple Mail Transfer Protocol. SMTP] mail and other Internet transmission [MTA] agent for the exchange of information. Qmail is the current version 1.03, released in 1998. Qmail currently still in development, version 2.0 has not yet been set a specific release time. A few days ago, launched a 1.04 version, the version of the patch used to increase the number of qmail, interested friends of this trial version.
1. Qmail create catalogs, and user groups
1.1, the creation of Contents :
#mkdir /var/qmail
#mkdir /var/qmail/alias
1.2, the operating group added qmail users :
#pw Groupadd nofiles
#pw Groupadd qmail
#pw Useradd alias /var/qmail/alias s-d-g nofiles /nonexistent
#pw Useradd qmaild /var/qmail s-d-g nofiles /nonexistent
#pw Useradd qmaill /var/qmail s-d-g nofiles /nonexistent
#pw Useradd qmailp /var/qmail s-d-g nofiles /nonexistent
#pw Useradd qmailq g qmail-d s /nonexistent /var/qmail
#pw Useradd qmailr g qmail-d s /nonexistent /var/qmail
#pw Useradd qmails g qmail-d s /nonexistent /var/qmail
2, the installation of translation Qmail
2.1, introduced patch program
A:qmail-103.patch
To resolve some of the patch program is not in full compliance with RFC standards to respond to DNS, DNS response packet to return more than 512Byte may arise, which
Send mail to such a situation occurred in a huge number of MX records of a large mail server, the log will find the check qmail following error message :
Deferral:CNAME_lookup_failed_temporarily._ (#4.4.3) /
B:qmail-smtpd.c
The patch is a correction smtp认证 the proceedings.
C : qmail-smtpd.patch
The patch is Diez user name and address inconsistencies mail from the patch can also write thank gadfly with friends!
D:qmail-1.03.patch
The patch is a patch qmail support SMTP authentication.
2.2, and editing hard patch installed qmail
#cd /down
#tar Zxvf qmail-1.03.tar.gz
#patch-D. /qmail-1.03 "Qmail-103.patch
#tar Zxvf qmail-smtpd-auth-0.30.tar.gz
#cd Qmail-smtpd-auth-0.30
#cp README.auth base64.c base64.h. . /qmail-1.03
#patch-D. . /qmail-1.03 "Auth.patch
#cd. .
#cp Qmail-smtpd.c. /qmail-1.03
#patch-D. /qmail-1.03 "Qmail-smtpd.patch
#cd. /qmail-1.03
#make Setup check
#config-fast Localhost.com
3, set up drop boxes
#cp /var/qmail/boot/home /var/qmail/rc
#ee /var/qmail/rc 4003rd for the following changes rc
Exec env - PATH= "/var/qmail/bin:$PATH" \
Qmail-start. /Maildir/ Splogger qmail
4, added the alias accounts can receive mail system
#touch /var/qmail/alias/.qmail-root
#touch /var/qmail/alias/.qmail-postmaster
#touch /var/qmail/alias/.qmail-mailer-daemon
#echo Postmaster "; /var/qmail/control/bouncefrom 4003rd set up mail delivery failed to return to the sender postmaster
5, stop service handbook
#ee /etc/rc.conf
Sendmail_enable= "NO"
Sendmail_flags= "-bd"
Sendmail_outbound_enable= "NO"
Sendmail_submit_enable= "NO"
Sendmail_msp_queue_enable= "NO"
#chmod 0 /usr/sbin/sendmail
#mv /usr/sbin/sendmail /usr/sbin/sendmail.old
Qmail handbook of the documents linked to the shell handbook of Contents
#ln S /var/qmail/bin/sendmail /usr/sbin/sendmail
#ln S /var/qmail/bin/sendmail /usr/lib/sendmail
6. Vpopmail introduction, installation and configuration
1, on
Vpopmail qmail is a very important expansion of the software, which is developed by Inter7 [http://www.inter.com] companies, mainly to support virtual qmail mail domain, but the configuration and user management is very complicated and troublesome and design. It is characterized by a qmail account all users use only one operating system user accounts, and all are in the process of vpopmail related to a GID/UID operation, the mail system's user accounts and separation system to improve the safety of the mail system. It supports virtual mail based on domain names and IP addresses, domain, each virtual mail domain independent of each other, through the use of trees filled with a balance of technical, mail vpopmail virtual domain support 23 million each virtual mail domain can support 23 million mail accounts. Vpopmail also supports LDAP, Oracle, Sybase, Mysql, PostgreSQL user authentication information such as memory, allowing users to create and maintain one million level to facilitate the realization of the very large mail system.
2, the principles of virtual domain
Qmail mail to a local area (local) and virtual (virtual) concept. Matching /etc/passwd account system is the geographical and virtual domain is the qmail configuration files virtualdomains matching the various jurisdictions. Vpopmail users/assign and use qmail virtualdomains the document. Users/cdb users/assign documents are translated into the format, which uses a database system to speed up the search speed of Kazakhstan, has been a model for arbitrary matching qmail defined in the document on the use of relational Forty transmission of the mail and document definition to the list. Vpopmail use this method to make qmail vpopmail/vchkpw capacity to transmit a single virtual domain mail all users, thus realizing the ~vpopmail/domains/<virtualdomain>; catalog will mail transmission to the various users.
For qmail, qmail-local users/assign receive information from the procedure once, and their operating standards. Qmail file operations. In general,. Qmail-<user>; mail the completed document to be used to transmit, aliases, or call other procedures such as ezmlm. If not find matching, qmail-local search. Qmail-default document, which is the final step qmail-local mail delivery mechanism, the paper activation vedlivermail qmail use the procedure for the two parameters to be deployed not a current role, mainly to the use of backwards compatibility, and the second parameter to use in a virtual domain users default when the drop was not found, in general, pre-delivery mail will be delivered to a mailing list or a return back to the user no such letter.
3, installation
3.1, the creation of Contents
#mkdir /home/vpopmail
#mkdir /home/vpopmail/etc
3.2, and the user group established
#pw Groupadd vchkpw
#pw Useradd vpopmail g vchkpw
3.3, the installation vpopmail
#cd /down
#tar Zxvf vpopmail-5.3.16.tar.gz
#cd Vpopmail-5.3.16
4003rd changes following #ee vmysql.h
# MYSQL_UPDATE_SERVER "localhost" //mysql name server
# MYSQL_UPDATE_USER "vpopmail" user names 4003rd visit Mysql database
# MYSQL_UPDATE_PASSWD "EPI" 4003rd visit Mysql database user passwords vpopmail
# MYSQL_READ_SERVER "localhost" //mysql name server
# MYSQL_READ_USER "vpopmail" user names 4003rd
# MYSQL_READ_PASSWD "EPI" 4003rd passwords
Or use Mysql root user and password can!
3.4, the creation of documents tcp.smtp
/etc/tcp.smtp Or documents can be used.
#ee /home/vpopmail/etc/tcp.smtp
127.0.0.1:allow, RELAYCLIENT= ""
3.5, the compiler installation
#./configure
--prefix=/home/vpopmail 4003rd designated installation path
--enable-mysql=y 4003rd applied Mysql database
Contents include document database where --enable-incdir=/usr/local/include/mysql //Mysql
--enable-libdir=/usr/local/lib/mysql //Mysql Documents located catalog database 1986-1991 Judge
--enable-default-domain=localhost.com 4003rd definition of virtual domain names
--enable-passwd=n 4003rd use of password authentication system
--enable-defaultquota=52428800 4003rd definition of default size boxes, 10485760 for 10MB,20971520 to 50MB for 20MB,52428800s
--enable-tcprules-prog=/usr/local/bin/tcprules 4003rd designated tcprules Contents
--enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp 4003rd tcprules designated document application rules
--enable-vpopuser=vpopmail //vpopmail Users
The group --enable-vpopgroup=vchkpw //vpopmail
--enable-ip-alias-domains=n 4003rd in the virtual domain allows virtual domain through reverse IP address lookup
--enable-roaming-users=n 4003rd support foreign users SMTP RELAY
--enable-sqwebmail-pass=y //sqwebmail Support the password
#make
#make Install-strip
#chmod ± /home/vpopmail/bin/vchkpw
7. Pop3 and SMTP startup script
1, start building pop3 Script
#mkdir /etc/qmail
#cd /etc/qmail
#touch Pop.sh
#chmod 755 pop.sh
Add some content #ee pop.sh 4003rd
#!/bin/sh
/usr/local/bin/tcpserver Localhost.com H U-series dating method R-c 100 0 pop3-V-l \ \ /var/qmail/bin/qmail-pop3d Maildir & /var/qmail/bin/qmail-popup localhost.com /home/vpopmail/bin/vchkpw
2, start building SMTP script
#touch Smtp.sh
#chmod 755 smtp.sh
#ee Smtp.sh add about :
#!/bin/sh
LOG_AUTH=1
Export LOG_AUTH
QMAILUID=`id u qmaild`
QMAILGID=`id g qmaild`
Localhost.com /usr/local/bin/tcpserver H-R-t-l-p 1-c x 100-V g $QMAILGID $QMAILUID /etc/tcp.smtp.cdb \ u \ 0 /usr/bin/true /bin/cmd5checkpw /usr/bin/true & SMTP /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw
Caution : If the patch is 0.31, qmail-smtpd insert localhost.com, the problem can be solved Diez
3, qmail start Script
#mkdir Start.sh
#chmod 755 start.sh
#ee Start.sh 4003rd adding about :
#!/bin/sh
Csh -cf '/var/qmail/rc &'
/etc/qmail/pop.sh
/etc/qmail/smtp.sh
#echo "/etc/qmail/start.sh" ";>; /etc/rc.local 4003rd qmail installed and activated automatically activate the relevant script
4, restart system
#reboot
5, check to a virtual domain
#cd /home/vpopmail/bin
#./vadddomain Localhost.com
If added to the failure to delete virtual domain, and then to see whether there vpopmail mysql database table. If not please check whether the owner of vpopmail mysql database users have all the powers (of the source document or amend vpopmail vmysql.h use root user database), and then re-install vpopmail procedures.
#./vdeldomain Localhost.com
8. Re-editing mysql database
1, Laws mysql database
Until remember in order to use vdeldomain Adding to delete all your mail domain.
#/usr/local/mysql/bin/mysql U root -p123456
Use vpopmail;
Drop table vpopmail;
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) NULL default.
Pw_dir varchar (160) default NULL.
Pw_shell varchar (20) NULL default.
Pw_clear_passwd varchar (16) NULL default.
PRIMARY KEY (pw_id)
KEY pw_name (pw_name, pw_domain)
) TYPE=MyISAM;
Quit
2, a virtual domain and re-users
#cd /home/vpopmail/bin
#./vadddomain Localhost.com
Import postmaster password, which is used after the password qmailadmin management of virtual domain localhost.com
#./vadduser Test
Password test
3, testing qmail
Client Application of Foxmail test or use mail accounts test@localhost.com Outlook users who test (or test@localhost.com because localhost.com as tacit approval of domain names there is no need to import test behindlocalhost.com), the key test, choose SMTP authentication required, the test can account for the collection and distribution of mail. If you are in full accordance with the above method, and no wrong, I think you will have no problem with that. ^_^ Wish you the best of luck.
Thus, a band smtp认证, mail from check, the basic support multiple virtual domain mail system has been installed to complete. If you want to join the function, and then they would do, I will take you step-by-step completed.
Part V : Installation qmailadmin
1. Installation x
1, the installation
#cd /down
#tar Zxvf apache_1.3.26.tar.gz
#cd Apache_1.3.26
#./configure --prefix=/usr/local/apache --with-mysql=/usr/local/bin --enable-shared=max
#make
#make Install
2 start
#/usr/local/apache/bin/apachectl Start
#echo "/usr/local/apache/bin/apachectl Start," and ";>; /etc/rc.local 4003rd activated together with the system installed Apache
2. Installation qmailadmin
1, the installation installed ezmlm
1.1, installation
#cd /down
#tar Zxvf ezmlm-0.53.tar.gz
#cd Ezmlm-0.53
#make
#make Man
#make Setup
1.2, adding mysql support the ezmlm
A : creating a database ezmlm
#/usr/local/mysql/bin/mysql U root-p
Mysql>;create database ezmlm;
B : mysql support adding installed ezmlm
#tar -zxvf Ezmlm-0.53.tar.gz
#tar -zxvf Ezmlm-idx-0.40.tar.gz
#mv Ezmlm-idx-0.40/* ezmlm-0.53/
#cd Ezmlm-0.53
#patch "Idx.patch
#cd Sub_mysql
#ee Sub_mysql/conf_sqlcc
-I/usr/local/mysql/include/mysql
#ee Sub_mysql/conf_sqld
-L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl -lm -lz
#cd. .
#make Mysql
#make Clean
#make Man
#make Ch_GB
#make Setup
This is just the setup for a netizen ezmle adding mysql support, not because I have too much mail list, so I tried to install, but only just installed
Ezmle. If you need mysql support, you can try!
2, installation autorespond
#cd /down
#tar Zxvf autorespond.tar.gz
#cd /autorespond
#gcc -Wall -o Autorespond autorespond.c
#cp Autorespond /usr/local/bin/autorespond
3, installation qmailadmin
Qmailadmin Web is a way vpopmail management software, you can use it very convenient to add / delete users, change user passwords, and setting up mail forwarding and automatic reply to mail list management functions, etc., if you use it, you will love it. because it does give you the management of convenience.
#cd /down
#tar Zxvf qmailadmin-1.0.6.tar.gz
#cd Qmailadmin-1.0.6
#./configure
#make
#make Install-strip
4, the management of finished pages qmailadmin
#cd /down
#cp En-us /usr/local/share/qmailadmin/html/en
5, testing qmailamdin
Http://mail.localhost.com/cgi-bin/qmailadmin
Localhost.com input fields :
Postmaster input the password is imported when you add virtual domain password localhost.com
Part VI : Installation webmail
1. Sqwebmail installing and
1, the installation sqwebmail
#cd /down
#tar Zxvf sqwebmail-3.5.0-cn.tar.gz
#cd Sqwebmail-3.5.0
#./configure --without-authpam --with-db=db --enable-webpass=yes --without-authpwd \
--without-authshadow --without-authmysql --with-authldap --with-authuserdb --with-authpwd \
--with-authvchkpw --without-authdaemon
#make Configure-check
#make
#make Install-strip
#make Install-configure
2, special features
If you need to use virtual users both users and system verification, we need to conduct some provision :
#echo "Authvchkpw authshadow" "; /usr/local/share/sqwebmail/authmodulelist
After setting up the above, you use the shadow test users of the system, using virtual domain vchkpw certification, in other test methods.
3, testing sqwebmail
Http://mail.localhost.com/cgi-bin/sqwebmail
User-test, the key test, the test can receive and send mail after landing out!
4, Apache changes
#cd /usr/local/apache/htdocs
#touch Index.html
#ee Index.html 4003rd imported about :
"Html>;
"Head>;
"Title>;MAIL SYSTEM</title>;
"Meta http-equiv=" Content-Type "content=" test/html;charset=gb2312' "";
"Meta http-equiv=" refresh "content=" 0;url=http://mail.localhost.com/cgi-bin/sqwebmail "";
"/head>;
"Body bgcolor=" #FFFFFF "test=" #000000 "";
"/html>;
With the above change, you can pass :
Http://mail.localhost.com
Sqwebmail directly to the visit, convenience repeatedly :)
2. Installation Wmail
1, the installation Wmail
#cd /down
#tar Zxvf wmail-1.00rc1.20030811-quota.tar.gz
#cd Wmail-1.00rc1.20030724
#./install
/home/wmail Acquiescence to the installation directories. You can also revise the original code catalog wmail install document to amend the list of installation and customization of editing parameters.
2, configuration Wmail
The revised /home/wmail/html/zh-cn invalid.html index.html and related items for the following :
"Input type=" hidden "name="_ftn1"" down "value=" localhost.com "";
3, Apache changes
Editor's httpd.conf文件 64A, in the final by adding the following elements :
NameVirtualHost 192.168.80.80
"VirtualHost 192.168.80.80:80>;
SetEnv SQWEBMAIL_TEMPLATEDIR /home/wmail/html
ScriptAlias "/cgi-bin/" "/home/wmail/www/cgi-bin/"
"Directory" /home/wmail/www "";
AllowOverride All
Options +Includes
"/Directory>;
ServerAdmin postmaster@localhost.com
DocumentRoot /home/wmail/www
ServerName mail2.localhost.com
"/VirtualHost>;
4, testing Wmail
Http://mail2.localhost.com
User-test, the key test, the test can receive and send mail after landing out!
3. Sqwebmail coexistence and the establishment Wmail
Wmail through the provision of the above, you will find that they use qmailadmin sqwebmail and could not land among the URL, it is because the problems caused by setting up a virtual server, and qmailadmin sqwebmail CGI path unable to find the reasons. Therefore, it is still necessary to address sqwebmail and qmailadmin visit virtual server setup, as long as the Apache httpd.conf configuration file by adding the following as the last moment face.
"VirtualHost 192.168.0.2:80>;
ScriptAlias "/cgi-bin/" "/usr/local/apache/cgi-bin"
"Directory" /usr/local/apache/htdocs "";
AllowOverride All
Options +Includes
"/Directory>;
ServerAdmin postmaster@localhost.com
DocumentRoot /usr/local/apache/htdocs
ServerName mail.localhost.com
"/VirtualHost>;
After this provision, each of the following URL :
Sqwebmail : http://mail.localhost.com
QmailAdmin : http://mail.localhost.com/cgi-bin/qmailadmin
Wmail : http://mail2.localhost.com
Part VII : The use of shell batch adding users
1. The first method
1. /home Catalog in the founding documents adduser.sh
#touch Adduser.sh
#chmod 755 adduser.sh
2, edited adduser.sh
#ee Adduser.sh 4003rd adding about :
#!/usr/bin
While read line
Do
Echo $line
/home/vpopmail/bin/vadduser $line $line
Done "user
3, the creation of paper documents list of accounts
#touch User
#ee User 4003rd following form
Peijun.jiang
User
User1
User2
......
4, the implementation adduser.sh
#./adduser.sh
This document, the user will be added to users acquiescence jurisdictions, the same user names and passwords.
Note : This method is provided by friends Tianxiangdan tea!
2. The second method
1, document creation batchuseradd.sh
#cd /home
#touch Batchuseradd.sh
#chmod 755 batchuseradd.sh
#ee Batchuseradd.sh 4003rd as follows :
#!/bin/sh
#batchadduser.sh : Solvents add mail user.
#install Step.
#chmod U+x batchadduser
#./batchadduser.sh Domain datafile
$# -lt If [2]
Then
Echo "usage : $ 0 domain datafile"
Exit 1
Fi
Domain=$1
Datafile=$2
Addcmd=/home/vpopmail/bin/vadduser
While read username passwd
Do
$addcmd $username@$domain $passwd
Done "$datafile
2, document creation datafile
#touchu Datafile
#ee Datafile 4003rd following form :
User1 passwd1
User2 passwd2
User3 passwd3
..... ......
#chmod U+x datafile
3, use
#./batchuseradd Localhost.com datafile
Note : This method is provided by friends gadfly!
Part VIII : virus scanning and spam filtering installed
We use is a specially designed for qmail mail scanning procedures, he can realize what functions :
1. And a number of other business can be integrated virus scanning mail virus scanner
2. Can filter the mail containing a specific character or features, such as containing a specific string and content, or from specific senders won, and the papers contain specific file name suffix.
It is the working principle of the indentation in the mail after mail queue for mail scanning, to replace the qmail-scanner
Qmail-queue procedure is, speaking from the principles of efficiency should be pretty good.
1. Installation Clamav
1. Download Clamav
# Cd /down/
# Fetch http://download.sourceforge.net/clamav/clamav-0.65.tar.gz
# Tar zxvf clamav-0.65.tar.gz
2. Add the user group and
# Pw groupadd clamav
Pw /nonexistent # useradd clamav-g-c-d-clamav "Clam Antivirus" s /sbin/nologin
3. Installation Clamav
# Cd clamav-0.65
#. /configure
# Make install
4. Test Clamav
# Clamscan --recursive --log=/tmp/clamscan.log. / 4003rd scanning the current catalog, testing whether the operation clamscn
5. Upgrading Clamav
# Freshclam --verbose 4003rd clamscan virus database upgrade
6. Create log records document freshclam
# Touch /var/log/freshclam.log
# Chmod 644 /var/log/freshclam.log
# Chown clamav:clamav /var/log/freshclam.log
7. Automatically activate the script creation Clamav
#touch /usr/local/etc/rc.d/clamav.sh 4003rd reads
#!/bin/sh
#
# Startup / shutdown script for Clam Antivirus
Case "$ 1" in
Start)
2 - 1-c-d /var/log/freshclam.log /usr/local/bin/freshclam
Echo-n 'freshclam'
;;
Stop)
/usr/bin/killall Freshclam "; /dev/null 2>;&1 \
, Named echo-n 'freshclam'
;;
*)
Echo ""
Echo "Usage : $ 0` `basename (start | stop)"
Echo ""
Exit 64
;;
Esac
# Chmod 744 /usr/local/etc/rc.d/clamav.sh
/usr/local/etc/clamav.conf Document change, dropping below the previous option # :
#Example Adding #
LogFile /tmp/clamd.log removed the previous #
LogFileMaxSize removed from the front # 2M
LogTime removed from the front #
PidFile /var/run/clamd.pid removed the previous #
DataDirectory front of the # /var/lib/clamav removed, and changes to the road /usr/local/share/clamav
7. Add automatic upgrade script
# Crontab-e
0 8 * * * /usr/local/bin/freshclam --quiet l /var/log/freshclam.log
8. Add automatic scanning /home Contents
# Corntab-e
0 6 * * * root /usr/local/bin/clamscan --recursive
--infected
--exclude /usr/local/share/clamav/viruses.db
--exclude /usr/local/share/clamav/viruses.db2
--log=/var/log/clamscan.log
/home
2. SpamAssassin
1. Perl Module Installation
-MCPAN-E shell or perl use webmin
Time : : HiRes
File : : Spec
Getopt : : Long
Pod : : Parser
HTML : : Speech Tagset
HTML : : Parser
MIME : : Base64
MIME : : QuotedPrint
Net : : Cmd
Net : : Ping
Net : : DNS
Digest : : SHA1
File : : Copy
Digest : : Nilsimsa
URI : : Escape
2. SpamAssassin installation
# Cd /down
# Fetch http://spamassassin.taint.org/released/Mail-SpamAssassin-2.61.tar.gz
# Tar -zxvf Mail-SpamAssassin-2.61.tar.gz
# Cd Mail-SpamAssassin-2.61
# Perl Makefile.PL
# Make
# Make install
3. SpamAssassin tests
# Spamassassin t "sample-spam.txt"; Spam.out
# Cat /spam.out
X-Spam-Status : Yes, hits=14.7 required=5.0
Tests=ALL_CAPS_HEADER, CALL_FREE, DATE_IN_PAST_24_48.
DRASTIC_REDUCED, FROM_HAS_MIXED_NUMS, HOME_EMPLOYMENT.
INVALID_DATE, INVALID_MSGID, LINES_OF_YELLING.
MSGID_HAS_NO_AT, NO_REAL_NAME, ONCE_IN_LIFETIME, REMOVE_SUBJ.
SMTPD_IN_RCVD, SPAM_PHRASE_21_34, UNDISC_RECIPS
Version=2.61
X-Spam-Flag : yes
X-Spam-Level : **************
X-Spam-Checker-Version : SpamAssassin 2.61 (1.115.2.20-2002-10-15-exp)
# Spamassassin t "sample-nonspam.txt"; Nonspam.out
X-Spam-Status : No, hits=0.9 required=5.0
Tests=GAPPY_TEXT, LINES_OF_YELLING, PGP_SIGNATURE.
SPAM_PHRASE_02_03, TO_BE_REMOVED_REPLY
Version=2.61
X-Spam-Level
:
3. Script started building SpamAssassin
# Touch /usr/local/etc/rc.d/spamd.sh 4003rd reads
#!/bin/sh
#
# Startup / shutdown script for SpamAssassin encryption
Case "$ 1" in
Start)
/usr/bin/spamd Vpopmail F 0-d-u-V : An echo-n 'spamd'
;;
Stop)
Spamdpid=`ps -ax | grep spamd | grep-V-V sh | grep | grep awk '(print $ 1)' `
If [ "$spamdpid"> ""] then
Kill $spamdpid "; /dev/null 2>;&1
Echo-n "spamd"
Fi
;;
*)
Echo "Usage : $ 0` {start|stop} `basename" ";&2
;;
Esac
Exit 0
# Chmod 744 /usr/local/etc/rc.d/spamd.sh
# /usr/local/etc/rc.d/spamd.sh Start
3. Maildrop
# Cd /usr/ports/mail/maildrop
# Make
# Make install
# Cd /usr/ports/archivers/zip
# Make install
Http://telia.dl.sourceforge.net/sourceforge/tnef/tnef-1.2.3.tar.gz
TNEF was an "application/ms-tnef." Annex MIME types to identify the procedure. It is only an annex of Microsoft System
#. /configure
# Make
# Make install
4. Qmail-scan
1. Qmail-queue patch program
# Cd /down
# Fetch http://www.qmail.org/qmailqueue-patch
# Patch-d. /qmail-1.03 "Qmailqueue-patch
# Killall qmail-send
# Make setup check
# Csh -cf '/var/qmail/rc &'
2. Installation qmail-scanner
# Cd /down
# Fetch http://telia.dl.sourceforge.net/sourceforge/qmail-scanner/qmail-scanner-1.20.tgz
# Tar -zxvf qmail-scanner-1.20.tgz
# Cd qmail-scanner-1.20
# Pw groupadd qscand
Pw-c # useradd qscand "Qmail-Scanner Account" g qsand s /bin/false
#. /configure -help
#. /configure --admin "User" --domain "test.com" --scanner clamscan, verbose_spamassassin --lang en_GB -install
# chmod 4755 /var/qmail/bin/qmail-scanner-queue.pl
# chown -R qmailq:qmail /var/spool/qmailscan/
# chown qmailq:qmail /var/qmail/bin/qmail-scanner-queue.pl
# /var/qmail/bin/qmail-scanner-queue.pl -r //查看qmailscan当前包含的特征
# /var/qmail/bin/qmail-scanner-queue.pl –g //保存qmailscan定义特征的修改,使他生效。
# chmod 4511 /usr/bin/suidperl
如果提示:can’t do setuid,那就就是suidperl没有设置set位,或者没有安装perlsetuid。
3.设置qmail使用qmail-scan
在smtp启动脚本中添加:
PATH=$PATH:/usr/local/bin:/var/qmail/bin
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
export PATH QMAILQUEUE
然后重新启动smtp服务
4.测试安装
# cd /usr/local/qmail-scanner/qmail-scanner-1.20
# ./contrib/test_installation.sh -doit
这个脚本会设定的管理员邮件地址发送3个邮件,第一个邮件是一般的正常邮件,第二个邮件中会包含eicar.com测试病毒,第三个邮件同样包含eicar.com测试病毒,不过所附带的文件名不是eicar.com。
如果qmail-scanner安装正确,管理员就应该可以收到关于后面的两个邮件的警告邮件。
如果系统出错,可以查看/var/spool/qmailscan/qmail-queue.log日志文件。
qmail-scanner的特征过滤在/var/spool/qmailscan/quarantine-atachments.txt
五. SpamAssassin的使用
建立SpamAssassin的学习系统
#sa-learn --rebuild -D -p user_prefs
sa-learn --dump all可以查看自学习的数据信息
spamassassin的过滤模板在/etc/mail/spamassassin/local.cf,修改为:
required_hits 5.0
rewrite_subject 1
subject_tag ********SPAM********
report_safe 1
defang_mime 0
rewrite_subject 0
report_header 1
use_terse_report 1
use_bayes 1
auto_learn 1
skip_rbl_checks 1
use_razor2 0
use_dcc 0
use_pyzor 0
score SUBJ_FULL_OF_8BITS 0.0
score BASE64_ENC_TEXT 0.0
score BAYES_99 0.1
score BAYES_90 0.1
score SUBJ_ILLEGAL_CHARS 0.1
score FROM_ILLEGAL_CHARS 0.5
score HEAD_ILLEGAL_CHARS 0.5
score MIME_BASE64_TEXT 0.5
ok_locales en zh
六. 使用Maildrop调用SpamAssassin
在/home/vpopmail/domains/localhost.com/建立mailfilter文件
# touch mailfilter
# chown vpopmail:vchkpw mailfilter
# chmod 700 mailfilter
mailfilter内容如下:
VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
VHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST`
if ( $SIZE < 262144 )
{
exception {
xfilter "/usr/bin/spamc -f -u $EXT@$HOST"
}
}
if (/^X-Spam-Flag: YES/)
{
# try filtering it using user-defined rules
exception {
include $VHOME/Maildir/.mailfilter
}
# then try delivering it to a Spam folder
exception {
# to "$VPOP"
to "$VHOME/Maildir/.Spam/"
}
# ah well, I guess they'll just have to live with disappointment
exception {
to "$VPOP"
}
}
else
{
exception {
include $VHOME/Maildir/.mailfilter
}
exception {
to "$VPOP"
}
}
修改.qmail-default内容如下:
maildrop mailfilter
第九部分:附 录
1.Qmail的主要配置文件
qmail的配置文件是由多个文件组成的,不是集中在一个文件中,每个文件控制相应部分的功能和属性,一个可执行程序可能有多个配置文件控制,所有的配置文件共同决定了qmail运行的实现和模式。这些配置文件都在qmail的control目录中,本文的配置文件位于/var/qmail/control目录中
1.1、badmailfrom
这个配置文件是控制邮件系统拒绝接收的邮件地址和邮件域,主要是为了防止垃圾邮件。如果一个邮件地址或者邮件域被列入到这个文件中,系统就会拒绝接收这个邮件地址发来的邮件,或者拒绝邮件域下所有邮件地址发来的邮件。不过这个配置文件只是一般的垃圾邮件防范手段,对于比较全面的垃圾邮件过滤技术还要靠第三方软件来实现。该文件的格式如下:
11@11.com //拒绝这个地址发来的邮件
22@2w.com
@33.com //拒绝这个邮件域下的所有帐号发来的邮件
@44.com
1.2、boucefrom
bouceform是定义当邮件投递失败时系统返回给发送者一个包含失败信息的邮件时的发送者。如果不存在这个文件,默认的发送者是MAILER-DAEMON。比如本文的
echo postmaster >; /var/qmail/control/bouncefrom
就是定义投递者为postmaster,这样所有投递失败的返回邮件的发送者就成了postmaster。
1.3、concurrencylocal
这个文件定义了qmail可以同时投递的本地邮件的个数。这个参数的缺省值是10,也就是说系统允许同时有10个邮件在本地投递。concurrencylocal这个参数的最大值是由编译时的conf-spawn参数来决定的,缺省值是120,最大值是255。
1.4、concurrencyremote
这个参数定义了qmail可以同时投递的远端邮件的个数,这个参数的缺省值是20。这个参数的最大值也是由conf-spawn来决定的。
1.5、defaultdomain
它主要用于邮件用户在投递给同一邮件服务器的邮件用户时的邮件投递处理,比如邮件服务器cnunix.com.cn用户user发送邮件给另一个邮件用户user1@cnunix,这实qmail-inject会将defaultdomain中定义的邮件域名加入到这个邮件的目标地址中,qmail会自动认为这个邮件的目标地址是user1@cnunix.com.cn,并按照这个地址进行投递。当这个文件不存在的时候,qmail会从配置文件me中读取这个参数。如果系统变量QMAILDEFAULTDOMAIN已经设置,defaultdomain定义的参数将被忽略。
1.6、defaulthost
它和defaultdomain类似,当邮件系统接收到没有目标主机名的邮件时,这个设置文件定义了系统往这个邮件中加入的目标主机名名称。在缺省情况下,qmail-inject会将defaulthost中定义的名称加入到没有定义投递邮件地址的邮件的目标主机名中,如果defaulthost不存在,加入的目标主机名将时字符串“defaulthost”,defaulthost主要用于邮件用户在投递给同一邮件服务器的邮件进行投递处理。如果系统变量QMAILDEFAULTHOST已经设置,defaulthost定义的参数将被忽略。
1.7、databyes
它定义了qmail-smtpd所允许接收的邮件的最大字节数。这个参数的缺省值为0,表示对接收邮件的字节数没有限制。如果要限制最大的接收为10M,操作如下:
echo 10485760 >; /var/qmail/control/databytes
这是任何大于10M的邮件都会被拒绝。这个参数最好设置上,以避免恶意的对你服务器发送大量的超大邮件,产生邮件服务器负荷过大,甚至系统崩溃的危险。
1.8、doublebouncehost
这个配置文件定义了出现“双重反弹”的时候,系统转发的邮件的主机名称。“双重反弹”就是当系统因为投递失败将邮件返回给发送者时,发送者又将此邮件返回,这个时候qmail将会把这个邮件转发到另一个邮件地址,一般这个地址就是管理员的地址。doublebouncehost就是定义这个转发的邮件地址的主机名部分,而这个邮件地址的用户名部分是由doublebouceto来定义的,因此这两个配置文件一般都是结合起来使用的。当doublebouncehost不存在的时候,系统将会从配置文件me中读取这个参数。
1.9、doublebounceto
这个参说是结合blebouncehost来使用的,当这个参数不存在的时候,系统缺省值是postmaster用户。
1.10、helohost
这个配置文件定义了当程序qmail-remote和远程邮件系统建立连接时所使用的主机名。如果这个配置文件不存在,系统将会从配置文件me中读取这个参数值,如果me不存在,qmail-remote将不能正常运行工作。
1.11、locals
这个配置文件是定义本地邮件域的,在qmail-send处理邮件投递时,将会使用locals定义的值和邮件的目标地址进行比较,如果相同,系统就会将这个邮件投递到本地交给qmail-lspawn来处理。如果一个邮件的目标主机名在locals找不到,系统将会把这个邮件投递到远端邮件服务器系统,即使这个邮件的目标地址可能是本地邮件系统的。如果locals不存在,系统将会从配置文件me中读取这个参数,如果me不存在,qmail-send将不能正常运行。
1.12、me
这个配置文件是qmail系统十分重要的一个文件,如果这个文件不存在,qmail系统将无法运行。me是用来定义本地邮件服务器的主机名的,上面已经介绍到了,有多个配置文件是和me有关联的,如果那些配置文件不存在系统默认会从me中读取参数值的。me这个配置文件一般都是在qmail系统安装时使用configure-fast来创建的,在上面qmail系统安装的时候已经使用过了这个参数。
1.13、queuelifetime
这个配置文件是定义一个邮件在邮件队列中存活的时间,缺省值为7天(604800s),这个期限掉了以后qmail-send将会进行最后一次的投递尝试,如果投递失败,该邮件将会从邮件队列中删除。
1.14、rcphosts
这个配置文件也是qmail一个十分重要的文件,这个文件是定义系统允许转发邮件的邮件域,如果这个文件不存在或者为空,你的系统将会接收Internet上所有的域的邮件转发,即你的系统是Open relay。配置文件rcpthosts最多可以支持50个主机名和域名,如果超个这个数字,就需要保存到他的扩充配置文件morercphosts中,然后使用qmail的命令程序qmail-newmrh(在本系统中,该文件在/var/qmail/bin目录下)来生成二进制的morercpthosts.cdb文件,这样qmail-smtpd才可以从这个二进制文件中读取信息。
1.15、virtualdomains
这也是qmail的一个非常重要的配置文件,它定义了qmail的虚拟邮件域,qmail结合vpopmail的虚拟域管理功能可以定义多个虚拟邮件域。
1.16、smtproutes
这个配置文件是定义qmail邮件系统的静态SMTP路由表信息的,他的格式应该是:
HOST: targetHOST //HOST可以是主机名或者域名。这行所表示的是意思是将所有目标是HOST的邮件转发到targetHOST邮件服务器中,这个是最常规的表示方式。
下面给一些例子和一些特殊的表示方法:
cnunix.com.cn:cnunix.com //这行表示的意思是将所有发往cnunix.com.cn的邮件全部转发到cnunix.com这个邮件服务器。qmail不会在cnunix.com.cn邮件服务器中投递时查询DNS中的MX记录,直接投递到cnunix.com邮件服务器中,加快了投递的速度。
.cnunix.net: //这行表示强迫qmail对DNS的MX记录进行查询,因为没有定义转发的主机名,qmail将在DNS中查询任何以.cnunix.net结尾的邮件服务器
:mail.cnunix.com.cn:2525 //这行定义表示所有发往该机器的所有邮件都将会转发到mail.cnunix.com.cn这个邮件服务器,并且转发到对方的2525端口,这个方式一般都是做邮件网关时用的到的。
注意:smtproutes如果设置不正确或者DNS的变动会产生邮件的循环投递。
1.17、timeoutconnect
这个配置文件定义了qmail-remote在和远端SMTP服务器在SMTP连接断开以前接受一个新的连接等待的最大时间(单位为秒s),默认值为一分钟(60s)。如果你的网络连接速率比较低,就需要相应的调整这个参数到一个适合的值。
1.18、timeoutremote
这个配置文件定义了qmail-remote等待远端的SMTP服务器相应时等待的最大时间,默认值为20分钟(1200s),如果到达这个最大值没有相应,qmail才和对方断开连接并且把失败的记录写到qmail的日志中。
1.19、smtpgreeting
这个配置文件定义了用户在登录SMTP服务时显示的系统欢迎信息。修改这个信息可以掩盖一些你的系统的本身的信息,可以相对的迷惑一下登录者:)
2. vpopmail参数附录
一般选项:
2.1、--enable-roaming-users=n|y
当pop3认证通过后,是否打开对该用户的邮件转发(mail relay),缺省是关闭的。若设置该选项为y,当某个用户通过了pop3认证,则将其IP地址加入许可通过该邮件服务器进行relay的列表中。一个名为clearopensmtp的cronjob程序可以用来实现在这一段时间以后从允许转发邮件地址列表中将该IP地址清除。这个选项要求以-x /etc/tcp.smtp.cdb选项来使用tcpserver运行smtp服务器。
2.2、--enable-hardquota=size|n
size为具体的数字。设置或打开磁盘限额功能,NOQUOTA缺省为50M,这里=后面的数字单位为字节,如果要限制磁盘限额为10M就需要使用下面这个配置参数:
--enable-hardquota=10000000
若磁盘限额超出,将拒绝接受该用户的新邮件,并返回一封拒绝信息邮件,其中的信息可以定制。
2.3、--enable-default-domain=name
该选项为设定缺省域名,推荐将所有的域都设置为虚拟域,并选中一个作为缺省域。对于缺省域的用户,其通过接受邮件时,只需要在用户名中设置其邮件用户名即可,对于其他非缺省域的用户,则需要将用户名设置为<user>;@<virtualdomain>;的格式才能通过pop3接受信件。
2.4、--enable-ip-alias-domains=y|n
允许通过反向解析来查看虚拟域。缺省情况下,每个域使用基于虚拟域的名字,也就是用户必须在pop3用户名中提供相应的域信息,也就是<user>;@<virtualdomain>;.当然也可以使用enable-default-domain配置选项来覆盖该要求。Vpopmail同样支持基于IP地址的虚拟域,若该选项打开则用户不需要在pop3用户名中提供@<virtualdomain>;,vpopmail自动对该用户连接的服务器IP地址进行反向解析,若解析得到一个域名,则vpopmail使用该名字作为域,例如:IP:x.x.x.x对应域名test.com,用户设置pop3服务器的IP地址进行反向DNS查询,得到test.com域名,用户使用test作为用户名,vpopmail使用test.com。
2.5、--enable-relay-clear-minutes=360
允许漫游用户通过邮件服务器的转发邮件的时间段。 若--enable-roamin-users=y,则该选项设置clearopensmtp应该保持该IP在允许列 表中的时间,缺省是3小时。
Mysql options:
2.6、--enable-mysql=n|y
使用mysql,缺省是no.允许通过将账号存放在mysql数据库中来认证用户。
注意:在配置和编译以前需要修改文件vmysql.h,正确的设置mysql服务器的Name/Ip, mysql用户和mysql用户密码。该用户必需要拥有创建数据库和在其中创建表格的权限。
2.7、--enable-sqlincdir=
sql头文件的目录,缺省为/usr/local/mysql.
2.8、--enable-sqllibdir=/usr/lib/mysql
库文件libmysqlclient.a的目录,缺省为/usr/lib/mysql
2.9、--enable-sqllibs=mysqlclient
mysql库名,缺省为libmysqlclient.a.
2.10、--enable-large-site=n|y
缺省值为no,使用该选项是为了适应大量用户的情况。缺省的vpopmail将所有的域信息存放在同一个table-vpopmail中,这对于一般情况下具有很好的效率。但是对于大量用户的系统,则需要将该选项设置为yes。这时候,vpoomail将为每个域创建一个table。最主要的区别是域名不存放在数据库中,因为表格包含了域名。对于大于500,000+的用户,这可以节省大量的磁盘空间。但是对于有大量虚拟域的系统可能会影响mysql的性能。
Vpasswd/cdb options
2.11、--enable-ucspi-dir=dir
编译好ucspi-tcp包的目录位置,使用该目录来设定ucspi-tcp软件包的路径,缺省为../ucspi-tcp-0.84。vpopmail需要使用该目录中的头文件和两个.a文件。
Logging options
2.12、--enable-logging=e|y|n
打开(y)或关闭(n)使用syslog进行log,或e仅仅log错误信息。设置log级别,缺省仅仅记录pop认证错误信息。
2.13、--enable-log-name=vpopmail
设置log名
User/group options
2.14、--enable-vpopuser=vpopmail
若使用其他的用户来安装该软件包,则在该选项中指定组名。
2.15、--enable-vpopgroup=vchkpw
若使用其他的组来安装该软件包,则在该选项中指定组名。
2.16、--enable-admin-email=email-address
系统管理员的电子邮件地址。
Directory and file location options
2.17、--enable-tcpserver-file=/etc/tcp.smtp tcpserver –x
使用的邮件转发配置文件的存放目录,缺省为/etc
2.18、--enable-qmaildir=dir
qmail的安装目录指定,缺省为/var/qmail。
2.19、--enable-tcprules-prog=/usr/local/bin/tcprules
tcprules程序的安装位置,缺省为/usr/local/bin
2.20、--enable-apop-file=/etc/apop-secrets
apop密钥存放目录
Other options
2.21、--enable-apop=y|n
允许或禁止apop认证,缺省是yes
2.22、--enable-passwd=y|n
允许或禁止/etc/passwd(或shadow)认证。覆盖自动配置,缺省的配置程序将自动检测系统是使用passwd或shadow密码,通过设置该选项为no,可以禁止所有的/etc/passwd账号认证。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
匆忙之中完成此稿,由于时间有限,所以难免有错误之处,望各位批评指正。谢谢! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
又看到老兄的文章了 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
好啊!收藏!顶! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
好文,收藏!! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
| Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
好文,谢peijun。 :) |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
哇,非常不错,收藏,明天按照你的文章做一遍,哈哈 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
linux下安装也一样???? |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
你好,我是一个新手,你在文章里制定的本机域名为localhost.com,
这与系统文件很多地方同名??
使我不明白,能不能改个别的名,配置文件是不明白!
谢谢! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
按照贴字,为什么我的foxmail在收信的时候总要重新输入密码呢? :oops: |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
能不能,在文章里把localhost.com, 标明哪个是你的域名,哪个是系统文件?
谢谢! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
[color=red]为何我安装完qmailadmin之后无法通过qmailadmin登陆,发邮件正常,但不可以接收是怎么回事?[/color] |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
好文,收藏!! |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
[code]1.安装Perl模块
使用webmin或者perl –MCPAN –e shell
[/code]
我试了几次,webmin 装不上,有很多模块下载不了。执行perl –MCPAN –e shell电脑没反应。
请教各大侠,有没有详细点的说明。多谢了。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
装不上就多装几次。
当初装98多少次,现在就装cpan多少次。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
楼上的老大,我在两台机新安装了 freebsd 4.9 后马上执行
[code]perl –MCPAN –e shell Time::HiRes File::Spec Getopt::Long Pod::Parser
HTML::Tagset HTML::Parser MIME::Base64 MIME::QuotedPrint Net::Cmd Net::Ping Net::DNS Digest::SHA1 File::Copy Digest::Nilsimsa URI::Escape
[/code]
(这是一个命令吧?)
电脑没反应。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
你装这么多啊?
我可是先 install CPAN
install LWP
然后再一次一个安装的。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
我执行perl –MCPAN –e shell的时候问了一大堆的问题?到底应该怎么做呀?请说的详细点了。谢谢。 |
Freebsd环境下基于qmail系统的反病毒反垃圾邮件系统构建
-->
老大,我对perl 没什么了解,也不知那个命令是什么,你是怎么做的?可不可以说清楚点,我在这先谢谢你了。 |
| |