func (be *Backend) Login(state *smtp.ConnectionState, username, password string) (smtp.Session, error) {
	if be.GatewayAccount != "" {
		return nil, errGatewayOnly
	}

	if !strings.HasSuffix(username, "!") {
		username = username + "!"
	}

	session, err := be.getSessionFromAccount(username)

	if err != nil {
		logrus.Errorf("SMTP: user %s error when login - %s", username, err.Error())
	} else {
		logrus.Infof("SMTP: user %s logged in", username)
	}

	return session, err
}
// Login handles a login command with username and password. We accept any password as long the
// username is a valid account on the vault
Login handles a login command with username and password. We accept any password as long the
username is a valid account on the vault
// Login handles a login command with username and password . We accept any password as long the // username is a valid account on the vault
func (be *Backend) Login(state *smtp.ConnectionState, username, password string) (smtp.Session, error) {
	if be.GatewayAccount != "" {
		return nil, errGatewayOnly
	}
	if !strings.HasSuffix(username, "!") {
		username = username + "!"
	}
	session, err := be.getSessionFromAccount(username)
	if err != nil {
		logrus.Errorf("SMTP: user %s error when login - %s", username, err.Error())
	} else {
		logrus.Infof("SMTP: user %s logged in", username)
	}
	return session, err
}
func ( be * Backend ) Login ( state * smtp . ConnectionState , username , password string ) ( smtp . Session , error ) { if be . GatewayAccount != " " { return nil , errGatewayOnly } if ! strings . HasSuffix ( username , " " ) { username = username + " " } session , err := be . getSessionFromAccount ( username ) if err != nil { logrus . Errorf ( " " , username , err . Error ( ) ) } else { logrus . Infof ( " " , username ) } return session , err }
Login handles a login command with username and password.
Login handles a login command with username and password .