-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for Cloudmailin URL attachments, closes #11
- Loading branch information
James McKinney
committed
Sep 7, 2013
1 parent
6a87f2e
commit e0fe9cc
Showing
6 changed files
with
290 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
HTTP/1.1 200 OK | ||
Content-Length: 3798 | ||
Content-Type: application/json | ||
X-Request-Start: 1378523197697 | ||
X-Forwarded-Proto: http | ||
X-Forwarded-Port: 80 | ||
X-Forwarded-For: 174.129.35.193 | ||
User-Agent: CloudMailin Server | ||
Host: rackbin.herokuapp.com | ||
Connection: close | ||
Version: HTTP/1.1 | ||
|
||
{ | ||
"headers": { | ||
"Return-Path": "james@opennorth.ca", | ||
"Received": [ | ||
"by mail-qc0-f177.google.com with SMTP id x12so1548824qcv.36 for <5dae6f85cd65d30d384a@cloudmailin.net>; Fri, 06 Sep 2013 20:06:37 -0700", | ||
"from [192.168.2.20] ([70.49.74.123]) by mx.google.com with ESMTPSA id fy7sm2646347qeb.1.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 20:06:36 -0700" | ||
], | ||
"Date": "Mon, 15 Apr 2013 20:20:12 -0400", | ||
"From": "James McKinney <james@opennorth.ca>", | ||
"To": "5dae6f85cd65d30d384a@cloudmailin.net", | ||
"Message-ID": "<D3F16515-ED8C-4DEC-80EA-553B7266FD4C@opennorth.ca>", | ||
"Subject": "Test", | ||
"Mime-Version": "1.0", | ||
"Content-Type": "multipart/alternative; boundary=\"Apple-Mail=_58AF8BB6-04D5-4B22-95D5-BFFB183CB821\"; charset=UTF-8", | ||
"Content-Transfer-Encoding": "7bit", | ||
"X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:subject:date:message-id:to :mime-version; bh=XFFIu2nTnDfhViW8rylqgBXliiVE9n99uIZDjHX7vN8=; b=BtYVZz6pmZ6P7A4lqf64efvrOa4WSGa5UHybTnd7IG3dwneGEnz4QaH/nCdzBrzdKT 8ukGjPp+b3mx3S8TrXrX98/9c6Q1mVgFMBwYtL7NNnfoLmAEvgB9tgitPHgb6/q/N2bm oJNV7XQ9P07Snfq1NJcNNOk8FiJVYdYerUceMN6A8nIXnyhfWGOse+TGLQVMpxJ4yT74 gOadKvaQpumsjZmPpyTViv7rTGXSkTsmxleb0gAJxabFrUFDcp0kptY8pHEwek7Qi+/j 1h3HmTh3F9WmC0/EJbKyEXQTbujtDzsAzWBmov4uwh2885bgWwUzXDJc+JrsI0qX0TQw IrNQ==", | ||
"X-Gm-Message-State": "ALoCoQkL/+YuGYWfMRnoFzhV8wFry1fgjjK7/X7lmXUXSXYJcQL91b9WlM0+gLt+zU2m2yKg/Io2", | ||
"X-Received": "by 10.224.172.131 with SMTP id l3mr7166098qaz.35.1378523197028; Fri, 06 Sep 2013 20:06:37 -0700 (PDT)", | ||
"X-Mailer": "Apple Mail (2.1283)" | ||
}, | ||
"envelope": { | ||
"to": "5dae6f85cd65d30d384a@cloudmailin.net", | ||
"recipients": [ | ||
"5dae6f85cd65d30d384a@cloudmailin.net" | ||
], | ||
"from": "james@opennorth.ca", | ||
"helo_domain": "mail-qc0-f177.google.com", | ||
"remote_ip": "209.85.216.177", | ||
"spf": { | ||
"result": "pass", | ||
"domain": "opennorth.ca" | ||
} | ||
}, | ||
"plain": "bold text\n\n\n\nsome more bold text\n\n\n\nsome italic text\n\n> multiline\n> quoted\n> text\n\n\n--\nSignature block", | ||
"html": "<html><head></head><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; \"><b>bold text</b><div><br></div><div></div></body></html><html><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; \"><head></head><br><div></div><div><br></div><div><b>some more bold text</b></div><div><b><br></b></div><div><b></b></div></body></html><html><head></head><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; \"><br><div><b></b></div><div><b><span class=\"Apple-style-span\" style=\"font-weight: normal; \"><br></span></b></div><div><b><span class=\"Apple-style-span\" style=\"font-weight: normal; \"><i>some italic text</i></span></b></div><div><b><span class=\"Apple-style-span\" style=\"font-weight: normal; \"><br></span></b></div><div><blockquote type=\"cite\">multiline</blockquote><blockquote type=\"cite\">quoted</blockquote><blockquote type=\"cite\">text</blockquote></div><div><br></div><div>--</div><div>Signature block</div></body></html>", | ||
"reply_plain": "bold text\n\n\n\nsome more bold text\n\n\n\nsome italic text\n", | ||
"attachments": [ | ||
{ | ||
"file_name": "foo.txt", | ||
"content_type": "text/plain", | ||
"size": "57", | ||
"disposition": "attachment", | ||
"url": "http://multi-mail.s3.amazonaws.com/5e2dd992326d08ac5c72.txt" | ||
}, | ||
{ | ||
"file_name": "bar.txt", | ||
"content_type": "text/plain", | ||
"size": "38", | ||
"disposition": "attachment", | ||
"url": "http://multi-mail.s3.amazonaws.com/b296959bbe7889c172c8.txt" | ||
} | ||
] | ||
} |
174 changes: 174 additions & 0 deletions
174
spec/fixtures/cloudmailin/multipart/attachment_store.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
HTTP/1.1 200 OK | ||
Content-Length: 5886 | ||
Content-Type: multipart/form-data; boundary=----cloudmailinboundry | ||
X-Request-Start: 1378525227186 | ||
X-Forwarded-Proto: http | ||
X-Forwarded-Port: 80 | ||
X-Forwarded-For: 109.107.35.53 | ||
User-Agent: CloudMailin Server | ||
Host: rackbin.herokuapp.com | ||
Connection: close | ||
Version: HTTP/1.1 | ||
|
||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="plain" | ||
|
||
bold text | ||
|
||
|
||
|
||
some more bold text | ||
|
||
|
||
|
||
some italic text | ||
|
||
> multiline | ||
> quoted | ||
> text | ||
|
||
|
||
-- | ||
Signature block | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="html" | ||
|
||
<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b>bold text</b><div><br></div><div></div></body></html><html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><head></head><br><div></div><div><br></div><div><b>some more bold text</b></div><div><b><br></b></div><div><b></b></div></body></html><html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><b></b></div><div><b><span class="Apple-style-span" style="font-weight: normal; "><br></span></b></div><div><b><span class="Apple-style-span" style="font-weight: normal; "><i>some italic text</i></span></b></div><div><b><span class="Apple-style-span" style="font-weight: normal; "><br></span></b></div><div><blockquote type="cite">multiline</blockquote><blockquote type="cite">quoted</blockquote><blockquote type="cite">text</blockquote></div><div><br></div><div>--</div><div>Signature block</div></body></html> | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="reply_plain" | ||
|
||
bold text | ||
|
||
|
||
|
||
some more bold text | ||
|
||
|
||
|
||
some italic text | ||
|
||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Return-Path]" | ||
|
||
james@opennorth.ca | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Received][0]" | ||
|
||
by mail-qc0-f175.google.com with SMTP id v2so2167362qcr.34 for <5dae6f85cd65d30d384a@cloudmailin.net>; Fri, 06 Sep 2013 20:40:24 -0700 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Received][1]" | ||
|
||
from [192.168.2.20] ([70.49.74.123]) by mx.google.com with ESMTPSA id u9sm2845233qar.4.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 20:40:23 -0700 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Date]" | ||
|
||
Mon, 15 Apr 2013 20:20:12 -0400 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[From]" | ||
|
||
James McKinney <james@opennorth.ca> | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[To]" | ||
|
||
5dae6f85cd65d30d384a@cloudmailin.net | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Message-ID]" | ||
|
||
<6021B546-125D-45E4-8619-7D1EC6529E3F@opennorth.ca> | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Subject]" | ||
|
||
Test | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Mime-Version]" | ||
|
||
1.0 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[Content-Transfer-Encoding]" | ||
|
||
7bit | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[X-Google-DKIM-Signature]" | ||
|
||
v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:subject:date:message-id:to :mime-version; bh=7QXxeoo2eFC71SO2+2Aan6OBpxRp1CgvZJtniYo2Vfs=; b=hUEOWvxIUI4/bEhDZJfcgaxEixsboqL/ffXpWQwiy9lLNvsNiDJjtUzQ8fZbaAptkf DMzHDJcXyWtJP/FvCIbq5pnxpmzCDbua3FEx0oA8OxgbBjraStm6Qri781LxJZJMC+jA C6g0D6wMFSwLv4L+nWywOXnfM4d5oEb4mMJHbUSh8zx8SHHehMBDUW++rRZTUL9ful88 0sLNKvIBJD3+plw9sLtYwW6PfTRr9X4YwFr0e9RHqyOlC0dmoNcbGyuuynM86D9BIi2p yK4YL9Y0+8ZL+zg/XrtxJlQb+XSo6x+GmEsaCRaXgSdVvmFdMsIndL/iqQH9B3LiDjYy 87iw== | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[X-Gm-Message-State]" | ||
|
||
ALoCoQkbW3nfV+/NutlB/vrs+q4iTk6ADjnuiL05fzCXtJOgp1dHetP+C2v68SEz1jqqJUD5tVGy | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[X-Received]" | ||
|
||
by 10.49.116.4 with SMTP id js4mr6948310qeb.14.1378525224314; Fri, 06 Sep 2013 20:40:24 -0700 (PDT) | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="headers[X-Mailer]" | ||
|
||
Apple Mail (2.1283) | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[to]" | ||
|
||
5dae6f85cd65d30d384a@cloudmailin.net | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[recipients][0]" | ||
|
||
5dae6f85cd65d30d384a@cloudmailin.net | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[from]" | ||
|
||
james@opennorth.ca | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[helo_domain]" | ||
|
||
mail-qc0-f175.google.com | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[remote_ip]" | ||
|
||
209.85.216.175 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[spf][result]" | ||
|
||
pass | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="envelope[spf][domain]" | ||
|
||
opennorth.ca | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[0][file_name]" | ||
|
||
foo.txt | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[0][content_type]" | ||
|
||
text/plain | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[0][size]" | ||
|
||
57 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[0][disposition]" | ||
|
||
attachment | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[0][url]" | ||
|
||
http://multi-mail.s3.amazonaws.com/77a3b3e1ca79c38dbba8.txt | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[1][file_name]" | ||
|
||
bar.txt | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[1][content_type]" | ||
|
||
text/plain | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[1][size]" | ||
|
||
38 | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[1][disposition]" | ||
|
||
attachment | ||
------cloudmailinboundry | ||
Content-Disposition: form-data; name="attachments[1][url]" | ||
|
||
http://multi-mail.s3.amazonaws.com/40078e93b6340a97ac6c.txt | ||
------cloudmailinboundry-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters