Mail Service System
Nslookup check if the domain name can be resolved
[Email protected] ~]# firewall-cmd--set-default-zone=trust #设置默认防火墙区域为trust
[Email protected] ~]# echo server0.example.com >/etc/hostname #名字改为server0. example.com
[email protected] ~]# nslookup server0.example.com
server:172.25.254.254
Address:172.25.254.254#53
Name:server0.example.com
address:172.25.0.11
[Email protected] ~]# firewall-cmd--set-default-zone=trust #设置默认防火墙区域为trust
[Email protected] ~]# echo server0.example.com >/etc/hostname #名字改为server0. example.com
#######################################################################################
User-Sent Email protocol
Outgoing Mail protocol SMTP port 25
Receive mail protocol POP3 Port 110/imap port 143
Modifying a configuration file
[Email protected] ~]# VIM/ETC/POSTFIX/MAIN.CF
Myhostname = server0.example.com #76行 Specify host name
mydomain = example.com #83行 specified domain name
Myorigin = server0.example.com #99行 The default complete message suffix
Inet_interfaces = All #116行 allow all clients
Mydestination = sercer0.example.com #164行 determine message suffix for this domain
Restart Boot
[Email protected] ~]# systemctl restart Postfix
[Email protected] ~]# Systemctl enable Postfix
Create user Add password
[Email protected] ~]# Useradd YG
[Email protected] ~]# echo 123 > passwd--stdin YG
[Email protected] ~]# Useradd XLN
[Email protected] ~]# echo 123 > passwd--stdin XLN
Send and receive mail
[Email protected] ~]# mail-s ' haha '-R yg Xln
123456789
987654321
. # indicates the input is complete.
EOT
[Email protected] ~]# mail-u XLN
Heirloom Mail Version 12.5 7/5/10. Type? For help.
"/VAR/MAIL/XLN": 1 message 1 new
>n 1 [email protected] Thu Nov 2 11:27 19/586 "haha"
& 1
Message 1:
From [email protected] Thu 2 11:27:15 2017
Return-path: <[email protected]>
X-original-to:xln
delivered-to: [Email protected]
Date:thu, Geneva 2017 11:27:15 +0800
From: [Email protected]
To: [Email protected]
Subject:haha
User-agent:heirloom MAILX 12.5 7/5/10
Content-type:text/plain; Charset=us-ascii
Status:r
123456789
987654321
& Quit
Held 1 Message In/var/mail/xln
###############################################################################
Nullclient Empty Client Service
Configure the terminal
[Email protected] ~]# VIM/ETC/POSTFIX/MAIN.CF
Myorigin = desktop0.example.com #99行 The default complete message suffix
Inet_interfaces = All #116行 allow all clients to be accepted
Mydestination = desktop0.example.com #164行 determine message suffix for this domain
Configuring the Nullclient Client
[Email protected] ~]# VIM/ETC/POSTFIX/MAIN.CF
Myorigin = desktop0.example.com #99行 The default complete message suffix
inet_interfaces = localhost #116行 only accept local hosts
mydestination = #164行 No mail for this domain
Relayhost = [172.25.0.10] #317行 assigned to the mail server IP address
Send mail
[Email protected] ~]# echo Hahahahahahaha | Mail-s Test1-r YG Student
[Email protected] ~]# Mail-u Student
Heirloom Mail Version 12.5 7/5/10. Type? For help.
"/var/mail/student": 1 message 1 new
>n 1 [email protected] Thu Nov 2 15:09 21/826 "Test1"
& 1
Message 1:
From [email protected] Thu 2 15:09:17 2017
Return-path: <[email protected]>
x-original-to: [Email protected]
delivered-to: [Email protected]
Date:thu, Geneva 2017 15:09:18 +0800
From: [Email protected]
To: [Email protected]
Subject:test1
User-agent:heirloom MAILX 12.5 7/5/10
Content-type:text/plain; Charset=us-ascii
Status:r
Hahahahahahaha
##################################################################################
Database
Deploying the MARIDB Database
[Email protected] ~]# yum-y install Mariadb-server
Enter the database
[[email protected] ~]# MySQL
MariaDB [(None)]> show databases;
MariaDB [(None)]> CREATE database hahaha;
MariaDB [(None)]> drop database hahaha;
MariaDB [(None)]> CREATE Database nsd;
MariaDB [(none)]> quit
Set Password
[Email protected] ~]# mysqladmin-u root password ' 123 '
[email protected] ~]# MySQL #有密码情况下输入mysql会报错
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
[Email protected] ~]# mysql-u root-p #有密码情况下交互式登陆
Enter Password:
Free Interactive Login
[[email protected] ~]# mysql-u root-p123 #p后直接加上密码 Poor security
Skip Network snooping
[Email protected] ~]# vim/etc/my.cnf #数据库主配置文件
Skip-networking
[Email protected] ~]# systemctl restart MARIADB
Import data to a database
[Email protected] ~]# wget http://172.25.254.254/pub/materials/users.sql
[Email protected] ~]# mysql-u root-p123 NSD < Users.sql
[Email protected] ~]# mysql-u root-p123
MariaDB [(None)]> use NSD;
MariaDB [nsd]> Show tables;
Individually authorized users
MariaDB [nsd]> Grant Select on nsd.* to [e-mail protected] identified by ' 123 ';
MariaDB [nsd]> Select User.password from Mysql.user;
Find out the number of people named Barbara as healthcare worker in Sunnyvale.
MariaDB [nsd]> SELECT * from base,location where base.name= ' Barbara ' and Location.city= ' Sunnyvale ' and Base.id=locatio N.id;
MariaDB [nsd]> Select COUNT (*) from base,location where Base.name= ' Barbara ' and Location.city= ' Sunnyvale ' and base.id= Location.id;
MariaDB [nsd]> Insert Base values (6, ' Barbara ', 123456);
MariaDB [nsd]> Insert Location VALUES (6, ' Sunnyvale ');
MariaDB [nsd]> Select COUNT (*) from base,location where Base.name= ' Barbara ' and Location.city= ' Sunnyvale ' and base.id= Location.id;
Basics of Linux Mail Base database