Dev.to par post karne ke liye Markdown format sab se behtareen hai. Ye rahi ek professional aur "viral-ready" post jo aapke GMTP protocol ki technical brilliance ko highlight karegi.
Aap isay copy karke Dev.to ke editor mein paste kar sakte hain:
Why I Built My Own Mail Protocol (GMTP) to Bypass SMTP Restrictions π
1. What exactly is GMTP?
GMTP is an HTTP-based communication protocol designed as a modern, developer-friendly alternative to SMTP. Itβs written entirely in PHP and focuses on simplicity and security without needing complex DNS or MX record configurations.
The Problem it Solves:
- Port Blocking: Works over standard HTTP/HTTPS (Port 80/443), which is almost never blocked.
- Complex Setup: No need for postfix, exim, or complicated server-side mail agents.
- Security Gaps: Uses custom encryption layers to protect the payload.
2. The Tech Stack & Architecture
I built this using a "Zero-Dependency" mindset. If you have a standard web server with PHP and MySQL, you can run GMTP.
- Transport: PHP cURL (Handles the "Push" of data between servers).
- Backend: MySQLi (For message routing and storage).
- Security: RSA Encryption (Public/Private Key Pair).
How the RSA Logic Works:
When the system is installed, it dynamically generates a unique RSA key pair.
- The Public Key is used by the sender to encrypt the email content.
- The Private Key stays on the receiver's server and is the only thing that can unlock the message. This ensures that even if someone intercepts the HTTP request, they only see encrypted "garbage" data.
3. Project Structure
The library is organized to be lightweight and modular:
ghalib-mail/
βββ index.php # Main Router
βββ lib/
β βββ generate_keys.php # RSA Key Generator
β βββ helpers.php # Encryption/Decryption logic
β βββ install.php # One-click installation
βββ routes/
β βββ receive.php # The Listening Endpoint
β βββ send.php # The Transmission Engine
βββ database/
βββ schema.sql # Database Structure
4. Why Open Source?
I believe that the best way to improve a protocol is through community feedback. Whether you are a PHP veteran or an Infosec enthusiast, Iβd love for you to check out my RSA implementation and the cURL handshake logic.
π Key Features:
- No DNS Configuration: Just upload the folder and go.
-
Customizable UI: Comes with a flexible dashboard (
index2.php). - Fallback Logic: Attempts HTTPS first, then falls back to HTTP if needed.
5. Check it out on GitHub
π GitHub Repository: https://github.com/hamzaalighalib/gmtp
I would love to hear your thoughts! Do you think HTTP-based protocols are the future of specialized messaging, or should we stick to traditional SMTP? Let's discuss in the comments!

Top comments (0)