Top Banner
Email as a datasource for apps Tony Blank [email protected] @thetonyblank
39

Email As A Datasource

Jul 14, 2015

Download

Technology

Cloud Elements
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Email As A Datasource

Email as a datasource for appsTony Blank [email protected] @thetonyblank

Page 2: Email As A Datasource

“The reports of my death were greatly exaggerated”

- Email

Page 3: Email As A Datasource

3.9 billion in 20134.9 billion by 2017183B messages/day

400M tweets/day

Page 4: Email As A Datasource

Email is a communications system

group collaboration task management document collaboration customer support app notification !

project management client relationship applicant tracking photo sharing bug tracking Nigerian extortion

Page 5: Email As A Datasource

Overview of protocols and standards

or “which acronym does what”

Page 6: Email As A Datasource

SMTPProtocol for transmission of emails across the internet

Page 7: Email As A Datasource

IMAPProtocol to allow a client to access and manipulate emails on a receiving server.

Page 8: Email As A Datasource

• All messages and their folder organization are on the server

• Clients poll to know about new messages that arrive or actions made through other clients

• While it doesn’t send messages, clients usually store sent messages through it

Page 9: Email As A Datasource

POPProtocol to allow a client to retrieve emails from a receiving server.

Page 10: Email As A Datasource

RFC-822 MIME Multipart

Standards defining headers and the actual body of the message

Page 11: Email As A Datasource

Where does your app fit in there?

Page 12: Email As A Datasource

Typical things apps want to do with email

1. Send emails to users

2. Receive emails from users

3. Access emails users send and receive.

Page 13: Email As A Datasource

Email is a communications system

group collaboration task management document collaboration customer support app notification !

project management client relationship applicant tracking photo sharing bug tracking Nigerian extortion

Page 14: Email As A Datasource
Page 15: Email As A Datasource
Page 16: Email As A Datasource
Page 17: Email As A Datasource
Page 18: Email As A Datasource
Page 19: Email As A Datasource
Page 20: Email As A Datasource

Introduction to IMAP

Page 21: Email As A Datasource

Me: “App Developer, meet IMAP. IMAP, meet App Developer.” !

IMAP: “I don’t give a shit about you, App Developer. Go away!”

Page 22: Email As A Datasource

Pitfall #1: Identifying messages

Page 23: Email As A Datasource

Sequence Number

Page 24: Email As A Datasource

Unique Identifier (aka UID)

Page 25: Email As A Datasource

Pitfall #2: No data until you select a mailbox

Page 26: Email As A Datasource

Pitfall #3: Attachments

Page 27: Email As A Datasource

Pitfall #4: Deleting messages

Page 28: Email As A Datasource
Page 29: Email As A Datasource

The joys of parsing email messages

Yo! I fetched a message! Now what do I do?

Page 30: Email As A Datasource

A simple message

Delivered-­‐To:  [email protected]  Return-­‐Path:  <[email protected]>  Received:  by  10.229.135.136  with  SMTP  id  n8mr410292qct.135.1336583200550;                  Wed,  09  May  2012  10:06:40  -­‐0700  (PDT)  Received:  from  smtp-­‐out.amazon.com  (smtp-­‐out.amazon.com.  [72.21.212.39])                  by  mx.google.com  with  ESMTP  id  b2si1383913qcd.195.2012.05.06.40;                  Wed,  09  May  2012  10:06:40  -­‐0700  (PDT)  Date:  Wed,  9  May  2012  17:06:39  +0000  (UTC)  From:  Amazon  EC2  Notification  <no-­‐reply-­‐[email protected]>  To:  "Sys  Admin"  <[email protected]>  Cc:  "Alerts"  <[email protected]>  Message-­‐ID:  <[email protected]­‐1.amazon.com>  Subject:  Notice:  Amazon  EC2  Instance  scheduled  for  retirement  MIME-­‐Version:  1.0  Content-­‐Type:  text/plain;  charset=UTF-­‐8  Content-­‐Transfer-­‐Encoding:  7bit  !Hello,  ...

Page 31: Email As A Datasource

A message with an attachmentMIME-­‐Version:  1.0  Content-­‐Type:  multipart/mixed;  boundary=_MYBOUNDARY_  !-­‐-­‐_MYBOUNDARY_  Content-­‐Type:  text/plain  !This  is  the  body  of  the  message.  -­‐-­‐_MYBOUNDARY_  Content-­‐Type:  image/jpeg;  name="IMG_713.jpg"  Content-­‐Disposition:  attachment;  filename="IMG_713.jpg";  size=6379099;  Content-­‐Transfer-­‐Encoding:  base64  !/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZA+4AJkFkb2JlAGTAAAAAAQMA  AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD8IAEQgAegG1AwERAI  RAQMRAfEASMAAQACAwEBAQEBAAAAAAAAAAAHCAUGCQQDAgEKAQEAAgIDAQAAAAAAAAAAAAAAB  gcFCAEDBAIQAAEEAgEBBgQGAQUAAAAAAAUCAwQGAQcAEjBQERMUFRBgFhcgQHAhNAhBMSIjJDURAAIC==  -­‐-­‐_MYBOUNDARY_-­‐-­‐  

Page 32: Email As A Datasource

A message with alternative parts

MIME-­‐Version:  1.0  Content-­‐Type:  multipart/alternative;  boundary=_MYBOUNDARY_  !-­‐-­‐_MYBOUNDARY_  Content-­‐Type:  text/plain;  charset="us-­‐ascii"  Content-­‐Transfer-­‐Encoding:  quoted-­‐printable  !Hello!  Here’s  a  message  with  *rich*  text  -­‐-­‐_MYBOUNDARY_  Content-­‐Type:  text/html;  charset="us-­‐ascii"  Content-­‐Transfer-­‐Encoding:  quoted-­‐printable  !<html><body>Hello!  Here’s  a  message  with  <b>rich</b>  text</body></html>  -­‐-­‐_MYBOUNDARY_-­‐-­‐  

Page 33: Email As A Datasource

Pitfall #1: Message-ID is optional

Page 34: Email As A Datasource

Pitfall #2: In-Reply-To References

Page 35: Email As A Datasource

Pitfall #3: Attachments are what you

decide them to be

Page 36: Email As A Datasource
Page 37: Email As A Datasource
Page 38: Email As A Datasource

contacts

filesmessages

threads

webhooks

Page 39: Email As A Datasource

Email as a datasource for appsTony Blank [email protected] @thetonyblank