-
-/*
- * rcvstore.c -- asynchronously add mail to a folder
+/* rcvstore.c -- asynchronously add mail to a folder
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
#include <fcntl.h>
#include <h/signals.h>
#include <h/mts.h>
+#include <h/utils.h>
+#include "../sbr/m_maildir.h"
+#include "../sbr/m_mktemp.h"
+#include "../sbr/makedir.h"
#define RCVSTORE_SWITCHES \
X("create", 0, CRETSW) \
struct msgs *mp;
struct stat st;
- if (nmh_init(argv[0], 1)) { return 1; }
+ if (nmh_init(argv[0], 2)) { return 1; }
done=unlink_done;
/* don't add file if it is empty */
if (st.st_size == 0) {
(void) m_unlink (tmpfilenam);
- advise (NULL, "empty file");
+ inform("empty file");
done (0);
}
* Link message into folder, and possibly add
* to the Unseen-Sequence's.
*/
- if ((msgnum = folder_addmsg (&mp, tmpfilenam, 0, unseensw, 0, 0, (char *)0)) == -1)
+ if ((msgnum = folder_addmsg (&mp, tmpfilenam, 0, unseensw, 0, 0, NULL)) == -1)
done (1);
/*
/*
* Clean up and exit
*/
-static void
+static void NORETURN
unlink_done(int status)
{
if (tmpfilenam && *tmpfilenam)