Add IgnoreBounceSender model
This commit is contained in:
parent
383cd49f25
commit
6dac717c75
|
@ -2340,3 +2340,12 @@ class IgnoredEmail(db.Model, ModelMixin):
|
|||
|
||||
mail_from = 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}"
|
||||
|
|
|
@ -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…
Reference in New Issue