Set up a Mail server using Sendmail in Linux

Source: Internet
Author: User
Article Title: use Sendmail to set up a Mail server in Linux. 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.

Email is the most commonly used on the Internet, and many enterprise users often use free email systems. Today, I will introduce you to Sendmail, a mail server software running in Red Hat Linux 9.0. as a free mail server software, Sendmail has been widely used in a variety of servers. It has certain characteristics in terms of stability, portability, and bug-free, you can also search for a large amount of useful materials on the Internet.

 I. Install Sendmail

When Red Hat Linux 9.0 is fully installed, Sendmail is automatically built in with the version 8.12.8-4. If you are not sure whether sendmail is installed in Linux, run the following command:

[Root @ ahpeng root] rpm? Qa grep sendmail

If you are sure that the application is not installed, choose "Main Menu"> "system settings"> "add or delete application" in the graphic interface ", select the mail server option in the open "software package management" window, click "Update", and follow the prompts to install it.

Another way is to insert the Linux 1st installation CD directly, select the sendmail-8.12.8-4.i386.rpm installation package under the/RedHat/RPMS directory, then run [root @ ahpeng RPMS] # rpm-ivh sendmail-8.12.8-4.i386.rpm to start installation, and then use this method to install sendmail-cf.8.12.8-4.i386.rpm and sendmail-doc in the same directory of the 3rd installation discs. 8.12.8-4. i386.rpm.

  II. Start the Sendmail service system

I suggest using the Sendmail command with parameters to control the running of the mail server:

[Root @ ahpeng root] # sendmail-bd? Q12h

-B: Set the Sendmail service to run on the background.

-D: Specify Sendmail to run in Daemon mode.

-Q: When Sendmail fails to send emails, the emails are saved in the queue and the storage time is specified. The above 12 hours indicates that the data is retained for 12 hours.

To check whether the Sendmail server is running properly, run the following command:

[Root @ ahpeng root] #/etc/rc. d/init. d/sendmail status

 3. Configure Sendmail

Sendmail. the configuration Syntax of cf is relatively difficult. Generally, m4 macro processing programs are used to generate the required sendmail. cf files (using m4 compilation tools is generally not prone to errors, and some macros with security vulnerabilities can be prevented from causing damage to the server ). The configuration file is located in/etc/mail/sendmail. cf. a template file is also required during the creation process. Linux has a template file, which is located in/etc/mail/sendmail. mc. therefore, you can directly modify sendmail. mc template to customize sendmail. the purpose of the cf file, instead of having to stick to the difficult-to-understand configuration commands. The configuration steps are as follows:

Step 1: use the template file sendmail. mc generates sendmail. cf configuration file, export it to the/etc/mail/directory, and use the command line m4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf

Step 2: restart sendmail with the [root @ ahpeng root]/etc/rc. d/init. d/sendmail restart command line.

At this point, the mail service system has been configured and is working properly. The next step is to create a specific account.

[1] [2] Next page

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.