This is a submission for the Postmark Challenge: Inbox Innovators.
What I Built
Teachers, freelancers, and inbox zero purists rejoice: I built EmailDrop, a one-click AWS deployment that turns incoming emails into automatic Google Drive uploads. With Postmark’s new inbound webhooks, AWS Lambda, and a little OAuth wizardry, attachments fly straight from your inbox to your Google Drive. In this post, I’ll walk through how I built it using Postmark, CloudFormation, Google Drive, and serverless tools, and how you can deploy it with zero manual code.
Why use EmailDrop?
- Deploys with a single click, no coding required (see the demo below and deploy in minutes!)
- Have your students submit their homework direct to your Google Drive, and without having to give out your real email address
- Process documents from coworkers, employees, or customers without having to manually download attachments and upload them for editing and storage
- Set up a photo folder for special events like weddings, birthdays, and more!
Demo
EmailDrop is a CloudFormation stack with some Python code that will simplify your email inbox. First, however, we need to gather some information from Google. Then, we’ll click a Launch Stack button that will deploy all of the infrastructure- no coding required. Then we’ll configure Postmark and wrap up. Let’s go!
Go to Google Cloud Console
Create a Project
- Click the project dropdown → New Project
- Name it (e.g., PostmarkUploader)
- Click Create
Enable the Google Drive API
- Go to APIs & Services → Library
- Search for Google Drive API
- Click Enable
Configure the OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Choose External
- Fill in:
- App name
- Support email
- Developer contact email (these can all be your personal email)
- Add yourself as a test user using the Audience page on the sidebar
- Click Save and Continue
Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Choose Web application
- Skip the redirect URI for now — you’ll add it after deploying the stack
- Click Create
- Save the Client ID and Client Secret
Deploy the CloudFormation Stack
- Click the “Launch Stack” button above!
- Name the stack anything you wish.
- Fill in the parameters:
- GoogleClientId: (from step 5)
- GoogleClientSecret: (from step 5)
- GoogleDriveFolder: (optional) Name of the folder to store attachments
- LambdaTimeout: (optional) Default is 60 seconds. Increase for large attachments (up to 900s)
– Agree to let AWS create new IAM resources and click `Create Stack’. EmailDrop will take several minutes to deploy.
Add the Redirect URI
- Once the stack is deployed, go to the Outputs tab in CloudFormation
- Copy the OAuthURL output
- Return to Google Cloud Console → Clients
- Click on your OAuth 2.0 client
- Edit the Authorized redirect URIs
- Paste in the URL you copied from the stack output
- Save changes
- In the stack outputs, find the OAuthURL
- Open it in your browser
- Click the link to begin the authentication flow, as shown above.
- You will get a warning that Google has not verified this application. Click ‘Continue’
- Approve access to Google Drive
- The Lambda will exchange the code for tokens and store them
- You can now close this page, authentication is finished!
Create a Postmark Account
- Sign up at postmarkapp.com
- Create a new server (or use an existing one)
Set Up Inbound Email Processing
– In your Postmark dashboard, navigate to Servers → Your Server Name → Default Inbound Stream
– Navigate to Setup Instructions
– Note your unique inbound email address
Configure Webhook URL
– From the Settings page, find the Webhook URL field
– In the CloudFormation stack outputs, find the PostmarkWebhookURL value
– Copy this URL and paste it into the Postmark Webhook URL field
– Check the box that will send the JSON payload to your Lambda function. EmailDrop parses this JSON to extract the attachments.
– Save your changes
Test the Integration
– Send an email with attachments to your Postmark inbound email address
– The attachments should be automatically uploaded to your Google Drive folder
– Check the Lambda logs in CloudWatch if you encounter any issues
Code Repository

kevinl95
/
EmailDrop
Automatically upload attachments to emails sent to your Postmark inbound email address to Google Drive
EmailDrop: Postmark to Google Drive Attachment Uploader
This application automatically uploads email attachments from Postmark to Google Drive. When emails are sent to your Postmark inbound email address, any attachments are automatically saved to your specified Google Drive folder. The system uses AWS Lambda, API Gateway, and Secrets Manager to handle the OAuth flow and file uploads.
Architecture
- Postmark: Receives emails and sends attachment data via webhooks
- API Gateway: Provides endpoints for OAuth callback and Postmark webhook
- Lambda Functions: Handle OAuth flow and attachment uploads
- Secrets Manager: Securely stores OAuth refresh tokens
- Google Drive API: Destination for email attachments
Setup Instructions
1. Google Drive API Setup
1.1 Go to Google Cloud Console
1.2 Create a Project
- Click the project dropdown → New Project
- Name it (e.g., PostmarkUploader)
- Click Create
1.3 Enable the Google Drive API
- Go to APIs & Services → Library
- Search…
How I Built It
This project started as a simple idea: I wanted to extract attachments from emails and send them to Google Drive automatically. Drive does not offer this feature natively. Postmark’s Inbound Webhooks made that possible with a clean, reliable way to receive structured email data, including base64-encoded attachments, via a JSON payload.
I used AWS CloudFormation to make the whole serverless solution deployable in one click. The stack provisions:
- An OAuth token exchange Lambda: Handles the OAuth 2.0 flow with Google, exchanging an authorization code for tokens. It outputs a working Google OAuth link via CloudFormation so users can grant access easily.
- An upload Lambda: Triggered by Postmark’s inbound webhook. It decodes the attachments and uploads them to the authenticated user’s Google Drive using the Drive API.
- An API Gateway: Routes the Google OAuth redirect to the token exchange Lambda function.
Here’s how it works:
To keep things simple, I made sure the user experience didn’t require running any local code or setting up servers. Once the stack is deployed, the user just needs to:
- Set up a Google Cloud project.
- Deploy the CloudFormation template with their OAuth credentials.
- Complete the auth flow by visiting a link output by the stack.
- Configure Postmark to send inbound emails as a JSON payload to the webhook.
All credentials and logic are encapsulated in AWS Lambda functions using Python 3 and the standard library, keeping dependencies minimal. Tokens are stored in Amazon’s Key Management Service, which lets EmailDrop securely manage all information needed to authenticate with the Google Drive API.
My experience with Postmark was great, the inbound webhook fature is fast and extremely easy to consume. Having the full email (plus parsed fields and attachments) delivered via HTTP was a huge time-saver compared to working directly with IMAP or polling APIs. Being able to extract content from emails in a structured way will make a number of projects and tools much easier to build, and I look forward to using Postmark’s inbound features again!