cPanel / WHM on GCP with SendGrid

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Hello everyone,
I try configuring a smart host with SendGrid to send all the system ([email protected]) notifications to my private Gmail.
(forwarding on GCP is hard because port 25):
https://support.cpanel.net/hc/en-us/articles/360051773434-Cannot-Send-Mail-from-Google-Cloud-Server

So, i did everything by the book:
https://support.cpanel.net/hc/en-us/articles/360036537354

I open an account in SendGrid and try to authenticate a single sender and domain sender.
but: [email protected] (the hostname of WHM) is get the mail to the section:



This the only way to see the verification mail from sendgrid.

I know is little 3rd party stuff, but SendGrid and GCP push responsibility on cPanel and the API.
what cant be because i chack it 1000 times and the email actually get to [email protected] ( i see them i see even the verification link, but from some reason the interface mess it up. i attached screenshot )

Please, i belive someone from cPanel already setup Sendgrid on GCP with his cPanel ( one from the support maybe? )

if have some instructions what the best method to verify your hostname
and
what actually is recommended to verify? (root user sender, cpanel sender?)
What i need to do if you want SendGrid Will to send me a WHM system notification
to your private email?

for example, i try to verify:
[email protected]

maybe i was wrong?
maybe i need to verify another user or system demon? for example:
[email protected]
???

Maybe something in the WHM TWICKS or Exim configuration, needs to be adjusted for SendGrid and i don't know? (attached screenshot)

Please, if someone can tell me what i need to verify to get a notification is great :)

as i said, API implant perfectly, and the account open on SendGrid already
cPanel has a backup port:
( 26 - design by default from cPanel and GCP Market place - client only need active the Exim option on WHM > SERVICE MANAGER )

UPDATE:
Sendgrid gets verified but does not send emails.

Help :*(
 

Attachments

Last edited:

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
A new update, i found an email from SendGrid in whm > mail queue:

Code:
--1636020665-eximdsn-2049747418

Content-type: text/plain; charset=us-ascii



This message was created automatically by mail delivery software.



A message that you sent could not be delivered to one or more of its

recipients. This is a permanent error. The following address(es) failed:



  [email protected]

    (ultimately generated from [email protected])

    host smtp.sendgrid.net [54.228.39.88]

    SMTP error from remote mail server after end of data:

    550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements



--1636020665-eximdsn-2049747418

Content-type: message/delivery-status



Reporting-MTA: dns; server.locksmithunit.cat



Action: failed

Final-Recipient: rfc822;[email protected]

Status: 5.0.0

Remote-MTA: dns; smtp.sendgrid.net

Diagnostic-Code: smtp; 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements


the email reaches cPanel and this even looks like the API working. (if is not was a reach at all).

Is maybe something i do wrong, Exim configuration inside WHM, or use the wrong verification method with SendGrid
( or maybe i am wrong and do not need it because of the API).

More the that:

If have other alternative cPanel or the managers here recommended to do on GCP,
I don't care to try it.

i don't care to try something supported by cPanel, is be much better because is will not be 3rd party
( i use SendGrid because cPanel recommended that and mailgun with GCP).


as i said, if have someone from the managers or someone installs cPanel on GCP and was in the same issue:
https://support.cpanel.net/hc/en-us/articles/360051773434-Cannot-Send-Mail-from-Google-Cloud-Server

I will be happy to hear about a good alternative, or at least tell me what i do wrong with SendGrid?

I know is long guys,
I only put all the updates ( i don't see all the problems in one time, i see it when i dive to it deeper and deeper )
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,045
111
118
Houston, TX
cPanel Access Level
Root Administrator
Hello! The error indicates that the credentials that you used are incorrect. While we would be limited in what we can do regarding unsupported setups, if you open a ticket with the link in my signature, we could review the errors and maybe make a suggestion. I can't make any promises, but we might be able to find something simple. If you do so, please let me know the ticket ID here.
 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Hey, Anthony whatsup?
How are you? first, thank you all the time you helped me haha :)
I notice your help and i appreciate that very much.

So...
OK, I OPEN THE TICKET BUT HE GOT A SOLVED IMIDATE,
WAS A PROBLEM WITH ONE OF THE MANAGERS BEFORE
AND
I THINK HE SUSPENDS OUR COMPANY FROM SUPPORT.


My account in the support is:
*redacted*

Ticket number:
#94380700

The ticket URL:
*redacted*


if is impossible to open it, you can help me here, I pretty am sure,
I will fix it with you.

btw one last thing i little suspect but i sure is not the problem.

GCP Market place installs cPanel without Egress port rule. (outbound)

but!!!

cPanel actually recommended implant API

and from what i know, if you use API...
you not need the eggres rule in your firewall. ( the call request is via API )
or maybe i wrong?


Another option is the problem come from GCP
(I SAID BEFORE IS COMPLEX AND YES, IS A LITTLE BIT 3RD PARTY, BUT YOU ARE THE ONLY ONES WHO UNDERSTAND WHAT TO DO):

Maybe need to install postfix on the VM? (SOUND TO ME STOPED, CPANEL HAS THE SENDGRID API)
https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid#postfixsendgrid


AGAIN AS I SAID BEFORE:
This is sound not making sense...
because cPanel already has the API.
It is means cPanel replaces postfix, or i am wrong?

Again i open a ticket, but from my experience,
I know nobody can unblock my support ( i have a solo license paid by me but still is not helping me ).

Anthony, again thank you, and i hope you are able to help me here.
IF YOU ONLY KNOW THE RIGHT PROCESS, I CAN DO IT BY MYSELF, IF YOU ONE TIME WORK WITH THEM (SENDGRID ON GCP)
GIVE ME A SIMPLE METHOD ( I THE WORST CASE AND YOU CANT RESPOND TO ME IN THE SUPPORT ).



1. IF I NEED TO INSTALL POSTFIX ON THE VM WITH THE CPANEL, EVEN AFTER IMPLANTING THE API INSIDE CPANEL (EXIM CONFIGURATION)?
2. IF NEED AN OPEN PORT FOR EGRESS EVEN WHEN WE USE API KEY AND THE REQUEST DONE BY API (SENDGRID API INSIDE EXIM).


Thanks again Anthony :)
 
Last edited by a moderator:

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
as i said i don't care to give up on SendGrid for a simple alternative ( open port in GCP if have something like that )
or bring cPanel to operate somehow.

I don't care to give up on SendGrid. ( if you don't have another way to help me Anthony ).

any method you know and recommend for me,
For cPanel to be able to send an email on GCP is more than welcome.


SendGrid is not a factor if you have another way to help me Anthony :)
 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
I Made it, the problem is in SendGrid with this verification.
you need to verify the domain
+
username Cpanel and [email protected]
only then is working...

+
THE API...

Now i try to do with one verification process from them, and not start verified:
locksmithunit.cat
and his users...

have a way to route all the emails to [email protected]? like local routing?
 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Unfortunately, is not got resolved properly.

OK, I will explain,

API NOT CALLING, SENDGRID NOT READ IT AND NOT SEND YOU EVEN AN EMAIL.

THE ONLY OPTION IS TO WORK IS VIA DNS RECORDS.
WHAT IS VERY STUPID, BECAUSE IS MUCH HEAVIER,

API IS NEWER AND BETTER, MUCH SECURE AND FASTER.

BUT IS NOT WORKING,

RIGHT NOW SENDGRID SENDS MY EMAIL BUT VIA DNS AND NOT API.
WHAT CAUSE ME TO CREATE A SMART HOST RECORD FOR EACH CPANEL SERVER:
( server, Cpanel, webmail each one needs DNS record to work if you do not succeed set it up with API ).

I am sure you already know that, if not you not published this:

FA2 sometimes goes up as well, i see have a lot of politics between you and SendGrid.
i not gonna lie, their support is very bad.

and in cPanel support my account is suspended ( even after i buy 2 licenses from cPanel ).

I SURE I WILL FIND SOLUTION IN THE END, THE ONLY QUASTION IS HOW MUCH IS WILL TAKE.
MAYBE YOU CAN HELP ME.

IF HAVE FEATURE MAYBE BLOCK THE API CALL? AND I AM NOT AWAERE TO THAT?
 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Don't have any suggestions, is a very long process and i wish i was able to skip it.
but is not.

I succeed to do it in the end but is not actually work with API...
is work with DNS,

after that API come into the picture ( and i really didn't get it, all the API is not useful... )

SendGrid forces you to create DNS records for each domain...
is means, the request is done via DNS and not API...

is a kind of API AUTHENTICATION.

Is not an actual request via API ( MUCH BETTER AND FASTER, SAVE TIME AND EXTRA DNS ZONES ON YOUR REGISTER OR YOUR CPANEL )

I Wish cPanel will find a solution to get rid of all those 3rd parties... cPanel designs to do it much better and is free (even if SendGrid provides 100 emails free).
is makes things more complex, yes maybe you get another feature from SendGrid...

but for server management and notifications?
is pointless and useless for cPanel users.

cPanel already have what they offer and even better.
I belive with the time, when everybody moving to GCP... i belive cPanel will find the solution for it in the feature.
 
  • Like
Reactions: cPanelAnthony