func (be *Backend) Login(_ *imap.ConnInfo, username, password string) (backend.User, error) {
	account := username + "!"

	addr, err := address.NewAddress(account)
	if err != nil {
		return nil, errIncorrectAddressFormat
	}
	if !be.Vault.HasAccount(*addr) {
		return nil, errAccountNotFound
	}

	user := &User{Account: account, Vault: be.Vault, Database: be.Database}

	user.Info, user.Client, err = common.GetClientAndInfo(be.Vault, account)
	if err != nil {
		return nil, err
	}

	logrus.Infof("IMAP: user %s logged in", username)

	return user, nil
}
// Login is called when logging in to IMAP. Any password is valid as long as the account is found in the vault
Login is called when logging in to IMAP. Any password is valid as long as the account is found in the vault
// Login is called when logging in to IMAP . Any password is valid as long as the account is found in the vault
func (be *Backend) Login(_ *imap.ConnInfo, username, password string) (backend.User, error) {
	account := username + "!"
	addr, err := address.NewAddress(account)
	if err != nil {
		return nil, errIncorrectAddressFormat
	}
	if !be.Vault.HasAccount(*addr) {
		return nil, errAccountNotFound
	}
	user := &User{Account: account, Vault: be.Vault, Database: be.Database}
	user.Info, user.Client, err = common.GetClientAndInfo(be.Vault, account)
	if err != nil {
		return nil, err
	}
	logrus.Infof("IMAP: user %s logged in", username)
	return user, nil
}
func ( be * Backend ) Login ( _ * imap . ConnInfo , username , password string ) ( backend . User , error ) { account := username + " " addr , err := address . NewAddress ( account ) if err != nil { return nil , errIncorrectAddressFormat } if ! be . Vault . HasAccount ( * addr ) { return nil , errAccountNotFound } user := & User { Account : account , Vault : be . Vault , Database : be . Database } user . Info , user . Client , err = common . GetClientAndInfo ( be . Vault , account ) if err != nil { return nil , err } logrus . Infof ( " " , username ) return user , nil }
Login is called when logging in to IMAP.
Login is called when logging in to IMAP .