File: sysmail.m4

package info (click to toggle)
libtinymail 0.0.9-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,148 kB
  • ctags: 19,175
  • sloc: ansic: 151,565; xml: 20,145; sh: 9,245; makefile: 2,394; cs: 243; cpp: 141; python: 93; perl: 71
file content (45 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
AC_DEFUN([AC_TNY_SYSMAIL_CHECK],
[

AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, /usr/sbin:/usr/lib)
AC_DEFINE_UNQUOTED(SENDMAIL_PATH, "$SENDMAIL", [Path to a sendmail binary, or equivalent])

AC_MSG_CHECKING(system mail directory)
if test -d /var/mail -a '!' -h /var/mail ; then
	system_mail_dir=/var/mail
else
	system_mail_dir=/var/spool/mail
fi
AC_DEFINE_UNQUOTED(SYSTEM_MAIL_DIR, "$system_mail_dir", [Directory local mail is delivered to])

case `ls -ld $system_mail_dir 2>&1 | awk '{print $1;}'` in
d??????rw?)
	CAMEL_LOCK_HELPER_USER=""
	CAMEL_LOCK_HELPER_GROUP=""
	system_mail_perm="world writable"
	;;

d???rw????)
	CAMEL_LOCK_HELPER_USER=""
	CAMEL_LOCK_HELPER_GROUP=`ls -ld $system_mail_dir 2>&1 | awk '{print $4;}'`
	system_mail_perm="writable by group $CAMEL_LOCK_HELPER_GROUP"
	;;

drw???????)
	CAMEL_LOCK_HELPER_USER=`ls -ld $system_mail_dir 2>&1 | awk '{print $3;}'`
	CAMEL_LOCK_HELPER_GROUP=""
	system_mail_perm="writable by user $CAMEL_LOCK_HELPER_USER"
	;;

*)
	CAMEL_LOCK_HELPER_USER=""
	CAMEL_LOCK_HELPER_GROUP=""
	system_mail_perm="???"
	;;
esac

AC_MSG_RESULT([$system_mail_dir, $system_mail_perm])
AC_SUBST(CAMEL_LOCK_HELPER_USER)
AC_SUBST(CAMEL_LOCK_HELPER_GROUP)

])