mirror of
https://github.com/simple-login/app.git
synced 2025-11-10 01:40:49 +08:00
Add IgnoreBounceSender model
This commit is contained in:
parent
383cd49f25
commit
6dac717c75
2 changed files with 45 additions and 0 deletions
|
|
@ -2340,3 +2340,12 @@ class IgnoredEmail(db.Model, ModelMixin):
|
||||||
|
|
||||||
mail_from = db.Column(db.String(512), nullable=False)
|
mail_from = db.Column(db.String(512), nullable=False)
|
||||||
rcpt_to = db.Column(db.String(512), nullable=False)
|
rcpt_to = db.Column(db.String(512), nullable=False)
|
||||||
|
|
||||||
|
|
||||||
|
class IgnoreBounceSender(db.Model, ModelMixin):
|
||||||
|
"""Ignore sender that doesn't correctly handle bounces, for example noreply@github.com"""
|
||||||
|
|
||||||
|
mail_from = db.Column(db.String(512), nullable=False, unique=True)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<NoReplySender {self.mail_from}"
|
||||||
|
|
|
||||||
36
migrations/versions/2021_080211_ffa75d04e6ef_.py
Normal file
36
migrations/versions/2021_080211_ffa75d04e6ef_.py
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: ffa75d04e6ef
|
||||||
|
Revises: c3470e2d3224
|
||||||
|
Create Date: 2021-08-02 11:30:05.509051
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'ffa75d04e6ef'
|
||||||
|
down_revision = 'c3470e2d3224'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('ignore_bounce_sender',
|
||||||
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||||
|
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
|
||||||
|
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
|
||||||
|
sa.Column('mail_from', sa.String(length=512), nullable=False),
|
||||||
|
sa.PrimaryKeyConstraint('id'),
|
||||||
|
sa.UniqueConstraint('mail_from')
|
||||||
|
)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('ignore_bounce_sender')
|
||||||
|
# ### end Alembic commands ###
|
||||||
Loading…
Add table
Reference in a new issue