Computer Science/Computer Network

[CS][컴퓨터 네트워킹 하향식 접근] Chapter2.3 Email, SMTP, IMAP

y-seo 2023. 11. 2. 20:57

 

 
 

Chapter02. Application Layer

 

 
 

E-mail

  • 가장 먼저 개발된 인터넷 application이다
  • 3개의 주요 component를 가진다
    • user agent : 브라우저를 이용해 email을 작성/편집/송신/수신
    • mail server
    • SMTP : simple mail transfer protocol : 서버끼리 주고 받기 위해
  • user agent
    • = mail reader
    • 작성, 편집, 읽기, 보내기
    • Ex. outlook, iphone mail client
    • 서버에 저장된 메일을 보내거나 받음
  • mail server
    • mailbox는 사용자의 수신(들어온) 메세지 유지/소유
    • 송신(보낼) 메세지의 message queue 운영
    • email message를 보내기 위해 SMTP protocol은 mail server 사이에 존재, 주고받는 데에 필요한 프로토콜
      • client : mail server 보내기, 보낼 땐 client로 동작
      • server : mail server 받기, 받을 땐 server로 동작
  • RFC (5321)
    • 메일 전송을 위한 문서
    • TCP를 이용해 mail을 relieably하게 보낸다
    • Port 25로
    • direct transfer : 직접 보내고 직접 받는다
    • transfer 절차
      1. handshaking → 상대방과 established 됐다고 표현
      2. transfer of messages
      3. closure
    • command/response 상호 작용
      • command : ASCII text → reliable함, requset msg 대신 사용
      • response : status code and phrase
    • msg는 7bit ASCII 여야 한다 (binary(음성 등)를 ASCII 7bit로 끊어 바꾸어 보냄)

 

 
 

SMTP : closing observations

  • HTTP
    • pull, 가져오는 것
    • 각각의 object는 자신의 reponse msg를 암호화한다, 따로따로 포장해온다
  • SMTP
    • push, 주는 것
    • 여러개의 object가 multipart message로 보내짐, 하나로 포장하여 같이 옴
    • 지속적인 연결 → 한 번에 연결하여 여러 개를 보낸다
    • 7bit ASCII로 msg(header&body) 요구
    • . 은 msg의 끝을 의미함 (server)
  • 둘 다 ASCII command/response interaction과 status codes

 

 
 

Mail message format

  • SMTP
    • e-mail msg 교환을 위한 protocol로 RFC 531에 정의된다
  • RFC 822는 스스로 e-mail msg의 syntax를 정의

 

 
 

Mail access protocol

  • mail access = mail을 읽는다
  • SMTP : receiver’s server에게 email msg의 전달
  • mail access protocol : server에서 검색
    • IMAP : Internet Mail Access Protocol, 서버에 저장된 메세의 검색/삭제/폴더를 제공
  • HTTP : SMTP, IMAP 위에 웹 기반 인터페이스를 제공하여 email msg 검색