A PHP web application for managing email forwarders through the DirectAdmin API on MXroute servers.
- Server Selection: Choose from 21 available MXroute servers at login
- Secure Login: Authenticate with your DirectAdmin username and password
- Persistent Sessions: Stay logged in until logout or session timeout (1 hour)
- Domain Selection: Choose from all domains in your DirectAdmin account
- Email Forwarder Management:
- View all email forwarders for a selected domain
- Add new email forwarders
- Edit existing forwarders
- Delete forwarders with confirmation
- PHP 7.0 or higher
- cURL extension enabled
- Web server (Apache, Nginx, etc.)
- Upload all files to your web server directory
- Ensure your web server has write permissions for session management
- Access the application through your web browser
daforwarders/
├── config.php # Configuration and session management
├── DirectAdminAPI.php # DirectAdmin API wrapper class
├── index.php # Login page
├── dashboard.php # Main dashboard with domain selection
├── manage_forwarder.php # Add/edit/delete forwarders
└── README.md # This documentation
- Login:
- Select your MXroute server from the dropdown list
- Enter your DirectAdmin username and password
- Select Domain: Choose a domain from the dropdown on the dashboard
- Manage Forwarders:
- View existing forwarders in the table
- Click "Add New Forwarder" to create a new one
- Click "Edit" to modify an existing forwarder
- Click "Delete" to remove a forwarder (with confirmation)
- Logout: Click the logout button in the header to end your session
- Session-based authentication with automatic timeout
- Auth token expiry independent of session timeout
- CSRF protection through session validation
- Input validation and sanitization
- SQL injection prevention (no direct database queries)
- XSS prevention through proper HTML escaping
- Using DirectAdmin Login Keys (see below)
- Implementing a secure server-side cache (Redis/Memcached) for credentials
- Using OAuth or similar token-based authentication if available
For production use, we strongly recommend using DirectAdmin Login Keys instead of your main account password:
-
Create a Login Key in DirectAdmin:
- Login to your DirectAdmin control panel
- Navigate to Account Manager → Login Keys
- Create a new key with API access permissions
- Restrict the key to only the commands needed:
- CMD_API_SHOW_USER_CONFIG
- CMD_API_SHOW_DOMAINS
- CMD_API_EMAIL_FORWARDERS
-
Use the Login Key:
- Use your regular username when logging in
- Use the Login Key value as the password
- This provides better security by not exposing your main account password
-
Benefits:
- Limit IP access to specific addresses
- Set expiration dates
- Restrict available commands
- Easy revocation without changing main password
The application supports the following MXroute servers:
- eagle.mxlogin.com
- pixel.mxrouting.net
- taylor.mxrouting.net
- sunfire.mxrouting.net
- blizzard.mxrouting.net
- longhorn.mxrouting.net
- safari.mxrouting.net
- lucy.mxrouting.net
- arrow.mxrouting.net (default)
- echo.mxrouting.net
- london.mxroute.com
- shadow.mxrouting.net
- moose.mxrouting.net
- tuesday.mxrouting.net
- monday.mxrouting.net
- wednesday.mxrouting.net
- redbull.mxrouting.net
- witcher.mxrouting.net
- heracles.mxrouting.net
- everest.mxrouting.net
- glacier.mxrouting.net
You can modify config.php to:
- Add or remove servers from the list
- Change the default server
- Adjust port number (default: 2222)
- Change protocol (default: https)
- Modify session timeout (default: 1 hour)
The application uses the following DirectAdmin API commands:
CMD_API_SHOW_USER_CONFIG- Validate user credentialsCMD_API_SHOW_DOMAINS- Get list of domainsCMD_API_EMAIL_FORWARDERS- Manage email forwarders
- Login fails: Verify your DirectAdmin credentials and ensure the server is accessible
- Domains not loading: Check if your account has proper permissions to view domains
- Forwarders not saving: Ensure your account has email management permissions
- Session timeout: Sessions expire after 1 hour of inactivity for security
This application is designed specifically for MXroute customers. Select your server from the dropdown when logging in. For DirectAdmin-related issues, contact MXroute support.