cPanel / WHM Plugin

SMTP2GO Relay for cPanel/WHM

SMTP2GO Relay is a WHM plugin that sends a cPanel server’s outgoing email through SMTP2GO, and sets up every hosted domain for it automatically. It connects with the SMTP2GO API v3 and routes mail through the server’s Exim mail system over an encrypted, password-protected connection.

$10.00 Per Month

SMTP2GO Relay dashboard in WHM with the status banner and usage tiles

Overview

Overview

Product

SMTP2GO Relay for cPanel/WHM

Version

1.0.0

Author

Group44 Pty Ltd · www.group44.com.au

Where it runs

WHM » Plugins » SMTP2GO Relay (root only)

Built for

Hosting providers who want reliable, authenticated sending for all customer domains on a server

Server needs

cPanel & WHM with Exim, cPanel’s bundled PHP 7.4 or newer

SMTP2GO needs

An account plus an API key with access to Sender Domains, SMTP Users, Statistics, Activity and Emails

Network needs

HTTPS to api.smtp2go.com, and the chosen SMTP port open to mail.smtp2go.com

What It Does

The Plugin Does Four Jobs

Connects

Connects the server to your SMTP2GO account with an API key.

Registers

Registers every hosted domain in SMTP2GO as a sender domain.

Publishes

Publishes each domain’s DKIM, Return-Path and tracking DNS records, then verifies them.

Relays

Relays outgoing mail from verified domains through SMTP2GO, while everything else keeps delivering directly.

How It Works

How It Works

The plugin works in two parts: it prepares each domain in SMTP2GO, then tells Exim to send mail for those domains through SMTP2GO.

Only mail from verified domains goes through SMTP2GO: mail sent from the server by PHP, webmail or apps is checked against the relay list

Preparing domains (through the SMTP2GO API)

Sending mail (through Exim)

Functions

Functions, Page by Page

The plugin has eight pages plus a detail page for each domain. Every page carries the Group44 logo and copyright, and the header always shows whether the API is connected and whether the relay is on.

Dashboard

Sender Domains

Domain detail

Relay

SMTP Users

Activity

Tools

Settings

Logs

Screenshots

Inside WHM

SMTP2GO Relay welcome screen in WHM with the API key form, data region picker and a three-step explainer

Welcome screen

The API key form, a region picker and a three-step explainer.

SMTP2GO Relay dashboard in WHM with the status banner and usage tiles

Dashboard

Status banner and usage tiles.

SMTP2GO Relay domain automation switches in WHM settings

Automation switches

Add new domains automatically, write DNS records automatically, add SMTP2GO to SPF, remove deleted domains, include subdomains, background sync, and show inside WHM’s own navigation.

Automation

One-Click Auto Setup

Once connected, the plugin keeps itself up to date with no manual work: new domains are picked up within 20 minutes, or straight away through cPanel hooks. Auto setup runs these steps in order and stops at the first one that fails, showing a tick or cross for each:

1

Checks the API key with SMTP2GO.

2

Creates a dedicated SMTP user for this server (named whm-<hostname>-<random>, strong generated password), unless one is already set.

3

Turns on automatic domain adding and DNS writing, and sets the relay to verified domains only.

4

Runs a full sync (below).

5

Tests the connection to the SMTP2GO server and port. If the port is blocked, it stops and asks you to pick another port.

6

Turns the relay on.

Safe to run again

It is safe to run again; existing settings and credentials are kept.

Domain Sync

What Each Sync Does

Only one sync runs at a time; a second one waits its turn rather than doubling up.

Each sync does the following

Every 20 minutes

Cron job /etc/cron.d/smtp2go_whm runs a sync, if background sync is on

New or removed cPanel account

cPanel hook queues a sync about 20 seconds later

Addon domain added or removed

cPanel hook queues a sync

Parked domain added or removed

cPanel hook queues a sync

Subdomain added

cPanel hook queues a sync

Sync now / Auto setup buttons

Runs immediately

Runs in the background

Hooks run the sync in the background, so account and domain creation is never slowed down.

Security

Security and Safety

The plugin is built so a mistake can’t stop the server’s mail or leak credentials.

Access and input

Credentials

Mail flow safety

Installation

Install, Upgrade and Uninstall

Installing takes one command as root; running the same command again upgrades in place and keeps all settings.

1

Install: run the commands shown below as root

2

Then open WHM » Plugins » SMTP2GO Relay, paste the API key, choose the region and click Auto setup.

				
					cd /root
unzip smtp2go-whm-1.0.0.zip
cd smtp2go-whm
./install.sh
				
			

What the installer does

The installer checks it is running as root on a cPanel server with PHP 7.4 or newer, copies the files, registers the plugin in WHM, adds the cron job and cPanel hooks, and creates the Exim lookup files. On an upgrade it also refreshes the relay settings.

Maintenance

Uninstall and Emergency Relay Off

Uninstall

				
					# relay off, plugin removed, settings kept
./uninstall.sh

# also deletes settings, logs and backups
./uninstall.sh --purge
				
			

Emergency relay off

From SSH, without WHM:

				
					/usr/local/cpanel/3rdparty/bin/php-cli /usr/local/cpanel/whostmgr/docroot/cgi/smtp2go/bin/sync.php --disable
				
			

Files

Files on the Server

				
					# Plugin code: index.cgi, lib/, bin/, assets/
/usr/local/cpanel/whostmgr/docroot/cgi/smtp2go/

# Settings, API key and SMTP login (root only)
/var/cpanel/smtp2go/config.json

# Cached domain status and DNS results
/var/cpanel/smtp2go/state.json

# Plugin log
/var/cpanel/smtp2go/smtp2go.log

# Last 20 copies of exim.conf.local
/var/cpanel/smtp2go/backups/

# Gets the three marked SMTP2GO blocks
/etc/exim.conf.local

# SMTP login read by Exim (root and mail group only)
/etc/exim_smtp2go_auth

# Sender domains relayed through SMTP2GO
/etc/exim_smtp2go_domains

# Sender domains never relayed
/etc/exim_smtp2go_exclude

# 20-minute background sync
/etc/cron.d/smtp2go_whm
				
			

Limits

Known Limits

Order SMTP2GO Relay for cPanel/WHM

$10.00 per month. Questions about the plugin? Contact our team. SMTP2GO is a trademark of its respective owner. This plugin is an independent integration.