Database management of QMAIL mail accounts through VPOPMAIL

zhaozj2021-02-11  277

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 In this case, the user's mail domain needs to be specified Test.com, which is added to ~ VPOPMAIL / DOMAINS / TEST.COM. 7, delete the mail POP user [root @ www bin /] # / home / vpopmail / bin / vdeluser newuser@test.com 8, modify a POP user password: [root @ www /] # / home / vpopmail / BIN / VPASSWD newuser@test.com 9, when using Vchkpw and QMAIL-POP3D When using VPOPMail, you need to modify the POP's run script RUN to: #! / bin / sh exec / usr / local / bin / tcpserver -v - H -R 0 POP-3 -U vpopmail -g vchkpw / var / qmail / bin / qmail-popup domain1.com / home / vpopmail / bin / vchkpw / var / qmail / bin / qmail-pop3d maildir 2> & 1 | / VAR / QMAIL / BIN / SPLOGGER POP3D Note: From Exec to "|" all the contents of the same line. 3, VPOPMAIL Details Options --Nable-Roaming-Users = N | Y When the POP3 authentication is passed, whether it opens mail forwarding to the user, the default is off. If the method is set to YES, then a user passes the POP3 authentication, the IP address is added to the list of mail Relay through the mail server.

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 % The format can be charged by POP3. --Nable-ip-alias-domains = Y | N allows virtual domains to be viewed by reverse parsing. By default, each domain uses a virtual domain name, that is, the user must provide corresponding in the POP username. Domain information, that is, % . Of course, you can override this request with the Enable-Default-Domain configuration option. Vpopmail also supports the IP address-based virtual domain. If the option is open, the user does not need to provide% in the POP username, and the VPopMAI automatically reverse parses the IP address of the server connected to the server. If parsing gets a domain name , VPopMail uses this name as a domain, for example: IP wxyz corresponds to the domain name Test.com, the user sets the IP address of the POP server to wxyz, then connect the POP server, VPOPMAIL1 get the connection request, and check the IP of the connected server side, then Reverse DNS queries, get the domain name of Test.com, users use Joe as POP username, vpopmail uses Test.com. --Enable-relay-clear-minutes = 360 allows roaming users to forward mail through the mail server. If --Nable-Roamin-users = y, the option sets ClearOpenSMTP should keep the IP in the allowable list, the default is 3 hours. MySQL Options --Nable-MySQL = N | Y uses mysql, the default is NO. Allows the user to be authenticated by storing the account in the MySQL database.意: You need to modify the file vmysql.h before configuring and compile, and the correct settings of the MySQL server's Name / IP, MySQL users, and MySQL user passwords are set. This user must have access to creating a database and creation form.

--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 / directory. For QMail, the QMail-Local program is a standard .Qmail file operation once you get relevant information from users / assign. In general, .qmail- file is used to complete mail forwarding, alias, or call other programs such as EZMLM. If you do not find a match, qmail-local file is found. Qmail-default file, which is the last step in the QMail-Local mail delivery mechanism. Vpopmail uses this file to activate the VDELIVERMAIL program, which is called by two parameters, the first current no effect, mainly used as backward compatibility; the second parameter is used to find it in a virtual domain user The default delivery, in general, the default delivery can be delivered to a directory or an email address or returns the return letter without this user. 5, the author installation process author is to further implement the account in the mysql database based on the installation of the real user QMAIL system. The roaming user is supported here. The user disk limit is 10m. The system has multiple domains: domain1.com and domain2.com, and these two domains are completely equally, once the user has a system mailbox, will have usr1 @ Domain1.com and usr2@domain2.com two addresses. The author's MySQL server has been installed successfully according to the default configuration, and it is operating normally. And put all mail accounts into the virtual domain, not allowing authentication through / etc / passwd. Step 1: Modify file /usr/src/vpopmail-4.9.4/vmysql.h, modify / * edit to match your set up * / #define mysql_server "localhost" #define mysql_user "root" #define mysql_passwd "passwoerd" / * End of setup section * / Mysql server's address, if your MySQL server is stored on another machine, modify localhost to your MySQL server IP address; if you want to use other to read and write and create a database Users of libraries and tables to access the database, saving the root for your desired username; modify passwoerd to your MySQL database corresponding to access passwords.

转载请注明原文地址:https://www.9cbs.com/read-3494.html

New Post(0)