์ƒˆ์†Œ์‹

์ธ๊ธฐ ๊ฒ€์ƒ‰์–ด

๐Ÿ’ป Linux

20220425

  • -
๋ฐ˜์‘ํ˜•

<aside> ๐Ÿ’ก - ๋ฉ”์ผ ํด๋ผ์ด์–ธํŠธ ( MUA ) : Mail User Agent

  • ๋ฉ”์ผ ํ ( ์„ ์ž…์„ ์ถœ ) FIFO : ๋ฉ”์ผ์ด ๋Œ€๊ธฐํ•˜๋Š” ๋Œ€๊ธฐ์†Œ : ๋ฉ”์ผ ์ „์†กํ•˜๋Š” ์ชฝ์—๋งŒ ์กด์žฌ
  • ์ƒŒ๋“œ๋ฉ”์ผ ( MTA ) : Mail Transfer Agent
  • dovecot ( MRA ) : Mail Retrieval Agent
  • SMTP : 25๋ฒˆ ํฌํŠธ ์‚ฌ์šฉ

</aside>

# ๋ฉ”์ผ ์„œ๋ฒ„ ๊ตฌ์ถ•
# First DNS Second-Client / Second / Third First-Client
##### Centos7_First
[root@localhost ~]
yum -y install sendmail # ๋ฉ”์ผ ์„œ๋ฒ„ ์„ค์น˜

vim /etc/hostname
	> mail.chaen.com
vim /etc/sysconfig/network
	> HOSTNAME=mail.chaen.com
vim /etc/hosts
	> 192.168.111.100 mail.chaen.com
vim /etc/mail/local-host-names
	> mail.chaen.com
------ ์ ์šฉํ•˜๊ธฐ ์œ„ํ•ด REBOOT ํ•˜๊ธฐ
[root@mail ~] ๋กœ ๋ณ€๊ฒฝ๋œ๊ฑฐ ํ™•์ธํ•˜๊ธฐ

##### Centos7_Second
[root@localhost ~]
yum -y install sendmail # ๋ฉ”์ผ ์„œ๋ฒ„ ์„ค์น˜

vim /etc/hostname
	> mail.john.com
vim /etc/sysconfig/network
	> HOSTNAME=mail.john.com
vim /etc/hosts
	> 192.168.111.100 mail.john.com
vim /etc/mail/local-host-names
	> mail.john.com
------ ์ ์šฉํ•˜๊ธฐ ์œ„ํ•ด REBOOT ํ•˜๊ธฐ
[root@mail ~] ๋กœ ๋ณ€๊ฒฝ๋œ๊ฑฐ ํ™•์ธํ•˜๊ธฐ

##### CentOs7_First
[root@mail ~] yum -y install bind bind-chroot
vim /etc/named.conf
	> 13         listen-on port 53 { any; };
		14         listen-on-v6 port 53 { none; };
		21         allow-query     { any; };

	zone "chaen.com" IN {
        type master;
        file "chaen.zone";
        allow-update{none;};
};

zone "john.com" IN {
        type master;
        file "john.zone";
        allow-update{none;};
};

[root@mail ~] named-checkconf
[root@mail ~] cd /var/named
vim chaen.zone
$TTL    3H
@       SOA     @       root.   (220425 1D 1H 1W 1H)
        IN      NS      @
        IN      A       192.168.111.100
        IN      MX 10   mail.chaen.com. # mail exchaenge 10(10์ด ์ œ์ผ ์šฐ์„ ์ˆœ์œ„) 

www     IN      A       192.168.111.100
mail    IN      A       192.168.111.100
~

cp chaen.zone john.zone
vim john.zone
$TTL    3H
@       SOA     @       root.   (220425 1D 1H 1W 1H)
        IN      NS      @
        IN      A       192.168.111.100
        IN      MX 10   mail.john.com.

mail    IN      A       192.168.111.200

named-checkzone chaen.com chaen.zone
named-checkzone john.com john.zone
systemctl stop firewalld
systemctl disable firewalld
systemctl restart named
systemctl enable named
[root@mail named]# vim /etc/resolv.conf
	> search chaen.com
		nameserver 192.168.111.100
vim /etc/sysconfig/network-scripts/ifcfg-ens33 # DNS 100์„ค์ •
systemctl restart network
nslookup
	> server mail.john.com 192.168.111.200 > ํ™•์ธ

# CentOS7_Second
[root@mail named]# vim /etc/resolv.conf
	> search chaen.com
		nameserver 192.168.111.100
vim /etc/sysconfig/network-scripts/ifcfg-ens33 # DNS 100์„ค์ •
systemctl restart network
~~~~nslookup
	> server mail.john.com 192.168.111.200 > ํ™•์ธ

# CentOS7_First ๋ฉ”์ผ์„œ๋ฒ„ ๊ตฌ์ถ•
yum -y install sendmail-cf dovecot

vim /etc/mail/sendmail.cf # ์„ค์ • ํŒŒ์ผ
:set nu / 85
85 Cwchaen.com
264 O DaemonPortOptions=Port=smtp, Name=MTA
systemctl restart sendmail

vim /etc/mail/access # ๋ฉ”์ผ ์†ก์ˆ˜์‹  ํ—ˆ์šฉ ๋ฒ”์œ„
chaen.com       RELAY
john.com        RELAY
192.168.111     RELAY

makemap hash /etc/mail/access < /etc/mail/access # ์ปดํŒŒ์ผํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๊ธฐ

vim /etc/dovecot/dovecot.conf # ์„ค์ • ํŒŒ์ผ
24 protocols = imap pop3 lmtp # ์ฃผ์„ํ•ด์ œ
30 listen = *, :: # IPv4,6 ๊ตฌ์•  ๋ฐ›์ง€์•Š๊ณ  ๋ฐ›๊ฒ ๋‹ค
33 base_dir = /var/run/dovecot/

vim /etc/dovecot/conf.d/10-ssl.conf
8 ssl = yes # ์š”์ฒญํ• ๋•Œ๋งˆ๋‹ค๊ฐ€ ์•„๋‹Œ ํ•ญ์ƒ ์ผœ์ ธ์žˆ๋„๋ก ์„ค์ •

vim /etc/dovecot/conf.d/10-mail.conf
25    mail_location = mbox:~/mail:INBOX=/var/mail/%u
121 mail_access_groups = mail
166 lock_method = fcntl

vim /etc/dovecot/conf.d/10-auth.conf
10 disable_plaintext_auth = no # ํ‰๋ฌธ ๋“ค์–ด์˜ค๋Š”๊ฑฐ ๋ง‰์„์ง€ ์„ค์ •

useradd chaen
passwd chaen

systemctl restart sendmail
systemctl restart dovecot
systemctl enable sendmail
systemctl enable dovecot

# CentOS7_Third
yum -y install thunderbird
ํ”„๋กœ๊ทธ๋žจ - ์ธํ„ฐ๋„ท - thunderbird
configure manual
# incoming
pop3
none
nomal password
# out
no authentication

#re-test

Window ์—์„œ Thunderbird ๋ฉ”์ผ ๋ฐ›๊ธฐ

  • ๋ธŒ๋ฆฟ์ง€ ์„ค์ • - CentOS7_First์—์„œ ๋„คํŠธ์›Œํฌ ์–ด๋Œ‘ํ„ฐ ๋ธŒ๋ฆฟ์ง€๋กœ ์„ค์ •
yum -y install bind bind-chroot
vim /etc/sysconfig/network-scripts/ifcfg-ens33
	> IPADDR=192.168.0.45
		NETMASK=255.255.255.0
		GATEWAY=192.168.0.1 # ์œˆ๋„์šฐ ์„œ๋ฒ„๋ž‘ ๊ฒŒ์ดํŠธ์›จ์ด ๋งž์ถฐ์„œ ์‚ฌ์šฉ
		DNS1=192.168.0.45
vim /etc/resolv.conf
	> nameserver=192.168.0.45
systemctl restart network
  • CentOS7_First DNS ์„ค์ •
  • ์œˆ๋„์šฐ DNS ์„ค์ •
์ œ์–ดํŒ - ๋„คํŠธ์›Œํฌ ๋ฐ ์ธํ„ฐ๋„ท - ๋„คํŠธ์›Œํฌ ๋ฐ ๊ณต์œ  ์„ผํ„ฐ - ์–ด๋Œ‘ํ„ฐ ์„ค์ • ๋ณ€๊ฒฝ -
์ด๋”๋„ท > ์†์„ฑ - ์ธํ„ฐ๋„ท ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ - DNS์„œ๋ฒ„ 192.168.0.45๋กœ ์„ค์ •
  • ์„ค์น˜ ๋ฐ ์„ค์ •
yum -y install sendmail sendmail-cf

๋ฐ˜์‘ํ˜•

'๐Ÿ’ป Linux' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

220426  (0) 2022.04.29
CentOS7 ํ”„๋ก์‹œ ์„œ๋ฒ„  (0) 2022.04.21
CentOS7 DHCP ์ž๋™ ํ• ๋‹น, ์ˆ˜๋™ ํ• ๋‹น  (0) 2022.04.21
CentOS7 Samba Ubuntu Window  (0) 2022.04.21
CentOS7 Samba ์ด๊ธฐ์ข… ๊ณต์œ  ํด๋”  (0) 2022.04.21
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.