mirror of
				https://github.com/optim-enterprises-bv/Mailu.git
				synced 2025-11-03 19:47:52 +00:00 
			
		
		
		
	Configurable default spam threshold used for new users
This commit adds functionality to set a custom default spam threshold for new users. The environment variable ``DEFAULT_SPAM_THRESHOLD`` can be used for this purpose. When not set, it defaults back to 80%, as the default value was before If ``DEFAULT_SPAM_THRESHOLD`` is set to a value that Python cannot parse as an integer, a ValueError is thrown. There is no error handling for that case built-in.
This commit is contained in:
		@@ -509,7 +509,8 @@ class User(Base, Email):
 | 
				
			|||||||
    displayed_name = db.Column(db.String(160), nullable=False, default='')
 | 
					    displayed_name = db.Column(db.String(160), nullable=False, default='')
 | 
				
			||||||
    spam_enabled = db.Column(db.Boolean, nullable=False, default=True)
 | 
					    spam_enabled = db.Column(db.Boolean, nullable=False, default=True)
 | 
				
			||||||
    spam_mark_as_read = db.Column(db.Boolean, nullable=False, default=True)
 | 
					    spam_mark_as_read = db.Column(db.Boolean, nullable=False, default=True)
 | 
				
			||||||
    spam_threshold = db.Column(db.Integer, nullable=False, default=80)
 | 
					    spam_threshold = db.Column(db.Integer, nullable=False,
 | 
				
			||||||
 | 
					        default=int(os.environ.get('DEFAULT_SPAM_THRESHOLD', 80)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Flask-login attributes
 | 
					    # Flask-login attributes
 | 
				
			||||||
    is_authenticated = True
 | 
					    is_authenticated = True
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user