Commit c1cf18d4 c1cf18d4d7cb64de1ed2381117e05bc2e4d32c2c by Sergey Poznyakoff

--with-mail-rc option: set path to system-wide mail.rc file

1 parent e6bd9abf
......@@ -36,6 +36,15 @@ AC_ARG_WITH(readline,
*) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;;
esac],[usereadline=yes])
AC_SUBST(SITE_MAIL_RC)
AC_ARG_WITH(mail-rc,
[ --with-mail-rc=FILE use FILE instead of $sysconfdir/mail.rc],
[case "${withval}" in
/*) SITE_MAIL_RC="${withval}";;
*) SITE_MAIL_RC="\$(sysconfdir)/${withval}";;
esac],
[SITE_MAIL_RC="\$(sysconfdir)/mail.rc"])
AC_ARG_WITH(db2,
[ --with-db2 use Berkeley DB],
[case "${withval}" in
......
AUTOMAKE_OPTIONS = ../lib/ansi2knr no-dependencies
INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/lib @ARGPINCS@
AM_CFLAGS = -DSITE_MAIL_RC=\"@SITE_MAIL_RC@\"
bin_PROGRAMS = mail
......@@ -9,7 +10,7 @@ mail_LDADD = @ARGPLIBS@ ../mailbox/libmailbox.la ../lib/libmailutils.a \
mail_SOURCES = alias.c alt.c cd.c copy.c delete.c dp.c echo.c \
edit.c eq.c exit.c file.c folders.c followup.c from.c headers.c help.c \
hold.c if.c list.c mail.c mail.h mailline.c mbox.c next.c pipe.c previous.c \
print.c quit.c reply.c retain.c save.c send.c set.c shell.c size.c source.c \
table.c top.c touch.c unalias.c undelete.c unset.c util.c var.c visual.c \
write.c z.c
hold.c if.c inc.c list.c mail.c mail.h mailline.c mbox.c next.c pipe.c \
previous.c print.c quit.c reply.c retain.c save.c send.c set.c shell.c \
size.c source.c table.c top.c touch.c unalias.c undelete.c unset.c util.c \
var.c visual.c write.c z.c
......
......@@ -135,7 +135,7 @@ mail_cmdline(void *closure, int cont)
while (1)
{
if (!mailbox_is_updated (mbox))
if (util_find_env ("autoinc")->set && !mailbox_is_updated (mbox))
{
mailbox_messages_count (mbox, &total);
fprintf (ofile, "New mail has arrived\n");
......@@ -251,6 +251,7 @@ main (int argc, char **argv)
util_do_command ("set nosign");
util_do_command ("set noSign");
util_do_command ("set toplines=5");
util_do_command ("set autoinc");
/* GNU extensions to the environment, for sparky's sanity */
util_do_command ("set mode=read");
......@@ -267,7 +268,7 @@ main (int argc, char **argv)
/* read system-wide mail.rc and user's .mailrc */
if ((util_find_env ("rc"))->set)
util_do_command ("source %s", "/etc/mail.rc"); /*FIXME: configurable path*/
util_do_command ("source %s", SITE_MAIL_RC);
util_do_command ("source %s", getenv ("MAILRC"));
/* how should we be running? */
......