summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-12-30 12:48:07 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-12-30 12:48:07 +0000
commitdbd734c2f880516f75fa2d3985df3b4d9ef529c4 (patch)
tree288ab20cb5bc2c204dadf905a601b0ea36519d0a
parentf949b9c591afe6e0b2ef5874f49d69f168f0cf45 (diff)
downloadmailutils-dbd734c2f880516f75fa2d3985df3b4d9ef529c4.tar.gz
mailutils-dbd734c2f880516f75fa2d3985df3b4d9ef529c4.tar.bz2
* comsat/comsat.c: New config statement require-tty.
(main): Use /dev/null as the tty if require-tty is false.
-rw-r--r--ChangeLog3
-rw-r--r--comsat/comsat.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 230be5600..2587133eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-12-30 Sergey Poznyakoff <gray@gnu.org.ua>
+ * comsat/comsat.c: New config statement require-tty.
+ (main): Use /dev/null as the tty if require-tty is false.
+
* examples/config/comsat.conf: Remove obsolete example file.
* examples/config/mailutils.rc: Remove obsolete example file.
diff --git a/comsat/comsat.c b/comsat/comsat.c
index b2d7cebf4..61d2288dc 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -106,6 +106,7 @@ struct mu_gocs_daemon default_gocs_daemon = {
int maxlines = 5;
char hostname[MAXHOSTNAMELEN];
const char *username;
+int require_tty;
mu_acl_t comsat_acl;
static void comsat_init (void);
@@ -125,6 +126,8 @@ int test_mode;
struct mu_cfg_param comsat_cfg_param[] = {
{ "allow-biffrc", mu_cfg_bool, &allow_biffrc, 0, NULL,
N_("Read .biffrc file from the user home directory") },
+ { "require-tty", mu_cfg_bool, &require_tty, 0, NULL,
+ N_("Notify only if the user be logged on one of the ttys.") },
{ "max-lines", mu_cfg_int, &maxlines, 0, NULL,
N_("Maximum number of message body lines to be output.") },
{ "max-requests", mu_cfg_uint, &maxrequests, 0, NULL,
@@ -507,7 +510,11 @@ comsat_main (int fd)
}
if (find_user (buffer, tty) != SUCCESS)
- return 0;
+ {
+ if (require_tty)
+ return 0;
+ strcpy (tty, "/dev/null");
+ }
/* All I/O is done by child process. This is to avoid various blocking
problems. */

Return to:

Send suggestions and report system problems to the System administrator.