Skip to content

Commit 7d69e72

Browse files
committed
unfinished
1 parent 19e72c7 commit 7d69e72

File tree

8 files changed

+465
-68
lines changed

8 files changed

+465
-68
lines changed

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Email Spam Filter Environment Variables
2+
# Copy this file to .env.local and fill in your actual values
3+
# DO NOT commit the actual .env.local file to git
4+
5+
# Sender information for auto-reply emails
6+
SENDER_NAME=Your Organization Name
7+
SENDER_EMAIL=[email protected]
8+
9+
# Email address to use for replies
10+
REPLY_EMAIL=[email protected]
11+
12+
# Email address to forward messages to
13+
FORWARD_EMAIL=[email protected]
14+
15+
# Organization name used in email messages
16+
ORGANIZATION_NAME=Your Organization
17+
18+
# Website URL referenced in email messages
19+
WEBSITE_URL=https://yourdomain.com

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
jobs:
10+
deploy:
11+
name: Deploy
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 'lts/*'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Deploy to Cloudflare Workers
29+
uses: cloudflare/wrangler-action@v3
30+
with:
31+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
32+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
33+
command: deploy

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Email Spam Filter
2+
3+
A Cloudflare Worker for handling email auto-replies and forwarding.
4+
5+
## Features
6+
7+
- Auto-replies to incoming emails
8+
- Forwards emails with subjects to a specified address
9+
- Customizable sender information and message content
10+
11+
## Setup
12+
13+
### Environment Variables
14+
15+
This project uses environment variables to configure sender information, email addresses, and message content. This allows you to customize the behavior for different environments without committing sensitive information to git.
16+
17+
#### Required Environment Variables
18+
19+
Copy `.env.example` to `.env.local` and fill in your actual values:
20+
21+
```bash
22+
cp .env.example .env.local
23+
```
24+
25+
Then edit `.env.local` with your values:
26+
27+
- `SENDER_NAME`: Name displayed as the sender of auto-reply emails
28+
- `SENDER_EMAIL`: Email address used as the sender
29+
- `REPLY_EMAIL`: Email address used for replies (usually same as SENDER_EMAIL)
30+
- `FORWARD_EMAIL`: Email address where messages should be forwarded
31+
- `ORGANIZATION_NAME`: Organization name used in email message content
32+
- `WEBSITE_URL`: Website URL referenced in email messages
33+
34+
#### Setting Environment Variables in Cloudflare
35+
36+
For production deployment, set these environment variables in your Cloudflare Worker:
37+
38+
```bash
39+
wrangler secret put SENDER_NAME
40+
wrangler secret put SENDER_EMAIL
41+
wrangler secret put REPLY_EMAIL
42+
wrangler secret put FORWARD_EMAIL
43+
wrangler secret put ORGANIZATION_NAME
44+
wrangler secret put WEBSITE_URL
45+
```
46+
47+
### Development
48+
49+
1. Install dependencies:
50+
51+
```bash
52+
npm install
53+
```
54+
55+
2. Set up environment variables (see above)
56+
57+
3. Run locally:
58+
59+
```bash
60+
wrangler dev
61+
```
62+
63+
### Deployment
64+
65+
```bash
66+
wrangler deploy
67+
```

0 commit comments

Comments
 (0)