Email is the most commonly used on the Internet, and many enterprise users often use free email systems. Today, I will introduce you to a mail server running in red hat linux 9.0.
Software Sendmail. Sendmail is a free email server.
Software, which has been widely used in various servers
It has certain characteristics in terms of stability, portability, and bug-free, and can find a lot of useful materials on the network.
1. 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 to check whether Sendmail is installed:
[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 directly Insert the Linux 1st installation CD, select the sendmail-8.12.8-4.i386.rpm installation under the/RedHat/RPMS directory
Package, and 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, sendmail-doc. 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
The configuration Syntax of sendmail. cf is relatively difficult. Generally, the M4 macro processing program is used to generate the required sendmail. cf file (it is difficult to compile the file using the M4 tool.
Errors can also prevent some macros with security vulnerabilities from damaging 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 in/etc/mail/sendmail. MC. Therefore, you can customize the sendmail. Mc template directly.
The purpose of the sendmail. cf file, instead of having to stick to the configuration commands that are hard to understand. 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.
4. Create a new email account
This step is relatively simple. You only need to add a user in Linux. Choose "Main Menu"> "system settings"> "users" and "group". Then, open the "Red Hat User Manager" dialog box and click "Add User, enter the user name and password in the "Create new user" window that appears.
Create a mail account. The command line is [root @ ahpeng root] # adduser maila-P pass, indicating that a maila account is created and the password is pass.
5. Limit the mailbox capacity of a single user
If the user's mail capacity is not limited, the server
Hard Disk is overwhelmed. This can be achieved through the "mail quota" function: Because the temporary storage space for email is located in the/var/spool/mail directory, therefore, you only need to set the maximum space that each email account can use in this directory through the disk quota.
6. set multiple email addresses for a single user
The alias (alias) can be used to solve this problem. Aliases are one of the most important functions of Sendmail. It defines the location of the aliases file in the aliases text file.
Specified by sendmail. cf, usually in the/etc directory. For example, the preceding maila user must have two email addresses.
Address: mailA@yourdomain.com and mailB@yourdomain.com, can be set like this:
First, add an account
In the Linux text editor, open/etc/aliases and add dearpeter: mailc and truepeter:
Mailc, and then run the newaliases command in the Command window to require Sendmail to re-read the/etc/aliases file. If it is correct
A response message is displayed, indicating that the configuration is successful. In this way, two addresses can be used to send emails to mailc, while mailc can receive all emails sent to the preceding two addresses with only one account.
After the preceding steps, you can use Outlook Express to send emails normally. However, you cannot use Outlook Express to send emails from the server.
Because Sendmail does not have POP3 by default, We have to install and enable it ourselves.
1. POP3 (IMAP) Server
Install.
Step 1: run the following command to check whether the system is installed:
[Root @ ahpeng root] # rpm-Qa IMAP
Imap-2001a-18
Step 2: insert 2nd installation discs and use the following command line to start installation:
[Root @ ahpeng root] # cd/mnt/CDROM/RedHat/RPMS
[Root @ ahpeng root] # rpm-IVH imap-2001a-18.i386.rpm
2. Enable the POP3 (IMAP) service.
POP3 Service: Modify/etc/xinetd first. in the D/ipop3 file, change disable = yes to disable = No and save it. Then restart the xinetd program to read the modified configuration file and make it take effect.
Command Line: [root @ ahpeng root] #/etc/rc. d/init. d/xinetd reload
The procedure for starting the IMAP service is the same as that for POP3, except that the IMAP configuration file is/etc/xinetd. d/IMAP.