From 3a71aa3308d05f8896d0722ae49f3daf7311598c Mon Sep 17 00:00:00 2001 From: ncopa Date: Mon, 14 Apr 2008 12:12:38 +0000 Subject: check that sendmail exist --- src/sendbug.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/sendbug.c') diff --git a/src/sendbug.c b/src/sendbug.c index abe6aad..f9fe290 100644 --- a/src/sendbug.c +++ b/src/sendbug.c @@ -31,6 +31,9 @@ #ifndef _PATH_DMESG #define _PATH_DMESG "/var/log/dmesg" #endif +#ifndef _PATH_SENDMAIL +#define _PATH_SENDMAIL "/usr/sbin/sendmail" +#endif #define _DEFAULT_CONFIG "/etc/sendbug/sendbug.conf" int checkfile(const char *); @@ -96,6 +99,12 @@ main(int argc, char *argv[]) time_t mtime; FILE *fp; + if (access(_PATH_SENDMAIL, R_OK | X_OK) == -1) { + warn("sendmail"); + fprintf(stderr, "Please run 'setup-sendbug' to configure sendbug\n"); + return ret; + } + config_file = NULL; while ((ch = getopt(argc, argv, "a:c:dLPV")) != -1) switch (ch) { -- cgit v1.2.3