How to separate the mail users of the Sendmail mail server from those of the system

Source: Internet
Author: User
Article Title: how to separate the mail users on the Sendmail server from the system users. 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.
Sendmail is one of the most widely used SMTP servers on the Internet. However, Sendmail cannot be used independently, it also needs to be combined with the mail application of the UNIX/LINUX operating system. In addition, each added email user actually adds a system user. In this way, it is not only inconvenient to use, but also greatly increases system overhead and affects server performance when there are many users. At the same time, because mail users may come from all directions on the internet, the system user's password is sent online, which also increases the risk of the system. Here we will introduce a method for separating Email users from system users for your reference.
  
1. System Environment
  
Taking the Linux operating system (Redhat 5.2) as an Example
  
Ii. Install the mh Software Package
  
1. Download
  
The mh-6.8.4-2.tar.gz software package can be downloaded in the China free software library (http://freesoft.cei.gov.cn site.
  
2. Compile
  
After the mh package has been downloaded, You can compile it as follows:
  
$ Tar-zxvf mh-6_8_4-2_tar.gz
$ Mh-6.8.4 cd
$ Cd conf
$ Vi MH # adjust or add the following parameters (use the default values for other parameters ):
Bin/usr/local/bin # installation directory for Command Execution
Etc/usr/local/etc/mh # installation directory of the system calling program
Mandir/usr/local/man # installation directory of the Help File
Ccoptions # Remove "-traditional", the rest remain unchanged
Ldoptlibs-lcrypt
Mts sendmail/smtp # use sendmail to deliver mail
Pop on # support for POP service
Popdir/usr/local/lib/mh # installation directory of popd
Options POPSERVICE = '"pop-3 "'
# Pop-3 should be consistent with the service name defined in the/etc/services file 110/tcp port
Options POSIX
Options BSD42
Options BSD43
  
(For the meanings and usage of each parameter, refer to the conf/READ-ME file)
  
$ Vi./config/mtstailor # determine the executable file of sendmail corresponding to the sendmail parameter, for example:
Sendmail:/usr/sbin/sendmail
$ Vi./config/mtstailor # determine the executable file of sendmail corresponding to the sendmail parameter,
For example, sendmail:/usr/sbin/sendmail
$ Make
$./Mhconfig MH
$ Cd ../
$ Make
  
3. Install
  
$ Su
# Mkdir-p/usr/local/bin/usr/local/lib/mh
/Usr/local/etc/mh/usr/local/man # create a word installation directory
# Make inst-all # full installation
  
3. Install the sendmail Software Package
  
1. Download
  
The sendmail.8.11.0.tar.gz software package can be downloaded in the China free software library (http://freesoft.cei.gov.cn site.
  
2. Compile
  
After the sendmail package has been downloaded, You can compile it as follows:
  
$ Tar-zxvf sendmail.8.11.0.tar.gz
$ Sendmail-8.11.0 cd
$ Cd sendmail
$./Build # compile sendmail
  
3. Install
  
$./Build install
  
4. Configuration
  
$ Cd..././cf/ostype
$ Vi linux. m4 # add a line:
Define ('pop _ MAILER_PATH ','/usr/local/etc/mh/spop ')
...
$ Cd ../cf/
$ Vi generic-linux.mc # add a line:
MAILER (pop) dnl
$ M4 ../m4/cf. m4./genric-linux.mc> sendmail. cf
$ Su
# Cp./sendmail. cf/etc/mail
# Chmod g-w/etc/mail/sendmail. cf
# Cp/etc/sendmail. cw/etc/mail/local-host-names # domain name for storing the server,
  
Iv. debugging
  
Assume that the mail server domain name is: test.com, now you want to open a new mailbox: test@test.com, and test:
  
#/Usr/sbin/useradd-d/home/pop-m pop # generate pop users
# Passwd-l pop # lock a pop user
# Chmod 755/home/pop
Note:/home/pop is the working directory of the pop system user. This directory will be used to store the Mail User Database and all emails of the user.
  
# Su-pop
$ Echo "test: test. box: test@test.com:"> POP
# POP is the database file of the mailbox and stores all the mailbox information. This operation adds a user test whose email address is: test@test.com. Test. box is the name of the user's email address.
  
$/Usr/local/etc/mh/popwrd test # set a password for the test Mail User
New password:
Retype new password:
$ Exit
#/Usr/local/etc/mh/popaka>/etc/mail/aliases
# Chmod g-w/etc/mail/aliases
# Newaliases
#/Usr/lib/sendmail-bd-q30m # Start the sendmail service process
#/Usr/local/lib/mh/popd # Start the pop service process
The following tools such as Microsoft Outlookup Express can be used to send and receive mail test test@test.com mailbox, the above to make the mail users and operating system users to separate the method of a simple introduction, there are still many technical details about this combination method. You can refer to the relevant documentation of the software package for parameter optimization.
  

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.