Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Google gcp and mailgun for external mail server?

Discussion in 'E-mail Discussion' started by linux bru, May 8, 2018.

  1. linux bru

    linux bru Member

    Joined:
    Apr 1, 2018
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    israel
    cPanel Access Level:
    Root Administrator
    hello

    case 1: the whm system run on google gcp instance
    google are blocking all the regular mail ports, but they allow to use port 2525. now addition to that some companies asked to define the dkim and spf option for the cpanel's mail accounts else the email that sent mark as spam and as long it is a local mail i can set and it work's fine.
    how do i set it to a mailgun external mail server as primary mail server and set the dkim and spf option for the cpanel's mail accounts?
    note: i chose mailgun from (what google gcp offers from the list of the mail servers) and set another Instance on google gcp and the server can send email fine with vs code, meaning the server is working fine.

    case 2: whm system that run on amazon ec2 instance
    how to set the mailgun on the whm as a email server and for amazon Instance ec2 to set the mailgun mail server as backup mail server in a case the send didn't was a success or some other problem.
    the local mail server is working fine on amazon ec2 instance when the dkim and spf option for the cpanel's mail accounts set as it should be.

    note 1: i tried set the smarthost, but after that i got an error each email i tried to send or get. (case number 1)
    thehostingpub.com/cpanelwhm-send-email-smarthost/
    - Removed -

    “* smarthost1.com::1166:smarthost2.com::1100”
    and in my case it was:
    "domains.***.**.**::2525"
    note 2: i set the mailgun dns records on the whm dns system and the route53 zone and the google gcp zone dns. (case 1 and 2)
    note 3: the mailgun server address is domains.***.**.**
    note 4: the mailgun got a static external ip address.

    how do i solved both cases?

    i can add the dns records if that help, but not the mailgun api key or the mailgun user.
     
    #1 linux bru, May 8, 2018
    Last edited by a moderator: May 9, 2018
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,233
    Likes Received:
    1,939
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @linux bru,

    Here's a third-party URL that offers instructions on how to setup MailGun with cPanel:

    Configure Mailgun on cPanel (Exim) - Grepitout

    Keep in mind if your provider blocks outgoing traffic over port 25, you can try using port 2525 when configuring your smart host entries per the third-party URL above. EX:

    Code:
    smtp.mailgun.org::2525
    Here's a thread discussing the SPF/DKIM entries with MailGun:

    SOLVED - MailGun DNS setup issue

    Let me know if this helps, and keep in mind this is not a setup that we support.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. linux bru

    linux bru Member

    Joined:
    Apr 1, 2018
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    israel
    cPanel Access Level:
    Root Administrator
    hey
    i set it and it working now with the mailgun fine, but how can i set the local mail server of the whm as number 1 server, mailgin number two server and addition mail servers after it?
    i got a call from google gcp today and i will set cyber protections as well on the mailgun mail server instance and after it on the amazon aws instance cyber protections.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,233
    Likes Received:
    1,939
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @linux bru,

    Manually setting up that types of configuration is beyond the scope of support we can provide, but you may find the following user-submitted example helpful as a proof-of-concept if you decide to set that up on your own:

    Configure EXIM to handle all forwards locally

    Additionally, the Exim user's mailing list is often a good resource for these types of custom Exim configuration settings:

    Exim-users Info Page

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. linux bru

    linux bru Member

    Joined:
    Apr 1, 2018
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    israel
    cPanel Access Level:
    Root Administrator
    hello
    i think you may didn't understood my question.

    i want to set the original whm mail server (exim) as the first inline to send emails as it was but after it the second mail server the mailgun and after it 3 mail server mailjet or any other mail server i will choose to use.

    why you are asking?! the answer in case the e-mail won't sent it will just move to the next mail serve but as long exim work's the mail will be sent from the local mail server, while gcp can't use the local mail server because all the mail ports are blocked and it used 2525 instead.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,233
    Likes Received:
    1,939
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    This isn't a supported configuration. I encourage you to post to the Exim user's mailing list if you'd like help with this type of setup:

    Exim-users Info Page

    Or, consider reaching out to a system administrator for help exploring if this type of setup will work:

    System Administration Services | cPanel Forums

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice