Tutorial Request: Setting up a working email account in Cyberpanel

I’m looking for a straightforward tutorial on the steps to create a working rainloop email account from start-to-finish for a domain created in cyberpanel. I’m also using cloudflare on the domain if that significantly changes anything. So far, I figured that I need to:

  • create a site in cyberpanel (check)
  • create an email in cyberpanel (check)
  • (maybe) create a nameserver for my domain from within cyberpanel (check)
  • copy the mx record over to cloudflare (but not necessarily my DNS provider - check)
  • ensure ports 25 or 587 are not being blocked by cyberpanel, my VPS provider, or cloudflare (check)

This did not work.

I then decided to attempt setting up a 3rd-party SMTP provider to see if that would work - and also I figured I needed to set that up to allow wordpress to send notifications to users, since that wasn’t working either.

  • create an account at mailgun (check)
  • copy over the mailgun mx and txt records to cloudflare (check)
  • verify my domain at mailgun (check)
  • create an SMTP host in cyberpanel, mysite > manage (check)

no go. After doing all this I get the following errors from mxtoolbox.com:

After this, I second helloswant’s request for a good tutorial on how to set up a working email account in a fresh install of cyberpanel! I’ve been pouring over the resource section to find a solution but the perspective of the tutorials is very narrow to specific steps, seemingly assuming that the reader knows what to do on the whole. In reality, I’m coming from a shared hosting provider and never had to deal with anything beyond adding mx records to my DNS account and determining what the mail server address is to copy/paste into the mail client on my phone and desktop.

I don’t actually know if I even need to do anything on the server first, or if I needed to sign up for mailgun at all, or if I can just configure the mail server on cyberpanel to send out wordpress notifications through the [email protected] account once that’s working properly, or if all I need is some simple wordpress plugin that will do everything for me. I can tell cyberpanel comes with a learning curve but I don’t know why there isn’t a proper tutorial to do this basic first step from beginning to end…

Upon further investigation, I found a more in-depth tutorial at Achieve 10/10 Email score with CyberPanel! - Blog Posts - CyberPanel Community. The instructions are as follows:

Step 1: Install or upgrade CyberPanel (check)

Step 2: Make sure CyberPanel is handling your DNS
I see how to do this on google domains’ DNS settings, but it’s currently pointing to cloudflare’s nameservers to use that service and the linked tutorial at https://blog.cyberpanel.net/2018/02/24/how-to-register-private-name-servers-on-namecheap-or-godaddy-with-cyberpanel/ does not provide details on how to configure private name servers with a domain linked to cloudflare - though it says “You need to create your own DNS server or use a DNS provider such as Cloudflare.” Upon investigation it appears as though configuring “custom name servers” on cloudflare requires a “business” account. I went ahead and created a DNS zone in cyberpanel but such a gap in the existing tutorial means I can only guess how to complete this step correctly. Do I create a DNS zone for the domain on cyberpanel? What records are required? Where should I place the records? In cloudflare’s DNS settings? In google domain’s DNS settings? In both? And if I place them over at google domains DNS setting’s, do I add them in addition to cloudflare’s name servers or in the custom resource records section as type NS? Do I still need to do anything at cloudflare or am I done when I add a private nameserver to google domains DNS settings? Should I delete the google NS records at Cloudflare? (ns-cloud-e1.googledomains.com)

Step 3: Setup RDNS and Hostname!
All this step really says is, “If I check RDNS of my IP Address it should point back to this domain,” and then, “Once you set the RDNS, follow the guide below to setup same domain as a hostname on your mail server.” What? How do I setup up the RDNS though? It includes a link to “setup same domain as a hostname on your mail server” in the same step, but that seems like a separate, but related, process (https://cyberpanel.net/docs/2-ssl-for-postfix-dovecot/). I was able to complete that step, so I kind of want to assume I already have RDNS setup(?), but mxtools.com doesn’t seem to think so… :confused:

Step 4: Create Website with DKIM Support
Okay, I created DKIM records when I created a website and I see the TXT records in cyberpanel, DNS > Add/Delete Records > TXT. But do I put them in cloudflare, google domains, or both? I’m putting these all in cloudflare, along with the private nameserver records I created in cyberpanel on a whim just so I can get to the end of the tutorial.

Step 5: Verify your email Score
The snail just went on and on.

REDO Step 4:
I deleted all the custom resource records from google domains > DNS settings, leaving only cloudflares name servers in the top name server section, and then I deleted the NS records pointing to google DNS over at Cloudflare. I made sure the A (mail, mysite.com), CNAME (www), MX (mysite.com), NS (for ns1 and ns2), and TXT records (default._domainkey, _domainkey, _dmarc, mysite.com) created in cyberpanel were all stored over at Cloudflare. Didn’t work. Two things with this configuration that confused me: some of the records were “proxied” by cloudflare and I also set up mailgun earlier trying to get wordpress to send out notifications to users (is that a potential conflict?). This gets me these errors at mxtools.com:

The error for spf: “more then one record found” does tell me maybe using gunmail is an either/or choice. I then deleted all the records for gunmail in cloudflare and I was able to get emails in my rainloop account, but I still don’t seem to be able to send emails from rainloop.

UPDATE: I’ve found a tutorial for “How to Create Reverse DNS or PTR Records in the Vultr Control Panel,” at Vultr, my particular VPS provider, see https://www.vultr.com/docs/how-to-create-reverse-dns-or-ptr-records-in-the-vultr-control-panel. I was able to easily follow the steps but was not sure how to determine the reverse DNS value using Vultr’s IPv6 Subnet Calculator. I threw in a couple of numbers at the end of my IPV6 subnet as shown in the tutorial and tested it until I found one that was within range so the form allowed me to submit it.

However, when I tested outgoing it still didn’t work, (I was able to get incoming mail as described in my last post). So I followed the instructions on another Vultr article, “Configuring IPv6 on your VPS” at https://www.vultr.com/docs/configuring-ipv6-on-your-vps assuming that was necessary.

It’s still not working and I will be writing to Vultr today about it and will post another update when I get a response. In the meantime, if anyone has any comments about the steps that I have followed through this process, i.e., those that may have been unnecessary, or ill-advised, or wrongly configured, or anything else please let me know. I plan to post the final process that gets incoming/outgoing email working for others to read and for future reference as well.

Thank You!

Has anyone responded to your request for help? Have you learned anything yet?

Long story short, I used the instructions from Vultr to set up IPv4, instead of IPv6 and I had to get them to unblock SMTP ports as well. I’m getting an 8.9 out of 10 from https://www.mail-tester.com/ but still get the message “Your IP address is associated with the domain Nevertheless your message appears to be sent from mywebsite.com.” I think that has something to do with the fact that I’m still running cyberpanel on the default address (the address to my rainloop account is I’m going to fix that at some point but otherwise I think everything is working. Since I figured this all out myself I would only ask that the existing tutorial at Achieve 10/10 Email score with CyberPanel! - Blog Posts - CyberPanel Community is updated to clarify the points that are confusing or unclear.

I am having the same issue setting up mail server but on GCP. Able to receive mail but not send. Followed all the steps for 10/10 email score tutorial but outgoing mail does not work. Setup DKIM, SPF, RDNS and custom port 2525 for outgoing mail and updated postfix but still not working. I’m not sure what else to do. As a workaround I tried to setup using a free email hosting provider using Yandex mail which works but their spam filter blocks almost all outgoing mail. Also Zoho mail has a free account as well but they do not allow email forwarding or SMTP connections without paying. Also tried setting up SMTP relay using mailgun like you mentioned but that didn’t work either. I’m assuming GCP is blocking some ports even though I opened email ports on firewall. Maybe I’m over looking something as I am new to this as well. I also come from a shared hosting environment where setting up custom domain email was very simple.