The configuration of the mail server under Linux

Source: Internet
Author: User
Tags command line mail mail account linux

A Install SendMail.

When the red Hat Linux 9.0 is fully installed, the SendMail is built automatically and the version number is 8.12.8-4. If you are not sure if Linux has SendMail installed, you can enter the following command to view:

[Root@ahpeng Root] rpm–qa grep sendmail

If you are sure it is not installed, select Click Main Menu-System settings-Add remove application in the graphical interface, then select the Mail Server option in the Open Package Management window, click "Update" and follow the prompts to install.

Alternatively, insert the Linux 1th installation CD directly, select the SENDMAIL-8.12.8-4.I386.RPM installation package under the/redhat/rpms directory, and then run [Root@ahpeng RPMS] # RPM-IVH SENDMAIL-8.12.8-4.I386.RPM can begin the installation, and then use this method to install sendmail-cf.8.12.8-4.i386.rpm, Sendmail-doc. 8.12.8-4 in the same directory as the 3rd installation CD. i386.rpm.

Two Start the SendMail service system.

The author recommends using the SendMail command with parameters to control the operation of the mail server: [Root@ahpeng root]#

SENDMAIL-BD–Q12H, followed by the parameters explained as follows:

-B: Set the SendMail service to run in the background.

-D: Specifies that SendMail is run in daemon (daemon) mode.

-Q: Set the message to be saved in the queue when SendMail cannot successfully send the message, and specify the save time. The 12h above indicates a 12-hour retention.

In addition, to detect whether the SendMail server is functioning properly, you can use the command line: [Root@ahpeng Root] #/etc/rc.d/init.d/sendmail status.

Three Configure SendMail.

SENDMAIL.CF configuration syntax is more difficult to understand, the general information is the use of M4 macro-processing program to generate the required SENDMAIL.CF files (using the M4 compilation tool is generally not error-prone, but also to avoid some security vulnerabilities of the macro damage to the server). Its configuration file is located in/etc/mail/sendmail.cf, and a template file is required during the creation process, and Linux comes with a template file located in/ETC/MAIL/SENDMAIL.MC. It is possible to modify the SENDMAIL.MC template directly to achieve the purpose of customizing the sendmail.cf file, without having to bite the hard to understand the configuration commands. The configuration steps are:

Step One: Use template file SENDMAIL.MC to generate SENDMAIL.CF configuration file and export to/etc/mail/directory, using command behavior: M4/ETC/MAIL/SENDMAIL.MC >/etc/mail/ Sendmail.cf

Step Two: Restart SendMail with the [Root@ahpeng Root]/etc/rc.d/init.d/sendmail restart command line.

At this point, the mail Service system configuration is complete and is working properly. The next step is to create a specific account.

Four Create a new e-mail account.

This step is relatively simple, just add a user to Linux. Go to the main menu-system settings-with

User and group options, then open the Red Hat User Manager dialog box, click the Add User button, and then enter the username and password in the next "Create New user" window, as shown in the figure:

Create Mail Usage account

The command line is: [Root@ahpeng Root] #adduser maila-p Pass, which means that a Maila account has been created, and the password is a.

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.