Force 3rd party email services

gwgllc

Registered
Apr 21, 2017
2
0
76
Planet Earth
cPanel Access Level
Root Administrator
Hi all,

For starters I'm running:

cPanel/WHM 11.62.0.21
CloudLinux 7.3
CSF v10.06

I don't want to offer mail services for my cPanel users, which means they will need to use a 3rd party mail service to receive and send out email. Primarily I would like to allow G Suite (formally Google Apps), Zoho Mail, and Microsoft Office365. Possibly more 3rd party service providers if needed down the road.

So I want to disallow my users the ability to receive and send mail from my server's mail server (via any email account setup on the cPanel or via PHP sendmail function), and instead force them to use a 3rd party mail service to receive/send out mails, even from their scripts such as WordPress, Joomla, etc. So basically:

- They can't setup email accounts on my server.
- They can't receive/send mail from my server via any email account setup at cPanel >> Email Accounts section.
- They can't use my server to send mail via their script (WordPress, Joomla, or any custom script.)

But, I don't want to interfere with the WHM system if it needs Dovecot and EXIM to perform any system related tasks. I know I have my CSF notifications set to send to me via email, so I wouldn't really want to interfere with that, or anything else the system might need Dovecot and EXIM for. I'm just looking to block my users from using my mail server and force them to use a 3rd party email service...

I'd appreciate any ideas or recommendations on the best way to accomplish this. :)
 

RadWebHosting

Well-Known Member
May 6, 2016
63
14
58
Dallas, Texas
cPanel Access Level
DataCenter Provider
Twitter
Use the Feature Manager to disable email services for all Feature Lists you use for the web hosting accounts. (I am not sure if the "Disable" List would have any adverse effects on the system emails you DO want to send.)

If you already know the third party service your client will use, then you can include the appropriate DNS zones and MX records so new accounts are already setup for the third-party email service.
 

gwgllc

Registered
Apr 21, 2017
2
0
76
Planet Earth
cPanel Access Level
Root Administrator
Thanks for that. I've already disabled the ability for users to create email accounts by removing that option from the Feature Manager in WHM for their package. So that should stop them from creating email accounts and sending mail that way.

How about blocking them from sending mail via PHP from any script they install, like WordPress, Joomla, or some custom coded PHP script?

I guess I should be a bit more specific. I don't want users to be able to use my mail server to send outgoing mail at all. Not via email account, not via PHP sendmail, or any other way possible. I want to force them to use a 3rd party mail service for their email needs completely...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I guess I should be a bit more specific. I don't want users to be able to use my mail server to send outgoing mail at all. Not via email account, not via PHP sendmail, or any other way possible. I want to force them to use a 3rd party mail service for their email needs completely...
Hello,

You can find a couple of workarounds referenced in the following threads:

SOLVED - How Do I Block One Domain From Sending Email From My Server?
Exim Mail Server disable but still send mail

Thank you.