diff -Naurd mutt-cvs/Makefile.am mutt-new/Makefile.am
--- mutt-cvs/Makefile.am	2006-07-21 12:36:12.000000000 +0000
+++ mutt-new/Makefile.am	2006-07-21 12:40:38.000000000 +0000
@@ -51,7 +51,7 @@
 CPP=@CPP@
 
 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
-	-DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
+	-DDOTLOCK_PATH=\"@DOTLOCK_PATH@\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
 	-DHAVE_CONFIG_H=1
 
 AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
diff -Naurd mutt-cvs/configure.ac mutt-new/configure.ac
--- mutt-cvs/configure.ac	2006-07-21 12:36:12.000000000 +0000
+++ mutt-new/configure.ac	2006-07-21 12:40:38.000000000 +0000
@@ -463,9 +463,6 @@
         MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS dotlock.o"
 fi
 
-AC_SUBST(DOTLOCK_TARGET)
-
-
 AC_MSG_CHECKING(where to put the documentation)
 AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=PATH], [Specify where to put the documentation]),
         [mutt_cv_docdir=$withval],
@@ -482,8 +479,18 @@
         DOTLOCK_GROUP=''
         DOTLOCK_PERMISSION=755
 fi
+
+AC_ARG_WITH(system-dotlock, [  --with-system-dotlock=PATH Specify where mutt_dotlock already exists],
+        [DOTLOCK_TARGET=''
+         DOTLOCK_GROUP=''
+         DOTLOCK_PERMISSION=755
+         DOTLOCK_PATH=$withval],
+        [DOTLOCK_PATH=$bindir/mutt_dotlock])
+
+AC_SUBST(DOTLOCK_TARGET)
 AC_SUBST(DOTLOCK_GROUP)
 AC_SUBST(DOTLOCK_PERMISSION)
+AC_SUBST(DOTLOCK_PATH)
 
 AC_ARG_WITH(domain, AC_HELP_STRING([--with-domain=DOMAIN], [Specify your DNS domain name]),
         [if test $withval != yes; then
diff -Naurd mutt-cvs/doc/Makefile.am mutt-new/doc/Makefile.am
--- mutt-cvs/doc/Makefile.am	2006-07-18 18:04:15.000000000 +0000
+++ mutt-new/doc/Makefile.am	2006-07-21 12:41:11.000000000 +0000
@@ -4,7 +4,7 @@
 
 DSLROOT = @DSLROOT@
 
-DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1
+DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DDOTLOCK_PATH=\"@DOTLOCK_PATH@\" -DHAVE_CONFIG_H=1
 AM_CPPFLAGS = -I. -I.. -I$(includedir) -I$(top_srcdir)
 
 MAKEDOC_CPP = $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C
diff -Naurd mutt-cvs/init.h mutt-new/init.h
--- mutt-cvs/init.h	2006-07-04 21:18:13.000000000 +0000
+++ mutt-new/init.h	2006-07-21 12:40:41.000000000 +0000
@@ -478,7 +478,7 @@
   ** filtered message is read from the standard output.
   */
 #if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
-  { "dotlock_program",  DT_PATH, R_NONE, UL &MuttDotlock, UL BINDIR "/mutt_dotlock" },
+  { "dotlock_program",  DT_PATH, R_NONE, UL &MuttDotlock, UL DOTLOCK_PATH },
   /*
   ** .pp
   ** Contains the path of the mutt_dotlock (8) binary to be used by
