1.4.0-a3
o Fix a potential crash with mail without separator between headers and body
+ o mlmmj-send: accept file descriptor number as -s argument
1.4.0-a2
o Fix a crash with forged probe emails
o mlmmj-send does not need anymore absolute path
#include <stdio.h>
#include <stdlib.h>
+#include <sys/limits.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
struct mail mail = { 0 };
struct ml ml;
int subdirfd, mailfd;
+ const char *errp;
log_set_name(argv[0]);
ml_init(&ml);
mail.addtohdr = statctrl(ml.ctrlfd, "addtohdr");
/* FALLTHROUGH */
case '4': /* sending mails to subfile */
- if((subfd = open(subfilename, O_RDONLY)) < 0) {
+ subfd = strtoim(subfilename, 0, INT_MAX, &errp);
+ if (errp != NULL && (subfd = open(subfilename, O_RDONLY)) < 0) {
log_error(LOG_ARGS, "Could not open '%s':",
subfilename);
exit(EXIT_FAILURE);