--with-mail-rc option: set path to system-wide mail.rc file
Showing
3 changed files
with
17 additions
and
6 deletions
... | @@ -36,6 +36,15 @@ AC_ARG_WITH(readline, | ... | @@ -36,6 +36,15 @@ AC_ARG_WITH(readline, |
36 | *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;; | 36 | *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;; |
37 | esac],[usereadline=yes]) | 37 | esac],[usereadline=yes]) |
38 | 38 | ||
39 | AC_SUBST(SITE_MAIL_RC) | ||
40 | AC_ARG_WITH(mail-rc, | ||
41 | [ --with-mail-rc=FILE use FILE instead of $sysconfdir/mail.rc], | ||
42 | [case "${withval}" in | ||
43 | /*) SITE_MAIL_RC="${withval}";; | ||
44 | *) SITE_MAIL_RC="\$(sysconfdir)/${withval}";; | ||
45 | esac], | ||
46 | [SITE_MAIL_RC="\$(sysconfdir)/mail.rc"]) | ||
47 | |||
39 | AC_ARG_WITH(db2, | 48 | AC_ARG_WITH(db2, |
40 | [ --with-db2 use Berkeley DB], | 49 | [ --with-db2 use Berkeley DB], |
41 | [case "${withval}" in | 50 | [case "${withval}" in | ... | ... |
1 | AUTOMAKE_OPTIONS = ../lib/ansi2knr no-dependencies | 1 | AUTOMAKE_OPTIONS = ../lib/ansi2knr no-dependencies |
2 | 2 | ||
3 | INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/lib @ARGPINCS@ | 3 | INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/lib @ARGPINCS@ |
4 | AM_CFLAGS = -DSITE_MAIL_RC=\"@SITE_MAIL_RC@\" | ||
4 | 5 | ||
5 | bin_PROGRAMS = mail | 6 | bin_PROGRAMS = mail |
6 | 7 | ||
... | @@ -9,7 +10,7 @@ mail_LDADD = @ARGPLIBS@ ../mailbox/libmailbox.la ../lib/libmailutils.a \ | ... | @@ -9,7 +10,7 @@ mail_LDADD = @ARGPLIBS@ ../mailbox/libmailbox.la ../lib/libmailutils.a \ |
9 | 10 | ||
10 | mail_SOURCES = alias.c alt.c cd.c copy.c delete.c dp.c echo.c \ | 11 | mail_SOURCES = alias.c alt.c cd.c copy.c delete.c dp.c echo.c \ |
11 | edit.c eq.c exit.c file.c folders.c followup.c from.c headers.c help.c \ | 12 | edit.c eq.c exit.c file.c folders.c followup.c from.c headers.c help.c \ |
12 | hold.c if.c list.c mail.c mail.h mailline.c mbox.c next.c pipe.c previous.c \ | 13 | hold.c if.c inc.c list.c mail.c mail.h mailline.c mbox.c next.c pipe.c \ |
13 | print.c quit.c reply.c retain.c save.c send.c set.c shell.c size.c source.c \ | 14 | previous.c print.c quit.c reply.c retain.c save.c send.c set.c shell.c \ |
14 | table.c top.c touch.c unalias.c undelete.c unset.c util.c var.c visual.c \ | 15 | size.c source.c table.c top.c touch.c unalias.c undelete.c unset.c util.c \ |
15 | write.c z.c | 16 | var.c visual.c write.c z.c | ... | ... |
... | @@ -135,7 +135,7 @@ mail_cmdline(void *closure, int cont) | ... | @@ -135,7 +135,7 @@ mail_cmdline(void *closure, int cont) |
135 | 135 | ||
136 | while (1) | 136 | while (1) |
137 | { | 137 | { |
138 | if (!mailbox_is_updated (mbox)) | 138 | if (util_find_env ("autoinc")->set && !mailbox_is_updated (mbox)) |
139 | { | 139 | { |
140 | mailbox_messages_count (mbox, &total); | 140 | mailbox_messages_count (mbox, &total); |
141 | fprintf (ofile, "New mail has arrived\n"); | 141 | fprintf (ofile, "New mail has arrived\n"); |
... | @@ -251,6 +251,7 @@ main (int argc, char **argv) | ... | @@ -251,6 +251,7 @@ main (int argc, char **argv) |
251 | util_do_command ("set nosign"); | 251 | util_do_command ("set nosign"); |
252 | util_do_command ("set noSign"); | 252 | util_do_command ("set noSign"); |
253 | util_do_command ("set toplines=5"); | 253 | util_do_command ("set toplines=5"); |
254 | util_do_command ("set autoinc"); | ||
254 | 255 | ||
255 | /* GNU extensions to the environment, for sparky's sanity */ | 256 | /* GNU extensions to the environment, for sparky's sanity */ |
256 | util_do_command ("set mode=read"); | 257 | util_do_command ("set mode=read"); |
... | @@ -267,7 +268,7 @@ main (int argc, char **argv) | ... | @@ -267,7 +268,7 @@ main (int argc, char **argv) |
267 | 268 | ||
268 | /* read system-wide mail.rc and user's .mailrc */ | 269 | /* read system-wide mail.rc and user's .mailrc */ |
269 | if ((util_find_env ("rc"))->set) | 270 | if ((util_find_env ("rc"))->set) |
270 | util_do_command ("source %s", "/etc/mail.rc"); /*FIXME: configurable path*/ | 271 | util_do_command ("source %s", SITE_MAIL_RC); |
271 | util_do_command ("source %s", getenv ("MAILRC")); | 272 | util_do_command ("source %s", getenv ("MAILRC")); |
272 | 273 | ||
273 | /* how should we be running? */ | 274 | /* how should we be running? */ | ... | ... |
-
Please register or sign in to post a comment