以åãã¡ã¼ã«éä¿¡ï¼SMTPï¼ãµã¼ãã®æ¯ãèããå¶å¾¡ããããã«ãmrubyã§æ©è½æ¡å¼µã§ããpmilterã¨ããMilterãããã³ã«ãã¼ã¹ã®ããã«ã¦ã§ã¢ãä½ãã¾ããã
ãã®æµãã§ãã¡ã¼ã«åä¿¡ï¼POPãIMAPï¼ãµã¼ãã®æ¯ãèããåæ§ã«å¶å¾¡ãããã¨ã«ãã£ã¦ããã¼ã¿ã«ã§ã¡ã¼ã«éåä¿¡ã·ã¹ãã ã®æµéå¶éã ãã§ãªããã¢ã¯ã»ã¹å¶å¾¡ãä¸æ£ãªèªè¨¼ã®æ¤ç¥ãDoSã®ãããªã¢ã¯ã»ã¹ã大éã¡ã¼ã«ã®éåä¿¡ããã¾ãããã°ã©ããã«ãªè¨å®ãæ¸ããã¨ã«ãã£ã¦è§£æ±ºãã¦ããããã¨æãã¯ãããæ¨æ¥ããpmilterã ãã§ãªãã¡ã¼ã«åä¿¡ãµã¼ãã®éçºã«ãåãçµã¿ã¯ããã¾ããã
ãããã®ã¡ã¼ã«ç³»ããã«ã¦ã§ã¢ãçµã¿åããããã¨ã«ãããæ¢ã«ä½¿ããã¦ããã¡ã¼ã«ã®å®çªããã«ã¦ã§ã¢ï¼Postfixãdovecotï¼ã¯ãã®ã¾ã¾ã«ãå¹³æã«å°å ¥ã§ãã¦ãæ§è½ãè½ã¨ããã¨ãªãèªç±ã«Rubyã§æ¡å¼µãã§ããããã«ãªãåºç¤ãä½ãããã¨èãã¦ãã¾ãã
ã¡ã¼ã«ã¯ä½¿ããããªãã¨è¨ãããæ代ã®ä¸ã§ãããã¯ãä»ã§ãã¡ã¼ã«ã§ã®ããåãã¨ããã®ã¯ãªããªãé¿ãããã¨ãã§ããã極端ã«è¨ãã°Web以ä¸ã«ãã¡ã¼ã«ãæ¢ã¾ã£ããã¹ãã ãä¸æ£ã¢ã¯ã»ã¹ããã£ãããIPã¬ãã¥ãã¼ã·ã§ã³ã®åé¡ã§ã¡ã¼ã«ãæ¢ã¾ã£ãæã«ã¯ãã¯ã¬ã¼ã ã«ç¹ãã£ããããµã¼ãã¹ã®å£²ä¸ä½ä¸ãªã©ã«ç¹ãã£ããã¨ãæªã ã«ç¤¾ä¼çã«å½±é¿ã®å¤§ãããããã³ã«ã ã¨è¨ããã§ãããã
ããã§ãããããã¡ã¼ã«åä¿¡ãµã¼ããå¼ããªãã©ã®ããã«ã¦ã§ã¢ããªãã¨æã£ã¦twitterã§è²ã èãã¦ããã¨ãdovecotã§ãããã¨ãã話ã沢山é ããã®ã§ãæ¨æ¥ã¨ä»æ¥ã§dovecot-mruby-pluginã®ãããã¿ã¤ããä½ãã¾ããããããã¿ã¤ãã¨ãã£ã¦ããå ãã¯ãã«ãã·ã¹ãã ã¨ãã¹ãç°å¢ãä½ãã¨ããã«åãããã¦ãä»å¾ã®éçºãããããããã¦ãæ¦ããããã¿ã¤ããåããããªç¶æ ãç®æãã¾ãããå¾ã¯å°éã«å¼ãç¶ãæ©è½éçºããã¦ããäºå®ã§ãã
大ä½READMEã®éãã§ããã以ä¸ã®ããã«ã¾ãã¯MRUBYã³ãã³ããä½ã£ã¦å¼æ°ã®ã³ã¼ããå®è¡ã§ããããã«ãã¾ãããããã¥ã¡ã³ãã¯ã»ã¼ãªãã£ãã®ã§ãdovecotã®å®è£ ãèªã¿ãªããæ¸ãã¦ãã¾ãã
$ telnet 127.0.0.1 6070 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready. 1 login test testPassword 1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE MRUBY] Logged in 1 MRUBY 3*9 #=> 3*9ã¯27ã¨ããçµæãè¿ã£ã¦ãã¦ãã 1 27 (0.001 + 0.000 secs).
å¼ãç¶ãåä¿¡ãµã¼ãã®æ¯ãèããIMAP/POPã®ã»ãã·ã§ã³ã¬ãã«ããå¤å²ã«æ¸¡ã£ã¦mrubyã§å¶å¾¡ã§ããããã«å®è£ ãã¦ãããã¨æãã¾ãã
æçµçã«ã¯dovecot-mruby-pluginã¨pmilterãé£æºããã¦ããã®åºç¤ã®ä¸ã«Rubyã§ã¤ã±ã¦ãæ¯ãèããå®è£ ããã¡ã¼ã«ã·ã¹ãã ãä½ã£ã¦ãã¡ã¼ã«ã®ã·ã¹ãã ã幸ãã«ãªãæ代ãè¦ã¦ã¿ãããã®ã§ãã