From 89b7b67a13ebb7965cc7f13ad0595e2194a2d34c Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:48:04 +0200 Subject: add sqmail-4.2.29a --- src/maildirmake.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/maildirmake.c (limited to 'src/maildirmake.c') diff --git a/src/maildirmake.c b/src/maildirmake.c new file mode 100644 index 0000000..47edc44 --- /dev/null +++ b/src/maildirmake.c @@ -0,0 +1,24 @@ +#include +#include +#include "logmsg.h" +#include "exit.h" + +#define WHO "maildirmake" + +int main(int argc, char **argv) +{ + umask(077); + if (!argv[1]) + logmsg(WHO,100,USAGE,"maildirmake name"); + if (mkdir(argv[1],0700) == -1) + logmsg(WHO,111,FATAL,B("unable to mkdir: ",argv[1])); + if (chdir(argv[1]) == -1) + logmsg(WHO,111,FATAL,B("unable to chdir to: ",argv[1])); + if (mkdir("tmp",0700) == -1) + logmsg(WHO,111,FATAL,B("unable to mkdir: ",argv[1],"/tmp")); + if (mkdir("new",0700) == -1) + logmsg(WHO,111,FATAL,B("unable to mkdir: ",argv[1],"/new")); + if (mkdir("cur",0700) == -1) + logmsg(WHO,111,FATAL,B("unable to mkdir: ",argv[1],"/cur")); + _exit(0); +} -- cgit v1.2.3