diff --git a/api/api.go b/api/api.go index 916af47..1065aa5 100644 --- a/api/api.go +++ b/api/api.go @@ -74,14 +74,19 @@ func SetupApiServer(listen string, auth *AuthChecker, send Smtp, recv Imap) *htt return } - _ = authUser - + // open imap client client, err := recv.MakeClient(authUser.Subject) if err != nil { _ = c.WriteJSON(map[string]string{"error": "Making client failed"}) return } + // auth was ok + err = c.WriteJSON(map[string]string{"auth": "ok"}) + if err != nil { + return + } + for { // authenticated users get longer to reply // a simple ping/pong setup bypasses this