Database management of QMAIL mail accounts through VPOPMAIL
Linuxaid.com.cn
Ideal
〖
Back to〗 Forward〗
Database management summary of QMAIL mail account is implemented by vpopmail: This article discusses how to separate QMAIL mail accounts and system accounts through VPOPMAIL on the "QMAIL Using System User as a Mail Account". s solution. Hardware environment: HP NetServer E60 128M memory single network card software environment: redhat6.2 vpopmail4.9.4 qmail1.3 mysql-3.23.22-beta ucspi-TCP-0.88 Foreword 1, MySQL installation 2, vpopmail installation process 3, vpopmail detailed configuration Option 4, qmail and virtual domain 5, the author's installation process Exfoliration in a mail server is a QMAIL user is very concerned about one of the questions that is very concerned about this problem. In order to solve this problem, Inter7 has developed VPOPMail, which complies with GPL copyright. (Vchkpw) to facilitate user convenience to implement mail virtual domains and non-system accounts on a QMAIL mail server. It has a characteristic: ● All QMAIL configuration and data files provide a modified command with a detailed description. ● Just occupying a system account, all related processes are running under a single UID / GID. support virtual domains based on NAMED and IP. Safe use of NFS. ● By using the three-level balance tree filling technology to create a mail directory for ten to 10 million users. ● Provide configurable recording functions according to the management needs of the real world. ● Support Oracle, Sybase, MySQL, LDAP, / etc / passwd, / etc / shadow, and default CDB user authentication information storage. ● Direct data directly to maildir, come and qmail-pop3d, .qmail file, or any other MAILDIR program. ● Do not need to provide a lot of .qmail files for virtual domains, each domain has its own directory in the hostage user home directory, each domain has a separate password file. ● Detailed instructions can be used in scripting files and remote management. ● All VPopMail features have a detailed description documentation. Moreover, the following packages are provided to enhance QMAIL VPOPMAIL characteristics: ● QMAILADMIN is based on web-based VPopmail management tools. ● VQSIGNUP a CGI program based on a VPOPMAIL management tool that allows users to apply for an Email account. ● Courier IMAP IMAP server. ● Sqwebmail based on the web-based Email client.
1, mysql installation; the source code of the RPM package used by the author, so first unlock the RPM package: [root @ radiusd ideal] # rpm -ivh mysql-3.23.22-1.src.rpm mysql #### ################################################## @Radiusd ideal] # CD / usr / src / redhat / Sources / [root @ Radiusd Sources] # ls -al Total 6432 DRWXR-XR-X 2 Root Root 4096 OCT 29 14:07. drwxr-xr-x 7 root root 4096 OCT 30 2000 .. -rw-r - r - 1 Root Root 6560696 JUL 30 11:23 mysql-3.23.22-beta.tar.gz -rw-rw-r-- 1 root root 3082 JUL 30 11 : 23 mysql.gif [root @ Radiusd Sources] # tar xvgz mysql-3.23.22-beta.tar.gz decompressed source code package, generates the subdirectories of MySQL-3.23.22-Beta in the current directory, which contain The mysql source code and then use the following command to install: ./configure make make install scripts / mysql_install_db implements the MySQL database server installation, where the command to start the MySQL server is: / usr / local / mysql / bin / safe_mysqld & Now implements the installation and operation of the MySQL database server, and we should set up basic user rights information. By default, MySQL has a default user who has control over the database. The name is root, so the first should add access to the user: [root @ Radiusd SRC] # mysql -u root mysql Reading Table Information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor Commands end with; or g Your MySQL connection id is 183 to server version:. 3.23.22-beta Type '. Help 'for help. mysql> This enters the client of the mysql server, then issued SQL statement command: Update user set password = password (' new_password ') where user =' root '; flush privilege; here new_password is for MySQL The password set up by the root user.
However, it is generally recommended to create a single permission and root, the command is as follows: INSERT INTO User Values ('Host', 'User', 'PASSWD', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); General, MySQL and ICRADIUS server are running On the same server, this time, Host is Localhost, if your ICRADIUS server is running on another server, you need to set the name of your ICRADIUS server here. The user is the user name, password for the user's password. 2, Vpopmail installation process 1, unzipped package: [root @ www src] # tar xvfz vpopmail-4.9.4.tar.gz 2, add required group and user: [root @ www vpopmail-4.9.4] # / usr / sbin / groupadd vchkpw [root @ www vpopmail-4.9.4] # / usr / sbin / useradd -g vchkpw vpopmail If you want to save the hostage of the VPOPMAIL user in other directories, you will need to use the following command: [root @www vpopmail-4.9.4] # / usr / sbin / useradd -g vchkpw -d / path / to / where / you / want vpopmail 3, create ~ vpopmail / etc / tcp.smtp file if you have 192.168.0 A Class C address, you should include content in this file: 127.0.0.0.0.0.:Allow ,ylayclient= "10.1.1.:Allow ,ylayclient=": Allow If you have multiple C addresses, you need to The entry of the address corresponding to each C is included. 4, configure compilation vpopmail: [root @ www vpopmail-4.9.4] # ./configure [root @ www vpopmail-4.9.4] # Make [root @ www vpopmail-4.9.4] # make install-strip 5, support Roaming users want to support roaming users through the Mail Relay of the Mail Server, you need to use the following configuration options: [root @ www vpopmail-4.9.4] # ./configure --enable-roaming-users = y Set crontab , Run: [root @ www etc] # crontab -e Add: 40 * * * / home / vpopmail / bin / clearopensmtp 2> & 1> / dev / null support roaming users The principle is when a roaming user is used After the POP3 is shatbled, the address is allowed to pass the mail server from the forwarding letter in a break time.
6, add a virtual domain [root @ www /] # CD / home / vpopmail / bin [root @ www /] # ./vadddomain test.com or: [root @ www /] # ./vadddomain test.com password-for -postmaster This command will modify several QMAIL configuration files: / var / qmail / control / locals / var / qmail / control / rpthosts / var / qmail / control / morercpthosts (if rcpthosts> Than 50 lines) / var / QMail / Control / VirtualDomains / var / qmail / users / assign / var / qmail / users / CDB, the following directory or files are created: ~ vpopmail / domains / test.com ~ vpopmail / domains / test.com / postmaster / maildir ... ~ vpopmail / domains / test.com / vpasswd ~ vpopmail / domains / test.com / vPasswd.cdb then need to restart the QMAIL process to update the configuration: /etc/rc.d/init.d/qmailstartup Restart 6, Add new mail POP users [root @ www /] # CD / home / vpopmail / bin / [root @ www bin /]#./ vadduser.com OR Note [root @ www bin /]] ]#. Vadduser newuser@test.com
A CronJob program named ClearOpenSmtp can be used to implement the IP address from allowed to forward the mail address list after a period of time. This option requires the SMTP server using TCPServer with the -x /etc/tcp.smtp.cdb option. --enable-hardquota = # | n Set or open the disk limit, NOQUOTA is not limited to setting a disk limit without a mail account, default is 50m, here the number of numbers behind is byte, that is, to limit the disk limit is 10m Just use configuration parameters: --Nable-hardquota = 10000000. If the disk limit is exceeded, the new message of the user will be rejected, and a rejected information letter will be returned, and the information can be customized. --Enable-default-domain = Name Set the default domain name recommended to set all the domains to the virtual domain, and select one as the default domain. For users of the default domain, by receiving the mail, only need to set their mail username in the username, and for other non-default users, you need to set the username to
--Nable-SqlincDir = SQL header directory, default to / usr / local / mysql. --enable-sqllibdir = / usr / lib / mysql library file libmysqlclient.a directory, default / usr / lib / MySQL --Nable-Sqllibs = mysqlclient mysql library name, default is libmysqlclient.a. --enable-large-site = n | y default value is NO, using this option to adapt to a large number of users. The default VPopMail stores all domain information in the same Table-VPopmail, which is well efficiencies for normal circumstances. But for a large number of users, you need to set this option to Yes. At this time, VPoomail will create a table for each domain. The most important difference is that the domain name is not stored in the database because the table contains a domain name. For users greater than 500,000 , this saves a lot of disk space. But systems with a large number of virtual domains may affect the performance of MySQL. VPASSWD / CDB OPTIONS --ENABLE-UCSPI-DIR = DIR Compile The directory location of the UCSPI package uses this directory to set the path of the UCSPI-TCP package, default ../ucspi-tcp-0.84. Vpopmail requires the header file and two .a files in this directory. Logging Options --enable-logging = e | y | N Open (Y) or Off (N) Use syslog to perform log, or E only log error information. Set the LOG level, default only to record the POP authentication error message. --Nable-log-name = vpopmail Settings LOG name User / Group Options --enable-vpopuser = VPOPMAIL If you use other users to install the package, specify the group name in this option. --Enable-vpopgroup = vchkpw If you use other groups to install the package, specify the group name in this option. --Enable-admin-email = Email-Address system administrator's email address. Directory and file location options --enable-tcpserver-file = / etc / tcp.smtp TCPServer -X The mail forwarding the configuration file is used, default is the installation directory specified for / etc --enable-qmails, The default is / var / qmail. --enable-tcprules-prop = / usr / local / bin / tcprules TCPRules program installation location, default / usr / local / bin --enable-apop-file = / etc / apop-secrets apop key storage directory Other Options --Nable-APOP = Y | N allows or disables APOP authentication, the default is Yes --Nable-Passwd = Y | N allows or disables / etc / passwd (or shadow) authentication. Override automatic configuration, the default configuration program will automatically detect the system using the Passwd or Shadow password, and all / etc / passwd account authentication can be prohibited by setting this option to NO. 4, qmail and virtual domain qmail have the concept of "local" and "Virtual" for the mail field.
The Local domain is a matching / etc / passwd account; the virtual domain matches the various domains of the Russenger in the QMAIL control file "VirtualDomains". Vpopmail uses QMail's Users / Assign and VirtualDomains files. Users / assign file (the meaning of this file can be referred to the description of Qmail-Users 3.6 in Life with QMail) is compiled as a UserS / CDB. It is a hash database to speed up the search speed. If any model is matched, qmail uses the UID and GID defined in the file to transfer the directory defined in the file. Vpopmail uses this method to enable QMAIL to transmit all virtual domains in a single vpopmail / vchkpw, enabling emails to transfer messages to different users in the VPopMail / Domains /