From: David Woodhouse Date: Fri, 16 Jul 2010 20:14:27 +0000 (+0100) Subject: Use NTLM auth for autodiscover too X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aec65e66c1bdc5ae0b6fda92456f4e39feb0dc53;p=users%2Fdwmw2%2Fews-sync.git Use NTLM auth for autodiscover too --- diff --git a/autodiscover.sh b/autodiscover.sh index e96bd94..e8b5576 100755 --- a/autodiscover.sh +++ b/autodiscover.sh @@ -2,6 +2,12 @@ EMAIL="$1" DOMAIN=${EMAIL##*@} +CURLAUTH="--negotiate -u dummy:" +# NTLM is faster, but requires your password + +if [ "$3" != "" ]; then + CURLAUTH="--ntlm -u $2:$3" +fi QUERYFILE=$(mktemp /tmp/ewsqueryXXXXXX) RESULTFILE=$(mktemp /tmp/ewsresultXXXXXX) @@ -19,7 +25,7 @@ EOF for ATTEMPT in $DOMAIN autodiscover.$DOMAIN; do if [ -n $EWSURL ]; then echo Trying $ATTEMPT... - if curl --negotiate -u dummy: -L -H "Content-Type: text/xml" \ + if curl $CURLAUTH -L -H "Content-Type: text/xml" \ https://$ATTEMPT/autodiscover/autodiscover.xml \ -d @$QUERYFILE > $RESULTFILE; then EWSURL="$(sed -n -e '/EwsUrl/{s/.*\(.*\)<\/EwsUrl>.*/\1/p;q}' $RESULTFILE)"