Multiple MX Records - mailgun

We have a site on Google Cloud, let's call it 'main.co.uk'
and a subdomain site called 'forum'.
We are using Gmail business for main.co.uk emails, verified by MX records, SPF etc
Now what's confusing me is using mailgun for sending mail for 'forum'.
I know we can have multiple MX Records for main.co.uk but is there a good way to do this? do we set different priorities? Will we get issues with mailgun and Google trying to handle incoming mail?
Any advice would be great.

Using mailgun for sending emails does not involve MX records. Services like mailgun will use credentials for one of your email servers and will act like an email client program. Mailgun will authenticate and then upload email to the email server. There is also the option for programs like mailgun to act as an SMTP server for your domain (you can have more than one sending server).
Mailgun can also be configured as an email server for receiving email. However, you do not replace your existing email server, instead you create a subdomain that is then managed by mailgun. In this use case all incoming emails for that subdomain someone#mailgun.example.com are then processed by mailgun. This is similar to having multiple email accounts that you need to login into to read your email. The intent here is for mailgun to apply intelligence to the sending and processing of your email campaigns by managing email bounces, click throughs, etc.
MX records specify the mail server responsible for accepting email. You can have multiple MX records with different priorities but they are pointing to the same email system (collection of servers storing your inbox), not to different servers at different providers. For example, you would not have one MX record point to Gmail and another MX record pointing to Office 365 (or mailgun and Google). Multiple MX records support fault tolerance and failover, not multiple providers.
You can have an email server setup for main.co.uk and another email server setup for forum.main.co.uk but these are separate email server setups (I am ignoring email aliasing). You can have mailgun send email for someone#forum.main.co.uk with a return address anotherperson#main.co.uk. Normally you want to keep the sender address and return address the same so that SPAM filters don't kick in.
In summary, use mailgun to send emails from your website and / or email marketing campaigns and a normal email system (Office 365, Gmail, etc.) for everything else but have them setup as separate independent email systems.

Related

How can I allow users to send emails through my django app but coming from their own gmail account?

I have a django app where users can send emails through the app to contacts that they upload themselves. I use Sendgrid to send the email and the recipient receives an email from a "white-label" address like hello#mydomain.com
Now, I would like to implement a system where I can allow users to send emails through our app but that those emails are sent by their own email address. To make it simple, let's just consider "Gmail" and if a user want they can "login with their gmail account" on my app and then send emails from my app that are sent from their account... I know that Gmail has an API and I wonder if I can leverage it to do what I need.
You can definitely send emails using Gmail API methods but keep in mind the below stated in their official documentation:
Note: The Gmail API shouldn't be used to replace IMAP for developing a
full-fledged email client. Instead, see IMAP, POP, and SMTP.
As they recommend, you could integrate IMAP/SMTP features in your application so users can authenticate/provide access to their accounts and achieve your goal of having emails sent from their accounts.

django send_email not sending to host domain email addresses

My Django (hosted through a cPanel Python App) is not sending out emails to addresses belonging to the same domain as the site.
The same send_email() function works fine in sending out messages to any other domain.
I use Google Workspace for managing emails, and all MX records are set up via cPanel as normal – and emails otherwise work fine via Gmail.
Any ideas?

Service for alias emails like Air bnb or craigslist

I'm looking for a service, surprised sendgrid doesn't provide this. On our site users can send emails to other users. We don't want to provide them with the actual email address. Are there any services that provide email aliasing and forwarding. The service would create an email address that could be replied to, that email would send the email immediately to the aliased address. Stats on the emails sent would be kept but not the contents of the emails.
You can use SendGrid's Inbound Parse Webhook as an intermediary to do this. Instead of having the users email each other directly, you can have the one user (User A) email a specified email address that receives the email. Then, send an email to another user (User B) with the information parsed from the original email. Here is an example of this type of communication between two users.

Not receiving emails, but Mailgun shows 100% delivery rate

I'm using a CMS to send emails when a form is submitted. Its configured to use smtp.mailgun.org:587 with the username postmaster#domain.com. I'm using Google Apps for my email, so in this case the email account I'm receiving emails at is support#domain.com. Customers fill out a form and enter their email address is used as the "from" address and the "to" address is support#domain.com. I don't see anything in my Junk folder in Gmail. Mailgun is getting all the emails and marking them as sent/received, but I simply am not getting the emails in Gmail, thus not getting support emails from my customers. What gives?
Issue was I had mxa.mailgun.org and mxb.mailgun.org added in my MX Records on my host (Linode). Removing those records fixed the issue.

How to test routes

I have a webpage that reads webhooks received from mail events and routes
In mailgun I created a subdomain that we actually only use for testing, I can not add MX records to the domain we use.
so for example for my domain "mycompany.com" I have added "testing.mycompany.com"
Now I want to send a mail to "testaccount#testing.mycompany.com" that get forwarded with mailgun routes to my webpage but.
Without being able to add MX records to our main domain, is it possible to configure a solution in mailgun so I can send an email to an unexisting mail "testaccount#testing.mycompany.com" in a newly created subdomain ?