diff --git a/README.md b/README.md index 2d4b304..4a45075 100644 --- a/README.md +++ b/README.md @@ -17,34 +17,29 @@ This is a simple PHP webhook endpoint designed to receive incoming emails from [ ## πŸ“ Folder Structure -data/ - -└── emails/ - -└── example.com/ - -└── alice/ - -β”œβ”€β”€ 65ef123e4c1a0.eml - -β”œβ”€β”€ index.php # optional - -└── index.sh # optional +data/ +└── emails/ +└── example.com/ +└── alice/ +β”œβ”€β”€ 65ef123e4c1a0.eml +β”œβ”€β”€ index.php # optional +└── index.sh # optional --- ## βš™οΈ Installation 1. Clone this repository: - ```bash +```bash git clone https://github.com/yourusername/email-webhook-receiver.git cd email-webhook-receiver +``` 2. Make sure data/emails/ is writable by your web server: - +```bash mkdir -p 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. @@ -53,13 +48,13 @@ chmod -R 775 data/emails πŸ“¨ Using with ForwardEmail.net In your ForwardEmail account settings, set the Webhook URL to this script: - +``` https://yourdomain.com/path/to/index.php - +``` Make sure your server is publicly accessible and uses HTTPS. ForwardEmail will send JSON payloads like: - +```json { "raw": "Full raw email as string...", "from": { @@ -70,16 +65,16 @@ ForwardEmail will send JSON payloads like: ] } } - +``` βΈ» πŸ§ͺ Local CLI Testing You can test the webhook manually via CLI: - +```bash php index.php < sample.json - +``` Where sample.json contains a raw test email in JSON format. βΈ»