Add Alias.disable_email_spoofing_check column

This commit is contained in:
Son NK 2020-08-26 14:39:03 +02:00
parent 4101142253
commit 9c72f4dec0
3 changed files with 38 additions and 1 deletions

3
.gitignore vendored
View File

@ -11,4 +11,5 @@ db.sqlite-journal
static/upload
adhoc_*
adhoc.py
venv/
venv/
.venv

View File

@ -808,6 +808,13 @@ class Alias(db.Model, ModelMixin):
db.Boolean, nullable=False, default=False, server_default="0"
)
# when a mailbox wants to send an email on behalf of the alias via the reverse-alias
# several checks are performed to avoid email spoofing
# this option allow disabling these checks
disable_email_spoofing_check = db.Column(
db.Boolean, nullable=False, default=False, server_default="0"
)
user = db.relationship(User)
mailbox = db.relationship("Mailbox", lazy="joined")

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: b82bcad9accf
Revises: 95938a93ea14
Create Date: 2020-08-26 14:38:22.496570
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b82bcad9accf'
down_revision = '95938a93ea14'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('alias', sa.Column('disable_email_spoofing_check', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('alias', 'disable_email_spoofing_check')
# ### end Alembic commands ###