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-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-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.
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.