improved readibility

This commit is contained in:
git 2025-06-17 14:25:02 +01:00
parent bb35d5691c
commit 401c7a2bbc

View File

@ -17,34 +17,29 @@ This is a simple PHP webhook endpoint designed to receive incoming emails from [
## 📁 Folder Structure ## 📁 Folder Structure
data/ data/
└── emails/
└── emails/ └── example.com/
└── alice/
└── example.com/ ├── 65ef123e4c1a0.eml
├── index.php # optional
└── alice/ └── index.sh # optional
├── 65ef123e4c1a0.eml
├── index.php # optional
└── index.sh # optional
--- ---
## ⚙️ Installation ## ⚙️ Installation
1. Clone this repository: 1. Clone this repository:
```bash ```bash
git clone https://github.com/yourusername/email-webhook-receiver.git git clone https://github.com/yourusername/email-webhook-receiver.git
cd email-webhook-receiver cd email-webhook-receiver
```
2. Make sure data/emails/ is writable by your web server: 2. Make sure data/emails/ is writable by your web server:
```bash
mkdir -p data/emails mkdir -p data/emails
chmod -R 775 data/emails chmod -R 775 data/emails
```
3. Configure your web server (e.g., Apache or Nginx + PHP) to POST email data to this script. 3. Configure your web server (e.g., Apache or Nginx + PHP) to POST email data to this script.
@ -53,13 +48,13 @@ chmod -R 775 data/emails
📨 Using with ForwardEmail.net 📨 Using with ForwardEmail.net
In your ForwardEmail account settings, set the Webhook URL to this script: In your ForwardEmail account settings, set the Webhook URL to this script:
```
https://yourdomain.com/path/to/index.php https://yourdomain.com/path/to/index.php
```
Make sure your server is publicly accessible and uses HTTPS. Make sure your server is publicly accessible and uses HTTPS.
ForwardEmail will send JSON payloads like: ForwardEmail will send JSON payloads like:
```json
{ {
"raw": "Full raw email as string...", "raw": "Full raw email as string...",
"from": { "from": {
@ -70,16 +65,16 @@ ForwardEmail will send JSON payloads like:
] ]
} }
} }
```
🧪 Local CLI Testing 🧪 Local CLI Testing
You can test the webhook manually via CLI: You can test the webhook manually via CLI:
```bash
php index.php < sample.json php index.php < sample.json
```
Where sample.json contains a raw test email in JSON format. Where sample.json contains a raw test email in JSON format.