Skip to content
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

cpanel migrate - SPF record not being built corretely #929

Open
shoulders opened this issue Oct 20, 2024 · 20 comments
Open

cpanel migrate - SPF record not being built corretely #929

shoulders opened this issue Oct 20, 2024 · 20 comments

Comments

@shoulders
Copy link

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.20.2 Pro
Theme version 21.20.7
Apache version 2.4.52
Package updates 10 package updates are available

the issue

When I import a cpanel account the SPF record is not built according to the server template instead it does this:

example.co.uk. IN TXT "v=spf1 a mx a:example.co.uk ?all"

As you can see it has ?all which was changed a while back ago for the demo DNS options when you server is not running DNS for that domain. I do not know if this fix is related and implemented in my version of Virtualmin.

I used a custom template and not the default settings template so is this an inheritance issue?

solution

make cpanel migrate respect the server template

additional

SPF records not using correct SPF action #876

@iliajie
Copy link
Collaborator

iliajie commented Oct 20, 2024

Hello,

make cpanel migrate respect the server template

Shouldn’t we try to preserve what was originally in the backup?

@shoulders
Copy link
Author

The whole DNS zone is recreated from scratch, the build process takes into account of sub-domains #933 and aliases.

One of my domains that I had used office365 and this had extra DNS exntries such as autodiscover and the MX entry. These are all wiped out.

Personally I think the imported DNS should be as close to the imported account as that is what the user expects. I appreciate this might never be perfect (i.e. dkim, dmarc, webdav, the calendar thing).

Shouldn’t we try to preserve what was originally in the backup?

I think you are right. It would make more sense.

@jcameron
Copy link
Collaborator

Shouldn’t we try to preserve what was originally in the backup?
I think you are right. It would make more sense.

Currently when migrating a cPanel backup, if it contains DNS records we will copy them over verbatim instead of following the defaults for the Virtualmin system.

@shoulders
Copy link
Author

Currently when migrating a cPanel backup, if it contains DNS records we will copy them over verbatim instead of following the defaults for the Virtualmin system.

I am not sure about this:

  • My SPF record got wiped out and replaced
    example.co.uk. IN TXT "v=spf1 a mx a:example.co.uk ?all"
  • My remote MX entries got wiped out and then the virtualmin default (can't remember which)
  • my office365 autodiscover (CNAME) did not get migrated
  • All of the cpanle ones such as cpanel.example.com but I would expect this to be correct behaviour.

the DNS zone I ended up with after the import was a badly rebuilt DNS zone that did not fully follow my server template.

@jcameron
Copy link
Collaborator

Ok that seems buggy. Any chance we could get a copy of the cPanel backup you tried to migrate to test on?

@shoulders
Copy link
Author

should not be an issue but I will just need to ask the client.

@shoulders
Copy link
Author

shoulders commented Oct 21, 2024

I have checked with the client and they are happy for me to send you the backup.

how can I get it to you?

@iliajie
Copy link
Collaborator

iliajie commented Oct 21, 2024

how can I get it to you?

See the end of bin/webmin file.

@shoulders
Copy link
Author

Will send a we transfer link if too big to email. Thanks

@jcameron
Copy link
Collaborator

Ok, you can email me the file or better still the link at [email protected] (and please reference this ticket in the email)

@shoulders
Copy link
Author

Did you get the WeTransfer link?

Tar

@jcameron
Copy link
Collaborator

No I didn't see it! What was the sender or email subject?

@shoulders
Copy link
Author

i sent it to your [email protected], not 100% what the subject was, but it did have the github issue number in it.

the password was sent to you via forum message.

I have also just pasted a link there aswell. So maybe that will work.

check your junk mail, lol

@jcameron
Copy link
Collaborator

Ok I see it this time! I'll check it out later today ..

@jcameron
Copy link
Collaborator

So I just tested migrating that domain, and actually it doesn't contain any DNS records that need to be copied over. So you will just get the same SPF record that a freshly created domain would get ..

I verified this with a test, and it worked fine for me.

@shoulders
Copy link
Author

shoulders commented Oct 25, 2024

The following entries were not brought over:

example.co.uk.	14400	IN	MX	0	example-co-uk.mail.protection.outlook.com.
example.co.uk.	14400	IN	TXT	"v=spf1 +mx +a +ip4:123.123.123.123 include:spf.protection.outlook.com -all"
example.co.uk.	14400	IN	TXT	MS=ms12123123
autodiscover	14400	IN	CNAME	autodiscover.outlook.com.

@jcameron
Copy link
Collaborator

Ah I see the issue, your backup is in a slightly different format to what I expected, and so the DNS zone file wasn't copied over.

One question though - in this backup, which was the "primary" domain?

@shoulders
Copy link
Author

hg......co.uk

@shoulders
Copy link
Author

shoulders commented Oct 26, 2024

if it is of any use.

cPanel version: 122.0.23

@jcameron
Copy link
Collaborator

Thanks! I have updated the cPanel migration code in Virtualmin to properly copy across DNS records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants