Set up a high-capacity POP3 POP3 server

Source: Internet
Author: User
Set up a high-capacity POP3 POP3 server-Linux Enterprise Application-Linux server application information. The following is a detailed description. I. Overview
This article describes how to use the open source software Procmail and Qpopper to configure a POP3 server that can be used by a large number of users, focusing on how to maintain the best server performance.
Step 2:
The software environment is RedHat Linux 7.1.
1. download the latest versions of Procmail and Qpopper.
The latest version of Procmail is now 3.21 available from
Http://www.procmail.org/procmail-3.21.tar.gzdownload.
The latest version of Qpopper is 4.0 available now
Http://www.eudora.com/qpopper_general/download
2. compile Qpopper
Assume that the downloaded file is stored in/root.
# Cd/root
# Tar xvfz qpopper4.0.3.tar.gz
# Cd qpopper4.0.3
#./Configure -- enable-hash-spool = 2
-- Enable-log-login
-- Enable-server-mode
-- Enable-fast-update
-- Enable-shy
-- Enable-spool-dir =/usr/mail
-- Enable-specialauth
Note:
-- Enable-specialauth: Use the/etc/shadow password for authentication.
-- Enable-hash-spool = 2 use the second-level hash structure
-- Enable-spool-dir =/usr/mail: the user's mailbox file is/usr/mail/j/e/jephe
-- Enable-log-login records the successful POP3 logon to syslog
-- Enable-server-mode and -- enable-fast-update
Do not allow qpopper to copy the mailbox file to a temporary file when the user accesses the mailbox
Reduces disk I/O and improves performance
-- Enable-shy does not display version information when the server responds, enhancing security.
# Make
# Make install
Edit the/etc/inetd. conf file
Create a file pop3 under/etc/xinetd. d, which contains the following content:
Service pop3
{
Socket_type = stream
Protocol = tcp
Wait = no
User = root
Server =/usr/local/lib/popper
Server_args = qpopper-F-S-s-c-R-T120
Port = 110
}
Note:
-F enable fast update
-S enable server mode (when the user does not have shell access to the server)
-S: Enable the LOG function
-C ignore the case sensitivity of the user name
-R does not perform Reverse Domain Name check on connected IP addresses
-T: Set the timeout time.
After this setting, if the user jephe receives a letter, it first locks the mailbox file/usr/mail/j/e/jephe to create the lock file. jephe. pop: Check the number of mails, return to update status, and generate. jephe. cache file.
Otherwise, in normal mode, copy/usr/mail/j/e/jephe to. jephe. pop, and then copy it back after checking the mailbox, increasing the I/O processing time.
If it is not redhat 7.1, then in/etc/inetd. in conf, comment the rows starting with pop-3 and add the following rows later: pop-3 stream tcp nowait.400 root/usr/local/sbin/popper-F-S-s-c-R-T120
Nowait: 400 in 400 indicates the maximum number of connection requests per minute.
If you set ALL: ALL in/etc/hosts. deny, enter
Popper: ALL
3. Compile Procmail
Assume that the downloaded file is stored in/root.
# Cd/root
# Tar xvfz procmail-3.21.tar.gz
# Cd procmail-3.21
# Vi src/authenticate. c
Change #/var/spool/mail after the define MAILSPOOLDIR line to "/usr/mail/" (here I use
/Usr/mail)
Change # define MAILSPOOLHASH to 2 (the second-level hash directory is used to improve the Server File System Performance, especially when there are a large number of users)
Note: In this case, if the user's mailbox is a jephe@domain.com, the file should exist
/Usr/mail/j/e/jephe
# Mv/var/spool/mail. bak
Note: replace this directory first, because the Directory and hash hierarchy are preferred if this directory can be found during compilation, in this way, the user mail will be stored in the file/var/spool/mail/j/e/jephe. if you want to use this directory, you do not need to change the MAILSPOOLDIR line above.
# Make
# Make install
# Make install-suid
Run # procmail-v as the root user to check whether the user's email path is/usr/mail/r/o/root.
4. Create a POP3 User
You do not need to allocate the home directory to the mail User or set the home directory to/usr/mail/j/e (assuming the user is jephe). Use the following command to create a user.
# Useradd jephe-c "Jephe Wu"-g mail-d/dev/null-s/bin/false
Then you can write a batch of commands and use chpasswd to give each user the same password.
A. First, use passwd to set the password for mailuser1. Assume it is "abc123" and check the password in/etc/shadow.
Code, "abc123" on my machine"
$1 $ G22Plicn $ r5.bSe0U7DbaHN7tCevTR/
B. Create a new file/tmp/password. Each line contains a username: password, which can be obtained from/etc/passwd using the following command:
Cat/etc/passwd | awk-F: '{print $1}' | sed-e
'S/$/: $1 $ G22Plicn $ r5.bSe0U7DbaHN7tCevTR \ // G'
C. Run chpasswd </tmp/password
5. FAQ
A. After compiling qpopper, you still need to use the-F-S parameter on the command line to start the server mode and fast update. Put-F in front of-S.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.