aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/send-mail.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/send-mail.c b/tools/send-mail.c
index 6492c43c1..d348f28cb 100644
--- a/tools/send-mail.c
+++ b/tools/send-mail.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h> /* for X_OK */
#include "../common/util.h"
#include "../common/exectool.h"
@@ -36,6 +37,12 @@ run_sendmail (estream_t data)
const char pgmname[] = NAME_OF_SENDMAIL;
const char *argv[3];
+ if (!*pgmname || gnupg_access (pgmname, X_OK))
+ {
+ log_error ("sendmail tool '%s' is not correctly installed\n", pgmname);
+ return gpg_error (GPG_ERR_ENOENT);
+ }
+
argv[0] = "-oi";
argv[1] = "-t";
argv[2] = NULL;