EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
Mailgun Setup for MeshCentral Email Verification

Quick Start (5 minutes)

1. Create Mailgun Account

2. Add Your Sending Domain

Option A: Use Mailgun Sandbox Domain (Quick Test)

  • Mailgun provides a sandbox domain automatically
  • Format: sandboxXXXXXXXX.mailgun.org
  • Limitation: Can only send to authorized recipients (you must add email addresses manually)
  • Good for: Testing before setting up your own domain

Option B: Use Your Own Domain (Recommended)

  • Click "Sending" → "Domains" → "Add New Domain"
  • Enter: mg.everydaytech.au (recommended subdomain)
  • Mailgun will provide DNS records to add:
    • TXT record for domain verification
    • MX records for receiving bounces
    • CNAME records for tracking
    • TXT records for SPF and DKIM

DNS Records Example:

Type: TXT
Name: mg.everydaytech.au
Value: v=spf1 include:mailgun.org ~all
Type: TXT
Name: k1._domainkey.mg.everydaytech.au
Value: [DKIM value from Mailgun]
Type: MX
Name: mg.everydaytech.au
Value: mxa.mailgun.org
Priority: 10
Type: MX
Name: mg.everydaytech.au
Value: mxb.mailgun.org
Priority: 10

3. Get SMTP Credentials

  1. Go to "Sending" → "Domain Settings" → Select your domain
  2. Click "SMTP credentials" or "SMTP" tab
  3. You'll see:
    • SMTP hostname: smtp.mailgun.org
    • Port: 587 (TLS)
    • Username: Usually postmaster@YOUR_DOMAIN
    • Password: Click "Reset password" to generate a new one

4. Update DigitalOcean App Configuration

Edit .do-app-spec.yaml:

- key: SMTP_USER
value: postmaster@mg.everydaytech.au
- key: SMTP_PASSWORD
type: SECRET
value: YOUR_MAILGUN_PASSWORD_HERE

5. Deploy

cd /home/cw/Documents/IBG_HUB/rmm-psa-meshcentral
doctl apps update 0ceb0932-3fa7-4a42-9a51-f0a124360a04 --spec .do-app-spec.yaml

Testing

If Using Sandbox Domain:

  1. In Mailgun dashboard, go to "Sending" → "Domain Settings"
  2. Add authorized recipients (your email addresses that can receive test emails)
  3. Create a MeshCentral account with one of those email addresses

If Using Your Own Domain:

  • Just create an account with any email address
  • Check inbox (and spam folder)

Mailgun Dashboard URLs

Troubleshooting

Emails Not Sending

  1. Check Mailgun logs: https://app.mailgun.com/app/logs
  2. Verify SMTP credentials are correct
  3. Ensure domain is verified (green checkmark)
  4. Check MeshCentral logs: doctl apps logs 0ceb0932-3fa7-4a42-9a51-f0a124360a04

"Sandbox" Limitation

  • Sandbox domains can only send to authorized recipients
  • Add recipients in Mailgun dashboard or use your own domain

SPF/DKIM Issues

  • Wait 24-48 hours for DNS propagation
  • Verify DNS records: dig TXT mg.everydaytech.au
  • Check with Mailgun's DNS verification tool

Emails Going to Spam

  • Make sure SPF and DKIM records are set up
  • Use a custom domain instead of sandbox
  • Set up DMARC policy (optional but recommended)

Cost

  • Free tier: 5,000 emails/month for first 3 months
  • After trial: 1,000 emails/month free forever
  • Flex plan: $0.80 per 1,000 emails (if you exceed free tier)

Alternative: Use Sandbox for Testing

If you just want to test quickly without setting up DNS:

  1. Use the sandbox domain: sandboxXXXXXXXX.mailgun.org
  2. Add your email as authorized recipient
  3. Update config:
    SMTP_USER: postmaster@sandboxXXXXXXXX.mailgun.org
    SMTP_FROM: noreply@sandboxXXXXXXXX.mailgun.org

Current Configuration

Next Steps

  1. ✅ Sign up for Mailgun
  2. ✅ Add and verify your domain (or use sandbox)
  3. ✅ Get SMTP credentials
  4. ✅ Update .do-app-spec.yaml with credentials
  5. ✅ Deploy with doctl
  6. ✅ Test by creating a MeshCentral account