SlideShare a Scribd company logo
Topic 108
Essential System Services
Object 3: Mail
Transfer Agent (MTA) basics
5
‫سیستم‬ ‫یک‬ ‫اجزاء‬Mail
‫است‬ ‫شده‬ ‫تشکیل‬ ‫جزء‬ ‫چندین‬ ‫از‬
●MUA
●MTA
●MDA
Postfix The Definitive Guide, O'Reilly
6
MTA
‫مختلف‬ ‫های‬ ‫سازی‬‫پیاده‬
●Sendmail
–‫امنیتی‬ ‫مشکل ت‬ ‫و‬ ‫مشکل‬ ‫پیکربندی‬ ‫با‬ ،‫ها‬‫ترین‬ ‫قدیمی‬ ‫از‬ ‫یکی‬
●Postfix
–‫برای‬ ‫امن‬ ‫جایگزین‬ ‫و‬ ‫طرفدار‬ ‫پر‬ ‫سرویس‬ ‫یک‬sendmail
●Qmail
–‫شود‬‫می‬ ‫استفاده‬ ‫بسیار‬ ‫همچنان‬ ‫ولی‬ ،‫شده‬ ‫متوقف‬ ‫آن‬ ‫توسعه‬ ‫است‬ ‫مدتی‬
●Exim
–‫یک‬MTA‫برای‬ ‫قدرتمند‬ ‫و‬ ‫مناسب‬ ‫جایگزین‬ ‫و‬ ‫بسیارقوی‬sendmail‫بزرگ‬ ‫های‬ ‫سازی‬‫پیاده‬ ‫و‬
7
‫نامه‬ ‫یک‬ ‫ساختار‬
‫است‬ ‫اصلی‬ ‫بخش‬ ‫سه‬ ‫دارای‬ ‫نامه‬ ‫هر‬
●Header
–‫شامل‬To: , From‫و‬ :Subject‫از‬ ‫خالی‬ ‫خط‬ ‫یک‬ ‫با‬ ‫و‬ ‫شود‬ ‫خط‬ ‫چندین‬ ‫تواند‬‫می‬ ‫که‬ .‫است‬ :
body‫شود‬‫می‬ ‫جدا‬
●Body
–‫شماست‬ ‫نامه‬ ‫محتویا ت‬ ‫بخش‬ ‫این‬
●Envelop
–‫یا‬ ‫و‬ ‫تحویل‬ ‫برای‬ ‫بخش‬ ‫این‬ ‫محتویا ت‬ ‫از‬bounce‫محتویا ت‬ ‫نه‬ ‫و‬ ‫شود‬‫می‬ ‫استفاده‬header
8
Postfix
● Debian/Ubuntu
● RHEL/CentOS
# apt-get install postfix# apt-get install postfix
<<< install by default >>><<< install by default >>>
9
Postfix Config
● Minimal config
# vim /etc/postfix/main.cf
mydomain=cvak.ir
myhostname=$mydomain
mydestination=$domain $myhostname localhost localhost.localdomain
myorigin=$mydomain
inet_interfaces=all
mynetworks=127.0.0.1
# vim /etc/postfix/main.cf
mydomain=cvak.ir
myhostname=$mydomain
mydestination=$domain $myhostname localhost localhost.localdomain
myorigin=$mydomain
inet_interfaces=all
mynetworks=127.0.0.1
# systemctl restart postfix# systemctl restart postfix
10
alias
●‫یا‬ ‫و‬ ‫مجازی‬ ‫کاربر‬ ‫ایجاد‬forward‫دیگری‬ ‫به‬ ‫اکانت‬ ‫یک‬
# vi /etc/aliases
...
fakeaccount: behrad
root: behrad
behrad: behrad,b.eslamifar@cvak.ir
# vi /etc/aliases
...
fakeaccount: behrad
root: behrad
behrad: behrad,b.eslamifar@cvak.ir
# newaliases
# ls /etc/aliases*
/etc/aliases /etc/aliases.db
# newaliases
# ls /etc/aliases*
/etc/aliases /etc/aliases.db
11
forward.
●‫خود‬ ‫برای‬ ‫تواند‬‫می‬ ‫نیز‬ ‫کاربر‬ ‫هر‬forwarder‫کنید‬ ‫تعریف‬
$ vi ~/.forward
behrad_es@yahoo.com, user1
$ vi ~/.forward
behrad_es@yahoo.com, user1
12
‫ایمیل‬ ‫ارسال‬
● mail command
$ mail -s "exampl subject" behrad
Hi
This is test email
.
cc:
$ mail -s "exampl subject" behrad
Hi
This is test email
.
cc:
13
mailq
● mailq
● C527D43E7D* : Active queue
● C527D43E9A : Deferred queue
# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
C527D43E7D* 289 Tue Sep 27 14:56:11 root@cvak.ir
behrad_es@yahoo.com
-- 0 Kbytes in 1 Request.
# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
C527D43E7D* 289 Tue Sep 27 14:56:11 root@cvak.ir
behrad_es@yahoo.com
-- 0 Kbytes in 1 Request.
# sendmail -q (resend deferred email)# sendmail -q (resend deferred email)

More Related Content

More from behrad eslamifar

320.1-Cryptography
320.1-Cryptography320.1-Cryptography
320.1-Cryptography
behrad eslamifar
 
200.1,2-Capacity Planning
200.1,2-Capacity Planning200.1,2-Capacity Planning
200.1,2-Capacity Planning
behrad eslamifar
 
00-Review of Linux Basics
00-Review of Linux Basics00-Review of Linux Basics
00-Review of Linux Basics
behrad eslamifar
 
Chapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availabilityChapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availability
behrad eslamifar
 
Chapter 12 - network security
Chapter 12 - network securityChapter 12 - network security
Chapter 12 - network security
behrad eslamifar
 
Chapter 11 - voice and video over ip
Chapter 11 - voice and video over ipChapter 11 - voice and video over ip
Chapter 11 - voice and video over ip
behrad eslamifar
 
Chapter 09 - network operating systems
Chapter 09 - network operating systemsChapter 09 - network operating systems
Chapter 09 - network operating systems
behrad eslamifar
 
Chapter 08 - wireless networking
Chapter 08 - wireless networkingChapter 08 - wireless networking
Chapter 08 - wireless networking
behrad eslamifar
 
Chapter 06 - network hardwares
Chapter 06 - network hardwaresChapter 06 - network hardwares
Chapter 06 - network hardwares
behrad eslamifar
 
Chaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standardsChaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standards
behrad eslamifar
 
Chapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocolsChapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocols
behrad eslamifar
 
Chapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivityChapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivity
behrad eslamifar
 
Chapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking mediaChapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking media
behrad eslamifar
 
Chapter02 - network standard and osi model
Chapter02 - network standard and osi modelChapter02 - network standard and osi model
Chapter02 - network standard and osi model
behrad eslamifar
 
Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+
behrad eslamifar
 

More from behrad eslamifar (15)

320.1-Cryptography
320.1-Cryptography320.1-Cryptography
320.1-Cryptography
 
200.1,2-Capacity Planning
200.1,2-Capacity Planning200.1,2-Capacity Planning
200.1,2-Capacity Planning
 
00-Review of Linux Basics
00-Review of Linux Basics00-Review of Linux Basics
00-Review of Linux Basics
 
Chapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availabilityChapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availability
 
Chapter 12 - network security
Chapter 12 - network securityChapter 12 - network security
Chapter 12 - network security
 
Chapter 11 - voice and video over ip
Chapter 11 - voice and video over ipChapter 11 - voice and video over ip
Chapter 11 - voice and video over ip
 
Chapter 09 - network operating systems
Chapter 09 - network operating systemsChapter 09 - network operating systems
Chapter 09 - network operating systems
 
Chapter 08 - wireless networking
Chapter 08 - wireless networkingChapter 08 - wireless networking
Chapter 08 - wireless networking
 
Chapter 06 - network hardwares
Chapter 06 - network hardwaresChapter 06 - network hardwares
Chapter 06 - network hardwares
 
Chaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standardsChaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standards
 
Chapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocolsChapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocols
 
Chapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivityChapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivity
 
Chapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking mediaChapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking media
 
Chapter02 - network standard and osi model
Chapter02 - network standard and osi modelChapter02 - network standard and osi model
Chapter02 - network standard and osi model
 
Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+
 

108.3-Mail Transfer Agent(MTA) basics

  • 1.
  • 3. Object 3: Mail Transfer Agent (MTA) basics
  • 4. 5 ‫سیستم‬ ‫یک‬ ‫اجزاء‬Mail ‫است‬ ‫شده‬ ‫تشکیل‬ ‫جزء‬ ‫چندین‬ ‫از‬ ●MUA ●MTA ●MDA Postfix The Definitive Guide, O'Reilly
  • 5. 6 MTA ‫مختلف‬ ‫های‬ ‫سازی‬‫پیاده‬ ●Sendmail –‫امنیتی‬ ‫مشکل ت‬ ‫و‬ ‫مشکل‬ ‫پیکربندی‬ ‫با‬ ،‫ها‬‫ترین‬ ‫قدیمی‬ ‫از‬ ‫یکی‬ ●Postfix –‫برای‬ ‫امن‬ ‫جایگزین‬ ‫و‬ ‫طرفدار‬ ‫پر‬ ‫سرویس‬ ‫یک‬sendmail ●Qmail –‫شود‬‫می‬ ‫استفاده‬ ‫بسیار‬ ‫همچنان‬ ‫ولی‬ ،‫شده‬ ‫متوقف‬ ‫آن‬ ‫توسعه‬ ‫است‬ ‫مدتی‬ ●Exim –‫یک‬MTA‫برای‬ ‫قدرتمند‬ ‫و‬ ‫مناسب‬ ‫جایگزین‬ ‫و‬ ‫بسیارقوی‬sendmail‫بزرگ‬ ‫های‬ ‫سازی‬‫پیاده‬ ‫و‬
  • 6. 7 ‫نامه‬ ‫یک‬ ‫ساختار‬ ‫است‬ ‫اصلی‬ ‫بخش‬ ‫سه‬ ‫دارای‬ ‫نامه‬ ‫هر‬ ●Header –‫شامل‬To: , From‫و‬ :Subject‫از‬ ‫خالی‬ ‫خط‬ ‫یک‬ ‫با‬ ‫و‬ ‫شود‬ ‫خط‬ ‫چندین‬ ‫تواند‬‫می‬ ‫که‬ .‫است‬ : body‫شود‬‫می‬ ‫جدا‬ ●Body –‫شماست‬ ‫نامه‬ ‫محتویا ت‬ ‫بخش‬ ‫این‬ ●Envelop –‫یا‬ ‫و‬ ‫تحویل‬ ‫برای‬ ‫بخش‬ ‫این‬ ‫محتویا ت‬ ‫از‬bounce‫محتویا ت‬ ‫نه‬ ‫و‬ ‫شود‬‫می‬ ‫استفاده‬header
  • 7. 8 Postfix ● Debian/Ubuntu ● RHEL/CentOS # apt-get install postfix# apt-get install postfix <<< install by default >>><<< install by default >>>
  • 8. 9 Postfix Config ● Minimal config # vim /etc/postfix/main.cf mydomain=cvak.ir myhostname=$mydomain mydestination=$domain $myhostname localhost localhost.localdomain myorigin=$mydomain inet_interfaces=all mynetworks=127.0.0.1 # vim /etc/postfix/main.cf mydomain=cvak.ir myhostname=$mydomain mydestination=$domain $myhostname localhost localhost.localdomain myorigin=$mydomain inet_interfaces=all mynetworks=127.0.0.1 # systemctl restart postfix# systemctl restart postfix
  • 9. 10 alias ●‫یا‬ ‫و‬ ‫مجازی‬ ‫کاربر‬ ‫ایجاد‬forward‫دیگری‬ ‫به‬ ‫اکانت‬ ‫یک‬ # vi /etc/aliases ... fakeaccount: behrad root: behrad behrad: behrad,b.eslamifar@cvak.ir # vi /etc/aliases ... fakeaccount: behrad root: behrad behrad: behrad,b.eslamifar@cvak.ir # newaliases # ls /etc/aliases* /etc/aliases /etc/aliases.db # newaliases # ls /etc/aliases* /etc/aliases /etc/aliases.db
  • 10. 11 forward. ●‫خود‬ ‫برای‬ ‫تواند‬‫می‬ ‫نیز‬ ‫کاربر‬ ‫هر‬forwarder‫کنید‬ ‫تعریف‬ $ vi ~/.forward behrad_es@yahoo.com, user1 $ vi ~/.forward behrad_es@yahoo.com, user1
  • 11. 12 ‫ایمیل‬ ‫ارسال‬ ● mail command $ mail -s "exampl subject" behrad Hi This is test email . cc: $ mail -s "exampl subject" behrad Hi This is test email . cc:
  • 12. 13 mailq ● mailq ● C527D43E7D* : Active queue ● C527D43E9A : Deferred queue # mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- C527D43E7D* 289 Tue Sep 27 14:56:11 root@cvak.ir behrad_es@yahoo.com -- 0 Kbytes in 1 Request. # mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- C527D43E7D* 289 Tue Sep 27 14:56:11 root@cvak.ir behrad_es@yahoo.com -- 0 Kbytes in 1 Request. # sendmail -q (resend deferred email)# sendmail -q (resend deferred email)