Hossam Elshahawi

Hossam Elshahawi

Software Engineer ❤️ Web

Setting up Exim at cPanel & WHM with MailJet

This guide will help you to use Mailjet SMTP service as Outgoing SMTP Server in cPanel & WHM with Exim.

Mailjet is a transactional email service. It comes stock with a powerful API for fast implementation into applications for sending email reliably over SMTP, but it can also be used as a smart host for all of your server’s outgoing email.

I’m running a CentOs 7 instance running cPanel on GCP ( Google Cloud Platform) and this tutorial is just a workaround for sending email into inbox safely , because GCP block port 25 which is responsible for sending outgoing emails to another mailboxes

Step 1

The below instructions cover how to do this via WHM, simply go to WHM -> Exim Configuration Manager -> Advanced Editor and alter the sections indicated.


Step 2

Click on Advanced Editor.

Step 3

Scroll down and go to Section: AUTH and add below lines of code:

mailjet_login:
driver = plaintext
public_name = LOGIN
client_send = : USERNAME : PASSWORD

and sure replace Username and Password with Mailjet credentials as you can find it in your account here if you didn’t have an account you can simply signup for free and you will see the credentials in your dashboard like this.


Step 4

Go to Section: ROUTERSTART and add below lines of code:

send_via_mailjet:
driver = manualroute
domains = ! +local_domains
transport = mailjet_smtp
route_list = * in-v3.mailjet.com

Step 5

Go to Section: TRANSPORTSTART and add below lines of code:

mailjet_smtp:
driver = smtp
port = 587
hosts = in-v3.mailjet.com
hosts_require_auth = in-v3.mailjet.com

Step 6

Click the Save button. This will restart exim. If exim does not restart, then restart it manually from Restart Services > Mail Server (EXIM).

Step 7

Mailjet requires to add the domain which have the ability to send to a list therefore you have to login into Mailjet account and go to Configuration >> Manage sender domains and addresses  you can visit the link here

as you can see there I have added a one domain and I can add more , when you add a new one they will require a verification of domain ownership with uploading a txt file with a given name or with provided DNS record an both works fine.

All done. In conclusion, Your outgoing email on your server are goes through Mailjet. 🙂

Manually upgrading phpMyAdmin in Sentora

I’m going to upgrade phpMyAdmin to latest version ( 4.8.5 ) in a CentOs 7 server running a Sentora control panel as I upgraded its php version to 7.2 ,therefore some issues appeared in phpMyAdmin like you can’t make a database export to file and it throws a 500 internal server error , simply in the following steps we are going to make a safe upgrade.

Step 1 : Sentora app directory

We have to go to the app directory where we can find the phpMyAdmin

cd /etc/sentora/panel/etc/apps

Step 2 : Download latest phpMyAdmin version

wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip

also you can check the latest version there : https://www.phpmyadmin.net/downloads/

Step 3 : Unzip the file

unzip -q phpMyAdmin-4.8.5-all-languages.zip

Step 4 : Take the configuration to safe place

we can copy config.inc.php file which holds the all configuration to safe place like /home

cp /etc/sentora/panel/etc/apps/phpmyadmin/config.inc.php /home/

Step 4 : Rename Old phpMyadmin folder and the newest one

mv phpmyadmin phpmyadmin_old

mv phpMyAdmin-4.8.5-all-languages phpmyadmin

Step 5 : Set the configuration

cp /home/config.inc.php /etc/sentora/panel/etc/apps/phpmyadmin/

Step 6 : Delete old version

cd /etc/sentora/panel/etc/apps/

rm -rf phpmyadmin_old

All done. In conclusion, You have the latest phpMyAdmin running on your server 🙂