UWIMAP server performance optimization-Linux Enterprise Application-Linux server application information. The following is a detailed description. Overview:
Uw imap is an open source POP/IMAP server developed by the University of Washington. It is a widely used POP/IMAP server, popular linux releases such as Mandrake and RedHat all contain uw imap servers. However, in the process of use, we often encounter some problems in one way or another. This article will discuss some problems encountered when using the uw imap server and provide corresponding solutions, to optimize the uw imap server performance.
Environment:
The test environment we use is RedHat7.1 and the following software packages are required:
The imap-2000-9.rpm can be found from the installation disc of RedHat7.1.
Imap.tar. Z can be downloaded from ftp.cac.washington.edu/imap/imap.tar.z.
Ideas:
First we install the imap-2000-9.rpm package, which contains the authentication mechanism of imapd and ipop3 in PAM, and then we will re-compile imapd and ipop3 to replace imapd and ipop3 In the rpm package, this avoids re-writing PAM Authentication rules.
Note:
Uw imap does not have a configuration file, so we can only adjust the performance by modifying the source program and using other auxiliary measures (such as optimizing xinetd. However, this does not mean that you need to be familiar with c Programming in linux.
Steps:
1. Obtain the imap source code package
You can:
# Tar xvzf imap.tar. Z
The imap-2001.BETA.SNAP-0107221451 directory is generated, and then enter the directory:
# Cd imap-2001.BETA.SNAP-0107221451
Ii. modify source program
You can modify the source program to solve the following problems:
1. there is a long delay in the error message during authentication errors
To prevent someone with ulterior motives from guessing the password, there is a delay of some time after authentication error. To cancel the delay, you can go to the usr/osdep/unix directory in the unlocked source code directory, edit the env_unix.c file, find the sleep keyword, and comment out the sleep (3) line. Because the system uses this function to achieve latency.
2. Reduce logon timeout
If you do not enter the user name and password for a certain period of time during user logon, the system considers the session to have timed out and terminates the session. The default timeout time is 3 minutes, you can improve system performance by reducing the logon session timeout.
You can go to the src/imapd directory in the Undo source code directory, edit the imapd. c file, and find a line containing the following information:
# Define LOGINTIMEOUT 3 MINUTES
Change 3 to 1, that is, the logon timeout time is 1 minute.
3. Cancel reverse DNS resolution
Sometimes, the system performs reverse DNS resolution on the client, which greatly reduces system efficiency. You can go to the unlocked source code directory, edit the Makefile file, find a line containing EXTRACFLAGS, and change it:
EXTRACFLAGS =-DDISABLE_REVERSE_DNS_LOOKUP
This cancels reverse DNS resolution for the client.
4. If you want to change the file name of the email and the default directory, you can refer to the docs directory in the unlocked source code directory and the description of the CONFIG file. This is not required unless otherwise specified.
Iii. Compilation
When using the shadow password for user authentication, you can use the make slx command for compilation.
To support PAM, use make lnp for compilation.
4. Replace the source file
After the compilation is successful, use the new imapd and ipop3 to replace the existing imapd and ipop3:
# Cp ipopd/ipop3d/usr/sbin/
# Cp imapd/usr/sbin/
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