func (be *Backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, error) {
	if be.GatewayAccount != "" {
		session, err := be.getSessionFromAccount(be.GatewayAccount)
		if err != nil {
			return nil, err
		}

		session.IsGateway = true
		session.RemoteAddr = state.RemoteAddr

		logrus.Infof("SMTP: external connection received from %s", state.RemoteAddr.String())

		return session, err
	}

	return nil, smtp.ErrAuthRequired
}
// AnonymousLogin will accept mails if this server allows to be a email<->bitmaelum gateway
AnonymousLogin will accept mails if this server allows to be a email<->bitmaelum gateway
// AnonymousLogin will accept mails if this server allows to be a email< - > bitmaelum gateway
func (be *Backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, error) {
	if be.GatewayAccount != "" {
		session, err := be.getSessionFromAccount(be.GatewayAccount)
		if err != nil {
			return nil, err
		}
		session.IsGateway = true
		session.RemoteAddr = state.RemoteAddr
		logrus.Infof("SMTP: external connection received from %s", state.RemoteAddr.String())
		return session, err
	}
	return nil, smtp.ErrAuthRequired
}
func ( be * Backend ) AnonymousLogin ( state * smtp . ConnectionState ) ( smtp . Session , error ) { if be . GatewayAccount != " " { session , err := be . getSessionFromAccount ( be . GatewayAccount ) if err != nil { return nil , err } session . IsGateway = true session . RemoteAddr = state . RemoteAddr logrus . Infof ( " " , state . RemoteAddr . String ( ) ) return session , err } return nil , smtp . ErrAuthRequired }
AnonymousLogin will accept mails if this server allows to be a email<->bitmaelum gateway
AnonymousLogin will accept mails if this server allows to be a email< - > bitmaelum gateway