Article Title: RHEL4 system Sendmail mail server setup. 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.
This time we will learn about the Sendmail server configuration in Linux. (The email server's IP192.168.1.2 host domain name is mail.ltest.com)
Premise: First we install the DNS server OK can resolve, do not understand to see linux.chinaitlab.com/server/725027.html "> http://linux.chinaitlab.com/server/725027.html
1. install the software required for Sendmail.
[Root @ localhost ~] # Rpm-q sendmail m4
Sendmail-8.13.1-2
M4-1.4.1-16 has been installed by default, also need to mount 4th CDs, install software related to sendmail
[Root @ localhost RPMS] # rpm-ivh sendmail -*
Warning: sendmail-cf-8.13.1-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing ...... ######################################## ### [100%]
1: sendmail-doc ##################################### ###### [33%]
2: sendmail-cf ##################################### ###### [67%]
3: sendmail-devel ##################################### ###### [100%]
2. Modify the/etc/mail/local-hosts-name file..
Add the FQDN of the local host and the local host. Remember to add only the FQDN of the local host and the domain name FQDN. Do not add other domains. Otherwise, the user unknown error will occur when sending emails to the external domain:
[Root @ localhost named] # cat/etc/mail/local-host-names
# Local-host-names-include all aliases for your machine here.
Ltest.com
3. Change the/etc/mail/sendmail. mc file and modify the following:
DaemonPortsOptions = Port = smtp, Addr = 127.0.0.1, Name = MTA changed:
DaemonPortsOptions = Port = smtp, Addr = yourip or 0.0.0.0, Name = MTA
Then m4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf
4. User Management
Authentication configuration: Modify the fields in/etc/mail/sendmail. mc and cancel the comments at "TRUST_AUTH_MECH" and "define" in the next line. (In the 48th and 49 of the sendmail. mc files) Then m4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf.
[Root @ localhost named] # chkconfig -- list saslauthd enable authentication
Saslauthd 0: off 1: off 2: off 3: off 4: off 5: off 6: off
[Root @ localhost named] # chkconfig -- level 35 saslauthd on
Create a user account
[Root @ localhost named] # groupadd mailuser
[Root @ localhost named] # adduser-g mailuser-s/sbin/nologin mike
[Root @ localhost named] # adduser-g mailuser-s/sbin/nologin john
[Root @ localhost named] # passwd mike
[Root @ localhost named] # passwd john password is 123
Set email alias and mass mailing
Modify the/etc/aliases file to implement Mail forwarding and Mail List:
Admin: mike sets the alias admin for the email user mike.
Testgroup: mike, john. Send the emails sent to testgroup by group to both mike and john.
# Newaliases
5. Access control settings
Change the/etc/mail/accesss file and add:
[Root @ localhost named] # cat/etc/mail/access
# Check the/usr/share/doc/sendmail/README. cf file for a description
# Of the format of this file. (search for access_db in that file)
# The/usr/share/doc/sendmail/README. cf is part of the sendmail-doc
# Package.
#
# By default we allow relaying from localhost ......
Localhost. localdomain RELAY
Localhost RELAY
127.0.0.1 RELAY
Ltest.com RELAY
Then, makemap hash/etc/mail/access. db </etc/mail/access updates the database.
[1] [2] Next page