-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611504
% sendmail -t -i -fReturn-Path: /dev/null@alea.gnuu.de
sendmail: recipients with -t option not supported
% echo $?
0
The call above is wrong, I know, but ssmtp doesn't tell so via exit code
which makes the caller, e.g. PHP, think everything was fine. This is not
good. Ssmtp should return with an exit code different from zero.
This function on handling error exit with success 0.
void paq(char *format, ...)
{
va_list ap;
va_start(ap, format);
(void)vfprintf(stderr, format, ap);
va_end(ap);
exit(0);
}
Define error codes for all instance of paq usage.
example:
typedef enum error_code {
NO_RCPT //No recipients supplied - mail will not be sent,
RCPT_MINUS_T //recipients with -t option not supported,
...
} error_code_t
enum of error code with change in the function.
void paq(error_code_t error_code, char *format, ...)
{
va_list ap;
va_start(ap, format);
(void)vfprintf(stderr, format, ap);
va_end(ap);
exit(error_code);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers