Skip to content

Commit

Permalink
restore missing print for autodiscover steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Stalmans committed Oct 26, 2017
1 parent b034539 commit a07f8f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
autodiscoverURL = domain
} else {

//create the autodiscover url
if autodiscoverStep == 0 {
autodiscoverURL = createAutodiscover(fmt.Sprintf("autodiscover.%s", domain), true)
Expand All @@ -290,6 +291,7 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
}
}
}
utils.Trace.Printf("Autodiscover step %d - URL: %s\n", autodiscoverStep, autodiscoverURL)

req, err := http.NewRequest("POST", autodiscoverURL, strings.NewReader(r))
req.Header.Add("Content-Type", "text/xml")
Expand Down Expand Up @@ -331,12 +333,10 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er

defer resp.Body.Close()


if resp.StatusCode == 401 || resp.StatusCode == 403 {
return nil, autodiscoverURL, fmt.Errorf("Access denied. Check your credentials")
}


body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, "", err
Expand Down
3 changes: 2 additions & 1 deletion mapi/mapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Init(config *utils.Session, lid, URL, ABKURL string, transport int) {
AuthSession.Transport = transport
AuthSession.ClientSet = false
AuthSession.ReqCounter = 1
AuthSession.LogonID = 0x06
AuthSession.LogonID = 0x0C
AuthSession.Authenticated = false

//default to Encrypt + Sign for NTLM
Expand Down Expand Up @@ -171,6 +171,7 @@ func mapiRequestHTTP(URL, mapiType string, body []byte) ([]byte, error) {
req, err := http.NewRequest("POST", URL, bytes.NewReader(body))
addMapiHeaders(req, mapiType)
req.SetBasicAuth(AuthSession.Email, AuthSession.Pass)

req.Close = true
//request the auth url
resp, err := client.Do(req)
Expand Down

0 comments on commit a07f8f0

Please sign in to comment.