POP3 (Post Office Protocol 3) or Post Office Protocol version 3, which states how a personal computer connected to the Internet e-mail server and download an electronic agreement.It is the first Internet e-mail off-line protocol standards, POP3 allows users to store the mail from the server to the local host, also delete stored messages on the mail server, and POP3 servers is to follow the incoming mail server POP3 protocol,to receive e-mail.This article describes how to use open source software Procmail and Qpopper, the Linux system configuration for a large number of users to use POP3 server.
1, download Procmail and Qpopper
Procmail can be downloaded from the http://www.procmail.org/procmail-3.21.tar.gz.
Qpopper can be downloaded from the http://www.eudora.com/qpopper_general/.
2, compiled Qpopper
Assuming the downloaded files in the / 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
Notes:
- Enable-specialauth use / etc / shadow password authentication
- Enable-hash-spool = 2 using the secondary hash structure
- Enable-spool-dir = / usr / mail, the user mailbox file is / usr / mail / j / e / jephe
- Enable-log-login record of success POP3 log syslog
- Enable-server-mode and - enable-fast-update
Do not let the user access to mailbox qpopper mail files copied to a temporary file, reducing disk I / O, enhanced performance.
- Enable-shy Do not let the server response displays version information, and enhance security.
# Make
# Make install
Edit the file / etc / inetd.conf
In / etc / xinetd.d to create the file pop3, including the following:
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
}
Notes:
-F enable fast update
-S enable server mode (the user shell access to the server does not have the time to do)
Open the LOG function-s
-C Ignore the case of user names
Connect-R does not come in the IP address for reverse domain name check
-T set the timeout
After this setup, if the user jephe collect mail, then the first lock-mail the file / usr / mail / j / e / jephe create a lock file. Jephe.pop, check the number of letters, back when the update status to generate. Jephe.cachefile.
Otherwise, normal mode is to first / usr / mail / j / e / jephe copy into. Jephe.pop, end-user check box and then copy back end, an increase of I / O processing time
If it is not redhat in the / etc / inetd.conf in the comments to pop-3 at the beginning of the line, and then later add the following line: pop-3 stream tcp nowait.400 root / usr / local / sbin / popper-F -S-s-c-R-T120
nowait: 400 of 400 per minute is an acceptable number of connection requests
If you are in / etc / hosts.deny set the ALL: ALL, will have in / etc / hosts.allow enter
popper: ALL
3, compiler Procmail
Assuming the downloaded files in the / root
# Cd / root
# Tar xvfz procmail-3.21.tar.gz
# Cd procmail-3.21
# Vi src / authenticate.c
Change the line # define MAILSPOOLDIR behind the / var / spool / mail as "/ usr / mail /" (used here is / usr / mail)
Behind the change # define MAILSPOOLHASH 0 to 2 (with two hash directory, improve server file system performance, especially when there is a large number of users)
Note: In this case, if the user's mailbox is jephe@domain.com, the file should exist
/ Usr / mail / j / e / jephe
# Mv / var / spool / mail / var / spool / mail.bak
Note: The first renaming the directory, because it is possible when the compile-time if you can find a directory, you first use the directory and the hash hierarchy, so to store user messages to the file / var / spool / mail / j / e / jephe.If you want to use this directory do not need to change the above MAILSPOOLDIR line.
# Make
# Make install
# Make install-suid
Then run as root # procmail-v check the user's e-mail path is recognized as / usr / mail / r / o / root.
4, create a POP3 user
You do not need to assign users home directory for the mail, do not need to set the home directory is / usr / mail / j / e (assuming the user is jephe), with the following command to create users.
# Useradd jephe-c "Jephe Wu"-g mail-d / dev / null-s / bin / false
Then you can write a batch command to each user with chpasswd the same password.
1) First, set the password with passwd as mailuser1, assumed to be "abc123", check / etc / shadow in the password.
2) Create a new file / tmp / password, each line includes a user name, password, available from the / etc / passwd with the following command to obtain.
cat / etc / passwd awk-F: '{print $ 1}' sed-e
'S /$/:$$ 1 $ G22Plicn $ r5.bSe0U7DbaHN7tCevTR / / g'
c. then run chpasswd p
5, FAQ
After compiling qpopper still need to use the command line-F-S parameter to start the server mode and quick updates, put-F-S in the front.