ãããã IMAP ãæ®åããããã§ãPOP ãã IMAP ã«ä¹ãæãã人ãå¢ãã¦ãã¾ããåã®å¨ãã®ã¤ã³ã¿ã¼ãããæè¡è ããã¼ã¡ã¼ã¡ä¹ãæãå§ãã¾ããã(gmail ã IMAP ããµãã¼ããããã¨ã大ããªè¦å ã§ããããï¼)
å½¼ãã¯åªç§ãªã®ã«ãé¢ãããããããªééã£ã表ç¾ã使ãã¾ãã
- POP ã¯ã¡ã¼ã«ãã¡ã¼ã«ãªã¼ãã«åã£ã¦ãããã®ã§ãIMAP ã¯ãµã¼ãå´ã®ã¡ã¼ã«ãèªããã®ã
- POP ã ã¨ããã£ããã©ãIMAP ã¯å¸¸ã«ãããã¯ã¼ã¯ã«ã¤ãªãã£ã¦ããªãã¨è¾ã
- POP ã ã¨ããã£ããã©ãIMAP ã¯ãã©ã«ãå ã®ã¡ã¼ã«ã®æ°ãå¤ããªãã¨è¾ã
ãã®åº¦ã«ãããããããªããã¨è¨ã£ã¦ããã®ã§ããããããã説æããã®ã«ãç²ãã¦ãã¾ãããããã§ãæ£ãããã¨ãæ¸ãã¦ããã®èª¬æã¯ããäºåº¦ã¨ããªããã¨ã«ãããã¨æãã¾ãã(DRY: Don't Repeat Yourself ã§ããã)
ééãã®æ ¹æºã¯ãããããäºã¤ã§ãã
- ããããã³ã«ãã¨ããã®ã使ãæ¹ããåä¸è¦ãã¦ãã
- æãããªãã¨ã§ããã両è ã¯ç°ãªãã¾ã
- ããããã³ã«ãã¨ãå®è£ ãæ¹æ³ãåä¸è¦ãã¦ãã
- ééãããããã¨ã§ããã両è ã¯ç°ãªãã¾ã
POP 㨠IMAP ã®éã
ã¾ã第ä¸ã«ãããããPOP 㨠IMAP ã¯å ¨ç¶éããããã³ã«ã ãã¨èª¤è§£ãã¦ããã®ã§ãããããã®æãè¾¼ã¿ãç´ãã¦ä¸ããã
POP 㨠IMAP ã¯ãä¼¼ããããªãããã³ã«ã§ãã両è ã®æ¬è³ªçãªéãã¯ããµã¼ãå´ã«ããã¦ãPOP ã®ã¡ã¼ã«ããã¯ã¹ã 1 ã¤ã§ããã®ã«å¯¾ããIMAP ã®ããã¯è¤æ°ã§ãããã¨ã§ãã
ã¤ã¾ããIMAP 㯠POP ã®ã¹ã¼ãã¼ã»ããã§ãããPOP ã«ã§ãããã¨ã¯ãIMAP ã«ãã§ããã®ã§ããããããåã£ã¦ããã°ãPOP ãã IMAP ã«å¤ãã¦ãã使ãå¿å°ãæªããªãã¯ãã¯ãªãã®ã¯æããã§ãã
ããã使ãå¿å°ãæªããªã£ãã¨ããããããã¯ãããã³ã«ã®åé¡ã§ã¯ãªããå®è£ ã®åé¡ã§ããã¤ã¾ããIMAP ãæªãã®ã§ã¯ãªããããªãã®ã¡ã¼ã«ãªã¼ãã®å®è£ ããããã®ã§ãã
使ãæ¹
ãPOP ã¯ãã¡ã¼ã«ãã¡ã¼ã«ãªã¼ãå´ã«åã£ã¦ãããã®ã ãã¨æã£ã¦ããã®ã§ãããã失礼ã§ãããããªã㯠POP ã«é¢ã㦠old type ã§ãã:) æè¿ã® POP ã¦ã¼ã¶ã®å¤ãã¯ãPOP ãµã¼ãããã¡ã¼ã«ãåã£ã¦ãããµã¼ãå´ã®ã¡ã¼ã«ã¯åé¤ãã¾ããã
ãã¡ãããISP/ASP ã¨ãã¦ã¯ããµã¼ãã«ã¡ã¼ã«ãæ®ãããã¨ãã£ã¹ã¯ãå§è¿«ãããã®ã§ãåé¤ãã¦ã»ããã¨é¡ã£ã¦ãã¾ãããã§ãããããªä»äººã®é¡ãã«ã¯ç¡é çã§ããããå¤ãã®ã¦ã¼ã¶ãã¡ã¼ã«ãæ®ãã¾ããä¸æ¥ã«æ°éããã¡ã¼ã«ãåãåããªãã¦ã¼ã¶ã§ããã°ããªãã®åé¡ãèµ·ãã¾ããã
ä¸æ¹ãIMAP ã§ããã¡ã¼ã«ãåå¾ããå¾ã«ãµã¼ãããæ¶ãã¨ãããold type 㪠POP 風ã®ä½¿ãæ¹ãã§ãã¾ãããã¡ãããããã ã¨ãè¤æ°ã®ã¡ã¼ã«ããã¯ã¹ãã¨ããç¹å¾´ã¯æ´»ããã¾ãããã©ãã
POPã®éä¿¡ä¾
POP ã§ã¡ã¼ã«ãåå¾ããã«ã¯ããããªè¨èãåãã¾ãã
% telnet pop.example.com 110
S: +OK POP server ready.
C: USER bob
S: +OK Password required.
C: PASS password
S: +OK bob has 3 message(s) (3557 bytes).
C: LIST ï¼ ã¡ã¼ã«ä¸è¦§
S: 1 3823 ï¼ çªå· ãµã¤ãº
S: 2 2765
S: 3 3010
S: .
C: RETR 1 ï¼ ã¡ã¼ã« 1 ãåå¾
S: Subject: test
S: From: [email protected]
S: To: bob@example.com
S:
S: this is a body.
S:
S: --Alice
S: .
C: DELE 1 ï¼ ã¡ã¼ã« 1 ã«åé¤ãã¼ã¯ãä»ãã
S: +OK Message 1 has been deleted.
C: QUIT ï¼ éä¿¡çµãããã¡ã¼ã«ãåé¤ããã
S: +OK POP server at pop.example.com signing off.
ã¡ã¼ã«ã®ãªã¹ããåãã好ããªã¡ã¼ã«ããã¼ã«ã«ã«ã³ãã¼ãã¦ãä¸è¦ãªãã¡ã¼ã«ãåé¤ãã¾ããUNIX 風ã«è¨ããªããls ãã¦ãscp ãã¦ãrm ããã®ã§ãã
æå¾ã«åé¤ããªããã°ãã¡ã¼ã«ã¯ãµã¼ãå´ã«æ®ããã¾ããåå¾æ¸ã¿ã®ã¡ã¼ã«ããµã¼ãå´ã«æ®ããã¨ãã¦ããæ°çã¡ã¼ã«ãå¤æããæ¹æ³ãæä¾ããã¦ãã¾ããä»æ¥ã®ãã¼ãã¨ã¯é¢ä¿ããªãã®ã§ããã®æ¹æ³ã¯èª¬æãã¾ããã
IMAPã®éä¿¡ä¾
IMAP ã§ã¡ã¼ã«ãåå¾ããã«ã¯ããããªè¨èãåãã¾ãã
% telnet imap.example.com 143
S: * OK
C: tag1 LOGIN "bob" "password"
S: tag1 OK Logged in.
C: tag2 SELECT "inbox" ï¼ inbox ãé¸æ
S: * 3 EXISTS ï¼ ã¡ã¼ã«ã 3 ã¤ãã
S: tag2 OK Select completed.
C: tag3 FETCH 1 RFC822 ï¼ ã¡ã¼ã« 1 ãåå¾
S: * 1 FETCH (RFC822 {3823}
S: Subject: test
S: From: [email protected]
S: To: bob@example.com
S:
S: this is a body.
S:
S: --Alice
S:
S: )
S: tag3 OK Fetch completed.
C: tag4 STORE 1 +FLAGS (\Deleted) ï¼ ã¡ã¼ã« 1 ã«åé¤ãã¼ã¯ãä»ãã
S: tag4 OK Store completed.
C: tag5 EXPUNGE ï¼ ã¡ã¼ã«ãåé¤
S: tag5 OK Expunge completed.
C: tag6 LOGOUT ï¼ éä¿¡çµãã
S: tag6 OK Logout completed.
ã¡ã¼ã«ã®ãªã¹ããåãã好ããªã¡ã¼ã«ããã¼ã«ã«ã«ã³ãã¼ãã¦ãä¸è¦ãªãã¡ã¼ã«ãåé¤ãã¾ããåèªã¯éãã¾ãããå 容㯠POP ã¨åãã§ãããï¼
å©ç¨æ¹æ³ã®åé¡
ã¤ã¾ãããããããã¨ã§ãã
- old type ã® POP ã¦ã¼ã¶ã¯ããµã¼ãããã¡ã¼ã«ãåé¤ãã
- new type ã® POP ã¦ã¼ã¶ã¯ããµã¼ãã«ã¡ã¼ã«ãæ®ã
- IMAP ã¦ã¼ã¶ã¯ããµã¼ãã«ã¡ã¼ã«ãæ®ããããããã¯ãIMAP ã®ç¹æ§ãæ´»ããããã«ãå¥ã®ã¡ã¼ã«ããã¯ã¹ã«ç§»åããã
IMAP ã®ãããå®è£ (1)
IMAP ã®å ¸åçãªãããå®è£ ã¯ããããªæãã§ãã
- ããã¡ã¼ã«ããã¯ã¹ã«ããã¡ã¼ã«ã®ãããæ å ±ã ããåå¾ããä¸è¦§è¡¨ç¤ºãã
- ã¦ã¼ã¶ããããã¡ã¼ã«ãèªããã¨ããã¨ããµã¼ãã«ã¤ãªãã§ããã®ã¡ã¼ã«ãåå¾ã表示ãã
ããã£ã¦ããããã AJAX 以åã® web ã¢ããªã¿ããã§ãããã¦ã¼ã¶ãå½ä»¤ããªãã¨ãä½ãããªãã®ã§ãã
ãã®å®è£ ã ã¨ããããªåé¡ãçºçãã¾ãã
- ã¡ã¼ã«ã表示ããã¾ã§ã«æéãããã
- ä¸è¦§ãåã£ãå¾ã«ã¤ã³ã¿ã¼ãããã®ãªãç°å¢ã«è¡ããããã§ã¡ã¼ã«ãèªããã¨ããã¨èªããªã
ã¨ããããã§ãã¾ã¨ããªå®è£ ã§ã¯ãããªãã¨ããã¾ãã
- éåæã«ã¡ã¼ã«ããã£ãã·ã¥ãã
æ°åã£ã表ç¾ã使ã£ã¦ã¿ã¾ããããéåæã§ãã¼ã«ã«ã«ã¡ã¼ã«ãåã£ã¦ãã(FETCH)ã ãã®ãã¨ã§ãã
IMAP ã®ãããå®è£ (2)
ã¡ã¼ã«ããã¯ã¹ã®å½¢å¼ã«ã¤ãã¦èãã¦ã¿ã¾ããããããã¯ããµã¼ãå´ã«ãã¡ã¼ã«ãªã¼ãå´ã«ãå½ã¦ã¯ã¾ã話ã§ãã
ã¡ã¼ã«ããã¯ã¹ã 1 ãã¡ã¤ã«ãã¤ã¾ããããã¡ã¼ã«ããã¯ã¹ã®ãã¹ã¦ã®ã¡ã¼ã«ã 1 ã¤ã®ãã¡ã¤ã«ã«ç´ãããã¦ããå½¢å¼ã¯ã10å¹´åã«ç ´ç¶»ãã¦ãã¾ããã(mbox å½¢å¼ã®ãã¨ã§ããã)
ããã§å¤ãã®å®è£ ã§ã¯ãã¡ã¼ã«ããã¯ã¹ããã£ã¬ã¯ããªã¨ããã¡ã¼ã«ã1ã¤ã®ãã¡ã¤ã«ã«æ ¼ç´ãã¾ãã(MH å½¢å¼ã Maildir å½¢å¼ã§ãã)
ãã®å½¢å¼ã ã¨ãããã¡ã¼ã«ããã¯ã¹å ã®ã¡ã¼ã«ã®æ°ãå¤ããªãã¨ãã¨ããã«é ããªãã¾ãã(ç°å¢ã«ãããã¾ãããä¸èª¬ã«ã¯3ä¸éããããé¾å¤ã ã¨ã®ãã¨ã§ãã)
ããããIMAP ãæªãã®ã§ã¯ãªããå®è£ ããããã®ã§ãã
ãã¨ãã°ãIMAP ä¸ã§ 6 ã 43218 ã§ç¹å®ãããã¡ã¼ã«ãããã®ã¾ã¾ 6 ã 43218 ã¨ãããã¡ã¤ã«ã«ä¿åããå¿ è¦ã¯ããã¾ãããã¹ã±ã¼ã«ããããªãããã¨ãã° 1000 ããããç®å®ã«ãã¦ã0/6 ã 43/218 ã¨ãããµããã£ãã¯ããªãæ´»ç¨ããå½¢ã«ããã°ããã®ã§ãã