Skip to content

Instantly share code, notes, and snippets.

@weibeld
Last active April 1, 2026 10:15
Show Gist options
  • Select an option

  • Save weibeld/cd9042b78063e5ce9c4276898befd59b to your computer and use it in GitHub Desktop.

Select an option

Save weibeld/cd9042b78063e5ce9c4276898befd59b to your computer and use it in GitHub Desktop.
Custom Domain Email

The QuantumSense Custom Domain Email Saga

  • Originally (2018) we used Mailgun for both sending and receving (with quantumsense.ai) for free by making use of the Mailgun free tier (about 10,000 emails per month for free).
  • In 2020 Mailgun removed the free tier and started providing only paid plans.
  • In 2021 we changed the domain to quantumsense.ml and since Mailgun didn't provide a free tier anymore (we would have had to pay about $35 per month for using the new domain name with Mailgun), we stopped using Mailgun and didn't have email for a while.
  • In 2022 we implemented a new setup using SendGrid for sending and Cloudflare for receiving, which both could be used for free by using the free tier.
  • At some point in 2023 sending stopped working because our SendGrid account was suspended (apparently, because it was dormant) and couldn't be recovered (customer service just advised to "create a new account").
  • In August 2023 we changed the domain to quantumsense.ch and set up receiving with Cloudflare. We never set up sending because our SendGrid account was still disabled.

Custom Domain State in 2026

  • weibeld.net:
    • Domain: Namecheap
    • DNS: Namecheap
    • Email: both sending and receiving over Mailgun (still working for free because domain was added before the 2020 change and still uses the legacy free tier)
      • Sending: TXT (SPF) and TXT (DKIM) records displayed in Mailgun
      • Receiving: MX records in Namecheap, routes in Mailgun, Gmail Accounts and Import "Send mail as" address set to Mail is sent through: smtp.mailgun.org
  • quantumsense.ch:
    • Domain: GoDaddy
    • DNS: Cloudflare
    • Email: receiving with Mailgun (works), sending set up with Sendgrid but doesn't work because account is suspended
      • Sending: SendGrid setup unclear because account is suspended, Gmail Accounts and Import "Send mail as" address set to Mail is sent through: smtp.sendgrid.net
      • Receving: MX records and Email Routing settings in Cloudflare

Way Forward

  • Goal: complete email setup for all domain names at the same place, ideally for free
  • Requirement: get rid of both Mailgun and SendGrid because they suck!
  • Preference: bundle as much as possible of the setup around Cloudflare
    • Tradeoff: requires to use Cloudflare as the authoritative DNS server for all domains (probably not an issue)
  • Open questions:
    • Which domain name registrar to use?
      • Cloudflare: no markup costs, no first-year discounts, supports only a few country TLDs
      • Porkbun: no markup costs, offers first-year discounts, supports many country TLDs but not all
      • Namecheap: charges markup costs, offers first-year discounts, does support almost all country TLDs and other TLDs
      • In summary, Namecheap has the widest suppport of TLDs but is generally more expensive. Porkbun has the second biggest coverage of TLDs and is cheaper than Namecheap. Cloudflare has about the same prices as Porkbun but supports fewer TLDs and doesn't offer any discounts for the first year. In conclusion, Porkbun seems to be the best option.
  • Possible strategy:
    • Domain name registrations: Porkbun
    • DNS: Cloudflare
    • Email receiving: Cloudflare
    • Email sending: email delivery service with free tier (e.g. see SMTP2GO, Mailtrap, MailerSend, Brevo, etc.)
      • Caveat: some of these services (e.g. SMTP2GO) require a custom domain email address able to receive emails to sign up. So, set up the receiving side of at least one custom domain before signing up to these services.
      • Note: it is also possible to send emails with a custom domain through Gmail's SMTP server as explained, for example, on https://paulonteri.com/thoughts/how-to/custom-domain-with-gmail#3-sending-mail. However, a free Gmail account doesn't allow domain alignment, i.e. verification of ownership of the custom domain which is usually done through DNS records with DKIM and SPF values. This has serious disadvantages such as a "via" label in the sender address, the emails more likely being flagged as spam, and damaging the domain reputation (note that a paid Google Workspace account might allow performing domain alignment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment