+dnl See whether the mail spool directory is world-writable.
+if test "$lspath" != "no" -a "$cutpath" != "no"; then
+ AC_CACHE_CHECK(whether the mail spool is world-writable,
+ nmh_cv_mailspool_world_writable,
+ [if test "`$lspath -dl $mailspool | $cutpath -c9`" = "-"; then
+ nmh_cv_mailspool_world_writable=no
+ else
+ nmh_cv_mailspool_world_writable=yes
+ fi])
+fi
+
+dnl ...If it's not, we need to #define MAILGROUP to 1 and make inc setgid mail.
+if test "$nmh_cv_mailspool_world_writable" = "no"; then
+ AC_DEFINE(MAILGROUP)
+ SETGID_MAIL=1
+fi
+AC_SUBST(SETGID_MAIL)dnl
+