2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
2024-07-12 09:41:44 +00:00
# Generated by Django 1.10.5 on 2021-04-22 11:27
2015-04-08 14:41:09 +00:00
from __future__ import unicode_literals
from django . conf import settings
2024-07-12 09:41:44 +00:00
import django . core . validators
from django . db import migrations , models
2021-04-22 12:18:01 +00:00
import django . db . models . deletion
2015-04-29 13:55:22 +00:00
import orchestra . contrib . mailboxes . validators
2015-04-08 14:41:09 +00:00
class Migration ( migrations . Migration ) :
dependencies = [
( ' domains ' , ' 0001_initial ' ) ,
2015-04-29 13:55:22 +00:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2015-04-08 14:41:09 +00:00
]
operations = [
migrations . CreateModel (
name = ' Address ' ,
fields = [
2015-04-29 13:55:22 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' name ' , models . CharField ( blank = True , help_text = ' Address name, left blank for a <i>catch-all</i> address ' , max_length = 64 , validators = [ orchestra . contrib . mailboxes . validators . validate_emailname ] , verbose_name = ' name ' ) ) ,
( ' forward ' , models . CharField ( blank = True , help_text = ' Space separated email addresses or mailboxes ' , max_length = 256 , validators = [ orchestra . contrib . mailboxes . validators . validate_forward ] , verbose_name = ' forward ' ) ) ,
( ' account ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' addresses ' , to = settings . AUTH_USER_MODEL , verbose_name = ' Account ' ) ) ,
( ' domain ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' addresses ' , to = ' domains.Domain ' , verbose_name = ' domain ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
options = {
' verbose_name_plural ' : ' addresses ' ,
} ,
) ,
migrations . CreateModel (
name = ' Autoresponse ' ,
fields = [
2015-04-29 13:55:22 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' subject ' , models . CharField ( max_length = 256 , verbose_name = ' subject ' ) ) ,
2015-04-08 14:41:09 +00:00
( ' message ' , models . TextField ( verbose_name = ' message ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' enabled ' , models . BooleanField ( default = False , verbose_name = ' enabled ' ) ) ,
( ' address ' , models . OneToOneField ( on_delete = django . db . models . deletion . CASCADE , related_name = ' autoresponse ' , to = ' mailboxes.Address ' , verbose_name = ' address ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . CreateModel (
name = ' Mailbox ' ,
fields = [
2015-04-29 13:55:22 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' name ' , models . CharField ( db_index = True , help_text = ' Required. 32 characters or fewer. Letters, digits and ./-/_ only. ' , max_length = 32 , unique = True , validators = [ django . core . validators . RegexValidator ( ' ^[ \\ w.-]+$ ' , ' Enter a valid mailbox name. ' ) ] , verbose_name = ' name ' ) ) ,
( ' password ' , models . CharField ( max_length = 128 , verbose_name = ' password ' ) ) ,
( ' filtering ' , models . CharField ( choices = [ ( ' CUSTOM ' , ' Custom filtering ' ) , ( ' DISABLE ' , ' Disable ' ) , ( ' REDIRECT ' , ' Archive spam (Score≥8) ' ) , ( ' REDIRECT5 ' , ' Archive spam (Score≥5) ' ) , ( ' REJECT ' , ' Reject spam (Score≥8) ' ) , ( ' REJECT5 ' , ' Reject spam (Score≥5) ' ) ] , default = ' REDIRECT ' , max_length = 16 ) ) ,
( ' custom_filtering ' , models . TextField ( blank = True , help_text = " Arbitrary email filtering in <a href= ' https://tty1.net/blog/2011/sieve-tutorial_en.html ' >sieve language</a>. This overrides any automatic junk email filtering " , validators = [ orchestra . contrib . mailboxes . validators . validate_sieve ] , verbose_name = ' filtering ' ) ) ,
( ' is_active ' , models . BooleanField ( default = True , verbose_name = ' active ' ) ) ,
( ' account ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' mailboxes ' , to = settings . AUTH_USER_MODEL , verbose_name = ' account ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
options = {
' verbose_name_plural ' : ' mailboxes ' ,
} ,
) ,
migrations . AddField (
model_name = ' address ' ,
name = ' mailboxes ' ,
2024-07-12 09:41:44 +00:00
field = models . ManyToManyField ( blank = True , related_name = ' addresses ' , to = ' mailboxes.Mailbox ' , verbose_name = ' mailboxes ' ) ,
2015-04-08 14:41:09 +00:00
) ,
migrations . AlterUniqueTogether (
name = ' address ' ,
unique_together = set ( [ ( ' name ' , ' domain ' ) ] ) ,
) ,
]