Back up and recover remote mailboxes from the panel
Coulobre Panel CI / Checks (Python 3.12) (pull_request) Canceled after 0s
Coulobre Panel CI / Checks (Python 3.14) (pull_request) Canceled after 0s

This commit is contained in:
parkel committed 2026-11-21 22:18:59 +01:00
1 parent 13cb45dfe4
commit 386525d314
13 files changed
+510 -24

No files matched your search

+13
View File
@@ -26,6 +26,7 @@ from coulobre.dns_node import (
MxRecord,
TxtRecord,
)
from coulobre.mail_archive_transport import UNCONFIRMED_REMOTE_RESTORE
from coulobre.mail_node import (
LOCAL_PART_MAX_LENGTH,
MAX_MAILBOX_QUOTA_MIB,
@@ -829,6 +830,7 @@ class AccountBackupJob(ProvisioningJob):
default=uuid.uuid4, unique=True, editable=False
)
manifest = models.JSONField()
remote_mail = models.BooleanField(default=False)
scheduled_for = models.DateTimeField(null=True, blank=True)
archive_bytes = models.PositiveBigIntegerField(null=True, blank=True)
retention_protected = models.BooleanField(default=False)
@@ -900,6 +902,7 @@ class ComponentRestoreJob(ProvisioningJob):
restore_id = models.UUIDField(unique=True, editable=False)
kind = models.CharField(max_length=8, choices=Kind)
resource = models.CharField(max_length=254)
remote_mail = models.BooleanField(default=False)
operator_username = models.CharField(max_length=150)
class Meta:
@@ -915,6 +918,16 @@ class ComponentRestoreJob(ProvisioningJob):
return DatabaseSpec(self.backup.account_id, self.resource).name
return self.resource
@property
def can_retry_remote(self):
return (
self.kind == self.Kind.MAILBOX
and self.remote_mail
and self.state == "failed"
and self.problem == UNCONFIRMED_REMOTE_RESTORE
and self.backup.archive_is_restorable
)
class AccountBackupSchedule(models.Model):
class Frequency(models.TextChoices):