-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MX Records #4
Comments
Hey @A-Lawrence! This is great!
Due to the nature of the MX records having the same value and some having the same priority it's going to be challenging determining what needs to be updated. Then during import we can prompt the User with something like "MX records were found how would you like to to handle them?".
We could then add a flag to skip the prompt and pre-select for CI/CD. Something like This is just a kind of rough idea, what do you think? |
Agreed on the RFC front - this implementation should always respect it.
I guess it depends on how you came to ending up on Cloudflare. For us, we use R53/Vapor as our source of truth and want to just replicate that on Cloudflare (hence the desire for the CI/CD capabilities in my other PR). So whilst I'd be inclined to agree that the majority would probably just enter the MX records directly in Cloudflare, for those that don't, the current implementation throws an error when attempting to sync the records (it gracefully fails, and doesn't terminate execution though, which is good). Onto the proposed solution!
I think this could work! In our case, we'd always want to use I'm happy to take a look when I've got some free time (probably not for 2 - 3 weeks), but if you (or anyone else reading this) decides to take a stab at it before then, I'm not precious about owning the solution :) |
@A-Lawrence Great! This all sounds good! I may have some time to take a crack at it this week. But, same whoever gets to it first doesn't matter to me! |
Back again 👋🏼
I thought I'd open a dialogue about MX records before I dive in and just present a PR, as there are probably a few decisions that would need to be made for them.
In route 53, MX records are stored in a single entry, like so:
When running the record importer for Cloudflare, this entry is imported as a single record.
Now, it's possible to easily split these out into their own records inside the
getVaporRecords
method by modifying the collection building to something akin to (forgive the back-of-a-napkin-nature of this):Which should return each of those MX records as a single entry in the collection.
The problem then comes when determining if the record already exists/needs to be added. The current logic for determining if it exists is as such:
An MX record would always be true as the name and type would always match. Instinctively I thought we could match on the priority, but Google provides identical priority MX records, at which point we're back on matching on the value (which makes no sense, as you'd never be able to update them in Vapor and reliably have them sync with Cloudflare).
This made me wonder whether the more appropriate solution was to just reject any MX records from the collection, and add a note/warning to the output that highlights that MX records must be copied manually.
As a side note, I don't believe R53 is presenting information in the same way it serves it when a DNS lookup is made - I think it's a facade. The RFC for mail systems (at least, the only one I could find any reference to: https://www.rfc-editor.org/rfc/rfc974) suggests that:
That implies it's not permissible to have a single entry with a comma-separated list, so I don't believe it'd work in Cloudflare, even though they seem to accept it as a value via the API.
So, some questions to kick us off:
Am I over thinking this? Is there something I've missed on CF's side to suggest that they'd treat these comma-separated entries in exactly the same way as R53? I don't have a spare domain I'm able to test it on without risking the loss of someone's emails.
Which approach would you prefer? If there's a desire to try to import them, do you have any ideas on how to reliably determine if the record needs adding/updating?
The text was updated successfully, but these errors were encountered: