diff --git a/configure b/configure
index 059d04819f5cd489a6e953debd05b463c74c16ad..8e4bd788afd41b1594f259ccbee2471edca9cc32 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 52998 .
+# From configure.ac Revision: 53716 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -18878,14 +18878,16 @@ fi
 if test "${USE_IMAP_TK}" != "no"; then
    if test "${IMAP_TK_DIR}" = ""; then
       IMAP_TK_DIR=`pwd`"/../imap-2004g"
-      { echo "$as_me:$LINENO: The --with-imap option does not search your system for installed" >&5
+      if test  -n "${IMAP_TK_MANDATORY}"; then
+	 { echo "$as_me:$LINENO: The --with-imap option does not search your system for installed" >&5
 echo "$as_me: The --with-imap option does not search your system for installed" >&6;}
-      { echo "$as_me:$LINENO: c-client library/header files. Since you did not provide a path" >&5
+	 { echo "$as_me:$LINENO: c-client library/header files. Since you did not provide a path" >&5
 echo "$as_me: c-client library/header files. Since you did not provide a path" >&6;}
-      { echo "$as_me:$LINENO: the configure script will assume you have placed built the c-client" >&5
+	 { echo "$as_me:$LINENO: the configure script will assume you have placed built the c-client" >&5
 echo "$as_me: the configure script will assume you have placed built the c-client" >&6;}
-      { echo "$as_me:$LINENO: files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file." >&5
+	 { echo "$as_me:$LINENO: files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file." >&5
 echo "$as_me: files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file." >&6;}
+      fi
    fi
    { echo "$as_me:$LINENO: checking for UW IMAP Toolkit c-client library" >&5
 echo $ECHO_N "checking for UW IMAP Toolkit c-client library... $ECHO_C" >&6; }
@@ -26176,7 +26178,7 @@ fi
 
 
 if test "${USE_PWLIB}" != "no"; then
-	if test ! -z "${PWLIB_DIR}"; then
+	if test -n "${PWLIB_DIR}"; then
 		PWLIBDIR="${PWLIB_DIR}"
 	fi
 
@@ -26721,7 +26723,7 @@ _ACEOF
 fi
 
 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
-	if test ! -z "${OPENH323_DIR}"; then
+	if test -n "${OPENH323_DIR}"; then
 		OPENH323DIR="${OPENH323_DIR}"
 	fi
 
diff --git a/configure.ac b/configure.ac
index 125728eaefabcf2f44a122f812240d6e84a8956a..e6478ec1592b9af0137bd55a1f731ead6f6be1d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -428,10 +428,12 @@ fi
 if test "${USE_IMAP_TK}" != "no"; then
    if test "${IMAP_TK_DIR}" = ""; then
       IMAP_TK_DIR=`pwd`"/../imap-2004g"
-      AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
-      AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
-      AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
-      AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
+      if test  -n "${IMAP_TK_MANDATORY}"; then
+	 AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
+	 AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
+	 AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
+	 AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
+      fi
    fi
    AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
    saved_cppflags="${CPPFLAGS}"
@@ -709,7 +711,7 @@ AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
 
 if test "${USE_PWLIB}" != "no"; then
-	if test ! -z "${PWLIB_DIR}"; then
+	if test -n "${PWLIB_DIR}"; then
 		PWLIBDIR="${PWLIB_DIR}"
 	fi
 	AST_CHECK_PWLIB()
@@ -728,7 +730,7 @@ if test "${USE_PWLIB}" != "no"; then
 fi
 
 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
-	if test ! -z "${OPENH323_DIR}"; then
+	if test -n "${OPENH323_DIR}"; then
 		OPENH323DIR="${OPENH323_DIR}"
 	fi
 	AST_CHECK_OPENH323()