Thank you, yueda tianchong. I wish you a good result. Please contact me if you have time. Email is the oldest service in computer history. Currently, the commonly used MTA (Mail transmission agent) software mainly includes sendmail, postfix, exchange, and qmail. Among them, sendmail is the oldest, it is also the most complex; in the mail transmission process, MTA, MUA, PAA, MDA, MUA, and email user proxy mainly refer to client programs, such as outlook, foxmail, and thunderbird; the
Thank you, yueda tianchong. I wish you a good result. Please contact me if you have time.
Email is the oldest service in computer history. Currently, the commonly used MTA (Mail transmission agent) software mainly includes sendmail, postfix, exchange, and qmail. Among them, sendmail is the oldest, it is also the most complex; in the mail transmission process, MTA, MUA, PAA, MDA, MUA, and email user proxy mainly refer to client programs, such as outlook, foxmail, and thunderbird; as mentioned in the figure above, the software of the dovecot provides pop3, imap, and other email receiving services, while the MDA is the mail Filtering Proxy, mainly including procmail and so on ..., The configuration of sendmail is very complicated. This section only describes the hot spots of the rhce exam...
1: configure sendmail to listen to all ports on the local machine and send an email to the remote client for test.
[Root @ server2 ~] # Rpm-q sendmail-cf // install the sendmail-cf package. The main template is provided to change the package.
Package sendmail-cf is not installed
[Root @ server2 ~] # Yum-y install sendmail-cf
[Root @ server2 ~] # Service sendmail status
Sendmail (pid 2591) is running...
[Root @ server2 ~] # Netstat-ntpl | grep: 25 // sendmail is started by default and only listens to port 25 on the loopback interface.
Tcp 0 0 127.0.0.1: 25 0.0.0.0: * LISTEN 2591/sendmail: acce
[Root @ server2 ~] # Cp/etc/mail/sendmail. mc/etc/mail/sendmail. mc. orig // backup the template and master configuration file. This step is critical.
[Root @ server2 ~] # Cp/etc/mail/sendmail. cf/etc/mail/sendmail. cf. orig
[Root @ server2 ~] # Grep '2017. 0.0.1 '/etc/mail/sendmail. mc
Dnl #127.0.0.1 and not on any other network devices. Remove the loopback
Dnl DAEMON_OPTIONS ('port = smtp, Addr = 127.0.0.1, Name = MTA ') dnl // comment out this line. dnl represents a comment. You can also change 127.0.0.1 to 0.0.0.0.
[Root @ server2 ~] # M4/etc/mail/sendmail. mc>/etc/mail/sendmail. cf // use the m4 macro to generate a semi-binary configuration file
[Root @ server2 ~] # Cat/etc/mail/local-host-names
# Local-host-names-include all aliases for your machine here.
Server2.yang.com
[Root @ server2 ~] # Service sendmail restart // restart the service
Close sm-client: [OK]
Disable sendmail: [OK]
Start sendmail: [OK]
Start sm-client: [OK]
[Root @ server2 ~] # Netstat-ntpl | grep: 25
Tcp 0 0 0.0.0.0: 25 0.0.0.0: * LISTEN 2673/sendmail: acce
[Root @ server2 ~] # Useradd-s/sbin/nologin test1 // Add two Test Users
[Root @ server2 ~] # Useradd-s/sbin/nologin test2
[Root @ server2 ~] # Echo '200' | passwd -- stdin test1
Changing password for user test1.
Passwd: all authentication tokens updated successfully.
[Root @ server2 ~] # Echo '200' | passwd -- stdin test2
Changing password for user test2.
Passwd: all authentication tokens updated successfully.
C: \> telnet 192.168.122.20 25 // use the telnet command to test. By default, helo and mail from are configured in sendmial for spoofing and can be adjusted in the configuration file.
220 localhost. localdomain ESMTP Sendmail 8.13.8/8.13.8; Fri, 9 Apr 2010 12:51:55
+ 0800
Helo www.6688.cc
250 localhost. localdomain Hello [192.168.122.50], pleased to meet you
Mail from: admin@6688.cc
250 2.1.0 admin@6688.cc... Sender OK
Rcpt to: test1@server2.yang.com
250 2.1.5 test1@server2.yang.com... Recipient OK
Data
354 Enter mail, end with "." on a line by itself
Just one test!
.
250 2.0.0 o394ptpb002905 Message accepted for delivery
Quit
[Root @ server2 ~] # Mailq // view the message queue between MTA-MTA
/Var/spool/mqueue is empty
Total requests: 0
[Root @ server2 ~] # Mailq-Ac // view the message queue between MTA-MUA
/Var/spool/clientmqueue is empty
Total requests: 0
[Root @ server2 ~] # Grep 'o394ptpb002905 '/var/log/maillog // view mail log information
Apr 9 12:53:01 server2 sendmail [2905]: o394ptpb002905: from = admin@6688.cc, size = 15, class = 0, nrcpts = 1, msgid = <201004090452.o394ptpb002905@localhost.localdomain>, proto = SMTP, daemon = MTA, relay = [192.168.122.50] Apr 9 12:53:02 server2 sendmail [2912]: o394ptpb002905: to = test1@server2.yang.com, delay = 00:00:16, xdelay = 00:00:00,
Mailer = local, pri = 30333, dsn = 2.0.0, stat = Sent (use outlook to receive emails, you need to configure dovecot)
2: The configuration allows the ip address range 192.168.122.0/24 for RELAY operations, while limiting the test2@server2.yang.com to send mail