1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-21 10:09:57 +01:00

tools: Return a better error message if sendmail is not usable.

* tools/send-mail.c: Include unistd.h
(run_sendmail): Check for bad sendmail.
--

GnuPG-bug-id: 6321
This commit is contained in:
Werner Koch 2023-02-08 08:23:31 +01:00
parent 103acfe9ca
commit 3ab6538433
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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;