Comments (6)
Perhaps of interest
https://github.com/mewa/s3abird
from 0x4447_product_s3_email.
O wow, a long time has passed. I won't have time to update the CFN to support the latest language, maybe some day but not now. And regarding access, check this section: https://github.com/0x4447/0x4447_product_s3_email#manual-work there is some manual work that you have to do to make it work.
from 0x4447_product_s3_email.
Oh, didn't notice this repo was dead for 2 years before the last commit... Seemed like it was the solution to create custom emails without paying heftier prices over at Gmail.
from 0x4447_product_s3_email.
After messing with this for a bit i realized it was pretty straight forward to setup aws simple email service. Was just a couple clicks to setup the identity and dns and then set a default rule that forwards everything to an S3 bucket. I wrote a simple boto3 python script to send mail but havent tested it yet. Was waiting for my limit approval which has now come through so maybe will test it soon. I'll post it once ive tested it.
from 0x4447_product_s3_email.
Yes I also managed that, but the problem comes after that. Viewing your emails from That S3 bucket
from 0x4447_product_s3_email.
So i have built and tested a solution for that. I have a javascript front end that hits an API gateway endpoint. The Api Gateway has a lambda proxy that triggers a lambda function to read the bucket. I need a better email formatter but its functional.
Lambda (Python)
import json
import boto3
s3 = boto3.client('s3')
def lambda_handler(event, context):
get_last_modified = lambda obj: int(obj['LastModified'].strftime('%s'))
Bucket = '<bucketname>'
objs = s3.list_objects_v2(Bucket=Bucket)['Contents']
emailid = int(event['queryStringParameters']['emailid'])
last_added = [obj['Key'] for obj in sorted(objs, key=get_last_modified, reverse=True)][emailid]
print(last_added)
data = s3.get_object(Bucket=Bucket, Key=last_added)
contents = data['Body'].read()
return { 'statusCode': 200, 'body': json.dumps(contents.decode("utf-8")), 'headers': {'Content-Type': 'application/json','Access-Control-Allow-Origin': '*','Access-Control-Allow-Methods':'*'}}
Javascript website (S3 static hosted website)
<html>
<head>
<title>
</title>
</head>
<script>
function GetEmail()
{
let url = "<api gateway url>?emailid=0"
var request = new XMLHttpRequest()
request.open('GET', url, true)
request.onload = function()
{
var data = this.response
if(request.status >= 200 && request.status < 400)
{
document.getElementById('EmailTxtArea').innerHTML = data
}
else
{
console.log("error")
}
}
request.send()
}
</script>
<body>
<input type="button" onclick=GetEmail() value="Get Email">
<br>
<div id=email></div>
<br>
<input type=text id=Email style='width: 800px; visibility: hidden;'>
<br>
<textarea id="EmailTxtArea" rows="4" cols="50">
</textarea>
</body>
</html>
from 0x4447_product_s3_email.
Related Issues (20)
- Increase memory for all Lambdas
- New feature: Switch from GitHub pulling to GitHub Webhooks
- Webhook could not be registered with GitHub. HOT 18
- New feature: add support for Intelligent-Tiering
- nodejs8.10 is no longer supported HOT 1
- Template format error HOT 2
- Webhook don't work as expected
- New feature: IMAP like WorkMail? HOT 3
- Question regarding spam HOT 2
- New feature: Rate limiting/Error handling HOT 3
- New feature: Programmatic addresses HOT 3
- Emails in which one is CCed/BCCed get treated as 'Sent'. HOT 19
- New feature: aws cdk HOT 1
- New feature: attachment for sent email HOT 2
- Template format error: Unrecognized resource types: [AWS::SES::ReceiptRule, AWS::SES::ReceiptRuleSet] HOT 3
- [BUG] Deploy Failed (Bucket already exists) HOT 4
- New feature: Deny list HOT 2
- .
- Where's the source code? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 0x4447_product_s3_email.