Sendmail configuration with SMTP authentication

Source: Internet
Author: User
Tags microsoft outlook
Article Title: sendmail configuration with SMTP authentication. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Environment: Redhat linux 6.0 (Kernel 2.2.14)
Sendmail-8.10.2
Cyrus-sasl-1.5.21
Microsoft Outlook express 5.0
  
   I. Preparations
1. First download the sasl library, which provides the functions required for security authentication.
(Ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/), version 1.5.21.
  
2. Download sendmail (http://www.sendmail.org). Only sendmail versions later than 8.10.0 support SMTP authentication.
3. Select the client email software. Not all client email software supports SMTP authentication.
  
The version requirements are as follows:
The version of Netscape Messenger must be later than 4.6.
Outlook and Outlook Express must be version 5.0 or later.
Eudora pro must be later than 4.3
Foxmail currently does not support this function.
The authentication method for each software is different. The method for compiling the sasl library is slightly different from that for configuring sendmail.
The most common
The following describes how to set Outlook Express 5.0.
  
   Ii. Install the sasl Library
1.decompress cyrus-sasl-1.5.21.tar.gz to the directory you selected
2. cd cyrus-sasl-1.5.21
3./configure -- enable-login -- with-pwcheck
Outlook Expresss uses the LOGIN authentication method. This method is not supported by sasl library by default. Therefore, you must add this method when generating the configuration file. In addition, the password authentication method of Outlook is not the default method, therefore, you also need to add the -- with-pwcheck option.
You can compile and install the sasl library.
Make
Make install
4. by default, all library functions are installed in the/usr/local/lib directory, but the library functions used by sendmail are in the/usr/lib directory, so we need to make some adjustments.
Cd/usr/lib
Ln/usr/local/lib/sasl/./sasl-s
Cp/usr/local/lib/libsa *.
You can also avoid this step. Before running the configure script in step 1, modify the default path.
Open the configure file and find this line ac_default_prefix =/usr/local (the first few lines of the file ).
  
Ac_default_prefix =/usr, which is more convenient.
5. Create a directory/var/pwcheck for use by the pwcheck command. This command is a background program that checks the user's input password,
Use the shadow password file as the root permission.
6. Create the file Sendmail. conf in the/usr/lib/sasl directory and add the following line.
Pwcheck_method: pwcheck
This completes the installation of sasl library functions.
  
   3. Compile and configure sendmail
1. Unzip the sendmail software to your desired directory and go to the sendmail-8.10.2 directory.
Create the config. Site. m4 file in the devtools/site/directory, add the following two lines of text, and compile the SMTP authentication function into sendmail.
APPENDDEF ('confenvdef ','-DSASL ')
APPENDDEF ('conf _ sendmail_LIBS ','-lsasl ')
2. Go back to the sendmail-8.10.2 directory, and then enter the sendmail directory to start compiling sendmail.
./Build-c (if it is not the first compilation, you need to add the-c option to clear the previous configuration) after the compilation is successful, run./Build install to install the software.
3. Next, rewrite the configuration file of Sendmail. Go back to the upper-level directory, go to the cf/cf directory, and find the appropriate. mc file (specific practices
See other articles, which are not covered in this article ). Add the following lines as required:
  
Trust_auth_mtech ('login PLAIN DIGEST-MD5 ')
Define ('confauth _ MECHANISMS ', 'login PLAIN DIGEST-MD5 ')
Dnl define ('confdef _ AUTH_INFO ','/etc/mail/auth-info ')
FEATURE ('no _ default_msa ')
DAEMON_OPTIONS ('port = 25, Name = MSA, M = Ea ')
Note: The Role of "TRUST_AUTH_MECH" is to enable sendmail regardless of how it is set in the access file.
Relay messages that are verified by LOGIN, PLAIN, or DIGEST-MD5.
"Confauth_mechanic isms" is used to determine the authentication method of the system.
"ConfDEF_AUTH_INFO" is used to authenticate the client to another host with smtp authentication function. The user and password are stored in the auth-info file, this function is not required in this example, so it is commented out.
4. Compile/etc/mail/sendmail. cf file
M4 xxxx. mc>/etc/mail/sendmail. cf, but remember to back up the old sendmail. cf file, otherwise it may be troublesome.
5. Now it's okay. Start sendmail and let's test it.
Sendmail-bd-q20m
  
Run the following command
Telnet localhost 25
Ehlo localhost
Note that the following information appears.
250-xxxxxxxx
250-xxxxxxx
250-AUTH login plain DIGEST-MD5
250-xxxxxx
  
It may be slightly different, but you must select the authentication method. If no problem is found, congratulations! You have successfully configured the server. If the preceding information does not appear, run
  
Sendmail-O loglevel = 14-bs
  
Check the problem carefully.
Before we end the configuration on the server, we need to run the daemon program pwcheck to complete the user authentication function.
Pwcheck &
  
   Iv. configuration of Outlook Express 5.0
1. Open your Outlook Express, modify your account attributes, select my smtp server authentication option on the server, and enter the configuration.
2. Do not select secure password authentication. sendmail does not support this option. Whether to use the same pop3 PASSWORD or enter another user and password depends on your hobbies and settings. This is not the key. If you have a real account on the server, use the same password. If you do not have an account, use another user password.
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.