mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 10:24:37 +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:
@ -2007,12 +2007,13 @@ func (Admin) SetPassword(ctx context.Context, accountName, password string) {
|
||||
}
|
||||
|
||||
// AccountSettingsSave set new settings for an account that only an admin can set.
|
||||
func (Admin) AccountSettingsSave(ctx context.Context, accountName string, maxOutgoingMessagesPerDay, maxFirstTimeRecipientsPerDay int, maxMsgSize int64, firstTimeSenderDelay bool) {
|
||||
func (Admin) AccountSettingsSave(ctx context.Context, accountName string, maxOutgoingMessagesPerDay, maxFirstTimeRecipientsPerDay int, maxMsgSize int64, firstTimeSenderDelay, noCustomPassword bool) {
|
||||
err := admin.AccountSave(ctx, accountName, func(acc *config.Account) {
|
||||
acc.MaxOutgoingMessagesPerDay = maxOutgoingMessagesPerDay
|
||||
acc.MaxFirstTimeRecipientsPerDay = maxFirstTimeRecipientsPerDay
|
||||
acc.QuotaMessageSize = maxMsgSize
|
||||
acc.NoFirstTimeSenderDelay = !firstTimeSenderDelay
|
||||
acc.NoCustomPassword = noCustomPassword
|
||||
})
|
||||
xcheckf(ctx, err, "saving account settings")
|
||||
}
|
||||
|
Reference in New Issue
Block a user