Skip to content

Commit a07f8f0

Browse files
author
Etienne Stalmans
committed
restore missing print for autodiscover steps
1 parent b034539 commit a07f8f0

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

autodiscover/autodiscover.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
270270
if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
271271
autodiscoverURL = domain
272272
} else {
273+
273274
//create the autodiscover url
274275
if autodiscoverStep == 0 {
275276
autodiscoverURL = createAutodiscover(fmt.Sprintf("autodiscover.%s", domain), true)
@@ -290,6 +291,7 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
290291
}
291292
}
292293
}
294+
utils.Trace.Printf("Autodiscover step %d - URL: %s\n", autodiscoverStep, autodiscoverURL)
293295

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

332334
defer resp.Body.Close()
333335

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

339-
340340
body, err := ioutil.ReadAll(resp.Body)
341341
if err != nil {
342342
return nil, "", err

mapi/mapi.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func Init(config *utils.Session, lid, URL, ABKURL string, transport int) {
9494
AuthSession.Transport = transport
9595
AuthSession.ClientSet = false
9696
AuthSession.ReqCounter = 1
97-
AuthSession.LogonID = 0x06
97+
AuthSession.LogonID = 0x0C
9898
AuthSession.Authenticated = false
9999

100100
//default to Encrypt + Sign for NTLM
@@ -171,6 +171,7 @@ func mapiRequestHTTP(URL, mapiType string, body []byte) ([]byte, error) {
171171
req, err := http.NewRequest("POST", URL, bytes.NewReader(body))
172172
addMapiHeaders(req, mapiType)
173173
req.SetBasicAuth(AuthSession.Email, AuthSession.Pass)
174+
174175
req.Close = true
175176
//request the auth url
176177
resp, err := client.Do(req)

0 commit comments

Comments
 (0)