From 9cecc79a02352c53f67b49308d7342ee8481952d Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 4 Feb 2021 17:10:44 +0100 Subject: [PATCH] Raise domain name length to RFC1035 maximum (#2147) RFC1035 Section 2.3.4. specifies a maximum domain name length of 255 octets in protocol. As each label is prefixed by its length and the domain-root (.) has a length of 0 we have a maximum of 253 octets. For modoboa to support all these domains in its DB scheme we need to raise the maximum domain name length to 253 as well. --- .../migrations/0019_auto_20210130_2226.py | 18 ++++++++++++++++++ modoboa/admin/models/domain.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 modoboa/admin/migrations/0019_auto_20210130_2226.py diff --git a/modoboa/admin/migrations/0019_auto_20210130_2226.py b/modoboa/admin/migrations/0019_auto_20210130_2226.py new file mode 100644 index 000000000..7f3c902e7 --- /dev/null +++ b/modoboa/admin/migrations/0019_auto_20210130_2226.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.17 on 2021-01-30 22:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('admin', '0018_update_disabled_accounts_aliases'), + ] + + operations = [ + migrations.AlterField( + model_name='domain', + name='name', + field=models.CharField(help_text='The domain name', max_length=253, unique=True, verbose_name='name'), + ), + ] diff --git a/modoboa/admin/models/domain.py b/modoboa/admin/models/domain.py index b7db53700..282f9f887 100644 --- a/modoboa/admin/models/domain.py +++ b/modoboa/admin/models/domain.py @@ -23,7 +23,7 @@ from . import mixins class Domain(mixins.MessageLimitMixin, AdminObject): """Mail domain.""" - name = models.CharField(ugettext_lazy("name"), max_length=100, unique=True, + name = models.CharField(ugettext_lazy("name"), max_length=253, unique=True, help_text=ugettext_lazy("The domain name")) quota = models.PositiveIntegerField( default=0,