FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

themadorg/madexchanger-php: Pull-based HTTP email relay for Madmail (PHP version) · GitHub

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Madexchanger-PHP

A raw PHP implementation of madexchanger for shared hosting environments.

Features

  • Push-based: Immediately forwards received messages.
  • Dynamic Routing: Parses X-Mail-To to find recipient domains and tries delivery.
  • HTTPS/HTTP Fallback: Matches the Go version's delivery logic.
  • Shared Hosting Compatible: Works with standard mod_php or php-fpm and curl.

Deployment

  1. Upload all files to your shared hosting's document root (e.g., public_html/).
  2. Ensure the web server has write access to create madexchanger.log.
  3. Configure settings in config.php:
    • Set relay_mode to 'open' (default) or 'selected'.
    • Optionally set downstream_url to chain with another exchanger.

Routing

The application is configured to handle:

  • POST /mxdeliv: Receives and forwards email.
  • GET /health: Basic health check returning JSON.

On Apache servers, the provided .htaccess will route /mxdeliv automatically. On Nginx, you should add:

location /mxdeliv {
    try_files $uri /index.php;
}

Local Testing (Docker)

You can test the implementation locally using the official PHP Apache image:

# Start the container
docker run -d --name madexchanger-test -p 8081:80 -v $(pwd):/var/www/html php:8.2-apache

# Enable Apache rewrite module (required for .htaccess)
docker exec madexchanger-test a2enmod rewrite
docker restart madexchanger-test

The website will be available at http://localhost:8081. The mail relay endpoint will be available at POST http://localhost:8081/mxdeliv.

Security Note

This raw version does not yet include the admin API or dashboard. It is designed for simple, push-based relaying on restricted shared hosting environments where Go binaries cannot be executed.

About

Pull-based HTTP email relay for Madmail (PHP version)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL