First Release: www. chuiniudi. the configuration file to be modified for the basic configuration of cnarchives66: etcmailsendmail. mcetcmaillocal-host-namesetcmailaccess open sendmail. mc, search for "127.0.0.1" and find the following code: DAEMON_OPTIONS ('portsmtp, Addr127.0.0.1, NameMTA'
Starting: http://www.chuiniudi.cn/archives/66 basic configuration need to modify the configuration file:/etc/mail/sendmail. mc/etc/mail/local-host-names/etc/mail/access open sendmail. mc, search for "127.0.0.1" and find the following code: DAEMON_OPTIONS ('port = smtp, Addr = 127.0.0.1, Name = MTA'
Initial: http://www.chuiniudi.cn/archives/66
BasicConfigurationTo be modifiedConfigurationFile:
/Etc/mail/sendmail. mc
/Etc/mail/local-host-names
/Etc/mail/access
Open sendmail. mc, search for "127.0.0.1", and find the following code;
DAEMON_OPTIONS ('port = smtp, Addr = 127.0.0.1, Name = MTA ')
To:
DAEMON_OPTIONS ('port = smtp, Addr = 0.0.0.0, Name = MTA ')
Listen to all IP addresses
Search for "MD5" and find the following code:
Dnl TRUST_AUTH_MECH ('external DIGEST-MD5 login plain ') dnl
Dnl define ('confauth _ MECHANISMS ', 'external GSSAPI DIGEST-MD5 CRAM-MD5 login plain') dnl
Remove "dnl" from the front of the two rows and keep the dnl behind them.
Run the following command in shell: m4 sendmail. mc> sendmail. cf
Add the domain name used by the mail service in the local-host-names, such as an account zbwz@chuiniudi.cn, Here fill test.com, a domain name occupies a line, the domain name does not need to add ". ", the domain name is resolved to the IP address of the sendmail server.
The access file is used only when an email is sent across servers.
For example, the IP address of my sendmail server S1 is "192.168.1.2", and the IP address of another sendmail server S2 is "192.168.2.2 ″, use an account on S1 to send an email to the account on the S2 server. modify the access file on S2. Add the following content to the access file:
192.168.1.2 RELAY
Relay emails from 192.168.1.2.
Save it and run the following command in shell:
Makemap hash access. db
In the end, the sendmail program still needs to use the access. db file, so here we need to convert the access file to the access. db file.
Other options in the access file:
192.168.1 REJACK (rejected)
192.168.1.2 OK (absolutely allowed, fully trust this IP address)
The IP address can be an IP address or a CIDR block.
Notes for sending emails between two sendmail servers:
The host names of the two sendmail servers cannot be localhost. localdomain (default host name ).
Need to modifyConfigurationFile:/etc/sysconfig/network. or modify the file directly in "network", restart the NIC, and open/etc/hosts. The content in the file cannot contain the new host name.
Telnet to port 25 of the Sendmail server. If the host name is not localhost. localdomain, the two Sendmail servers can send emails to each other.
Make sure that the and MX records are properly recorded on the DNS server.
Take server S1 as an example: the domain name is chuiniudi.cn
Create the following records on the dns server:
@ In a 192.168.1.2
Mail in a 192.168.1.2
@ In mx 10 mail
Implementation of the group function:
People [1-3] can receive emails sent to team1.
Open the/etc/aliases file and add the following content:
Team1: People1, People2, and People3
Team2: People4, People5, People6
The team [1-2] And People [1-6] here are allReal user. You need to use the useradd command to create
If you do not want the Sendmail user to log on to the system, run the following command to add the user:
Useradd Username-S/sbin/nologin
In this caseConfigurationAfter that, the Sendmail server can perform the mostBasicSending and receiving emails
Http://zserver.blog.51cto.com/370152/156419