mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
add account config option to prevent the account for setting their own custom password, and enable by default for new accounts
accounts with this option enabled can only generate get a new randomly generated password. this prevents password reuse across services and weak passwords. existing accounts keep their current ability to set custom passwords. only admins can change this setting for an account. related to issue #286 by skyguy
This commit is contained in:
@ -1593,6 +1593,8 @@ func (a *Account) DeliverMessage(log mlog.Log, tx *bstore.Tx, m *Message, msgFil
|
||||
|
||||
// SetPassword saves a new password for this account. This password is used for
|
||||
// IMAP, SMTP (submission) sessions and the HTTP account web page.
|
||||
//
|
||||
// Callers are responsible for checking if the account has NoCustomPassword set.
|
||||
func (a *Account) SetPassword(log mlog.Log, password string) error {
|
||||
password, err := precis.OpaqueString.String(password)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user