JSONでメール送信 | HTTP API Server ``Haineko''/YAPC::Asia Tokyo 2013 LT Day2
Upcoming SlideShare
Loading in...5
×
 

JSONでメール送信 | HTTP API Server ``Haineko''/YAPC::Asia Tokyo 2013 LT Day2

on

  • 1,018 views

YAPC::Asia Tokyo 2013 LT Day2で発表したHainekoの概略

YAPC::Asia Tokyo 2013 LT Day2で発表したHainekoの概略

Statistics

Views

Total Views
1,018
Views on SlideShare
743
Embed Views
275

Actions

Likes
1
Downloads
1
Comments
0

7 Embeds 275

http://blog.azumakuniyuki.org 216
http://yapcasia.org 28
http://6524917768642753285_fe686e34887422e5d28380b1a44d3b40d751e84e.blogspot.com 12
http://127.0.0.1 12
http://cloud.feedly.com 3
http://www.feedspot.com 3
https://twitter.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

JSONでメール送信 | HTTP API Server ``Haineko''/YAPC::Asia Tokyo 2013 LT Day2 JSONでメール送信 | HTTP API Server ``Haineko''/YAPC::Asia Tokyo 2013 LT Day2 Presentation Transcript

  • JSONでメール送信 @azumakuniyuki Cubicroot Co. Ltd. YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) HTTP API Server ``Haineko'' Sending email in JSON via HTTP
  • @azumakuniyuki - あずま(猫)@京都 - サーバ管理者(*BSD,Linux) - プログラマ(Perl,C,R,/bin/sh) - Azuma, Kuniyuki - From Kyoto, Japan. - Server Administrator(*BSD,Linux) - Programmer(Perl,C,R,/bin/sh) YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 2
  • 作ったもの Modules - bounceHammer - バウンスメール解析する / bounce mail parser - YAML/JSONで出る / Output in JSON, YAML - http://bouncehammer.jp/ - Acme::Nyaa - 初CPANモジュール/猫系 - 神と和解せよ => ネコと和解せよ - 祇園祭です => 祇園祭ですニャー - Convert text like which a cat is talking - in Japanese YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 3
  • JSONでメール送信 Sending email in JSON via HTTP HTTP API Server ``Haineko'' YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 4
  • Haineko``はいねこ'' /haineko/ YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 5
  • - リレーサーバ(JSON/HTTPでの入出力) - 別のSMTPサーバにメールをリレー - is a relay server for sending email - receives an email in JSON via HTTP - relays an email to external SMTP host - responds in JSON - is a PSGI application Haineko ? YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 6
  • HTTP API INTO ESMTP K=undef O=undef YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 7
  • Architecture Hainekoの処理の流れ、全体図と部分図。 YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 8
  • Haineko Flow Haineko HTTP Request HTTP Request ESMTP Relay Email Cloud SendGrid AmazonSES Postmark(まだ) MailChimp(まだ) HTTP Listen on 2794 HTTP Response ESMTP Response HTTP Response POST HTTP CLIENT Browser / wget / curl to JSON Any SMTP Server smtp.example.jp:25 tls.example.com:465 smtp.gmail.com:587 Another Haineko Server SMTP HTTP / HTTPS SMTP-AUTH STARTTLS PIPELINING JSON JSON YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 9
  • Sending & Reply メール送信とJSONでの応答 YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 10
  • $ git clone https://github.com/azumakuniyuki/ Haineko.git ... $ cd ./Haineko $ plackup -I./lib -p 2794 -a libexec/haineko.psgi HTTP::Server::PSGI: Accepting connections at http://0:2794/ Start Haineko YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 11
  • $ curl 'http://127.0.0.1:2794/submit' -X POST -H 'Content-Type: application/json' -d '{ ehlo: "ホスト名", mail: "neko@example.jp", rcpt: [ "kijitora@example.org", "mikeneko@example.com" ], body: "ネコと和解せよ", header: { subject: "ニャー!!", … } }' HTTP POST YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 12
  • { "smtp.queueid":"r6DCXsV00649aTl2", "smtp.response": { "dsn": "2.0.0", "error": 0, "message":[ "Accept for delivery" ], "command": "QUIT", "code": "221" }, "smtp.useragent": "ユーザエージェント(USER_AGENT)", "smtp.recipient": [ "kijitora@example.jp"], "smtp.addresser": "NNN@example.org", "smtp.remotehost": "127.0.0.1", "smtp.remoteport":49989 } 200 OK YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 13
  • { "smtp.queueid":"r6DCXsV00649aTl2", "smtp.response": { "dsn": "5.7.1", "error":1, "message":[ "Recipient address not permitted" ], "command": "RCPT", "code": "533" }, "smtp.useragent": "ユーザエージェント(USER_AGENT)", "smtp.recipient": [ "kijitora@example.gov"], "smtp.addresser": "NNN@example.org", "smtp.remotehost": "127.0.0.1", "smtp.remoteport":49989 } 5xx OR 4xx YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 14
  • Repository github.com/azumakuniyuki/Haineko YAPC::Asia Tokyo 2013 LT Day 2 2013/09/21(土) ``Haineko'' @azumakuniyuki / Cubicroot Co. Ltd. 15
  • 終 16