diff options
author | June McEnroe <june@causal.agency> | 2020-04-10 11:33:04 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-04-10 11:33:04 -0400 |
commit | 5d2ea6d9d60a64579eb801a8e46ce7b65d1fbd1f (patch) | |
tree | a375f50c9594ba2ebb6195ab83a4845d817b764e /archive.c | |
parent | Use UIDNEXT to avoid asking IMAP to do any work (diff) | |
download | bubger-5d2ea6d9d60a64579eb801a8e46ce7b65d1fbd1f.tar.gz bubger-5d2ea6d9d60a64579eb801a8e46ce7b65d1fbd1f.zip |
Link mbox files into message/
Diffstat (limited to '')
-rw-r--r-- | archive.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/archive.c b/archive.c index 97bb99a..350fdfa 100644 --- a/archive.c +++ b/archive.c @@ -47,6 +47,11 @@ static void uidWrite(const char *path, uint32_t uid) { if (error) err(EX_IOERR, "%s", path); } +static void createDir(const char *path) { + int error = mkdir(path, 0775); + if (error && errno != EEXIST) err(EX_CANTCREAT, "%s", path); +} + int main(int argc, char *argv[]) { const char *host = NULL; const char *port = "imaps"; @@ -166,8 +171,8 @@ int main(int argc, char *argv[]) { if (!resp.data.len) { errx(EX_TEMPFAIL, "no messages matching %s", search); } - int error = mkdir("UID", 0775); - if (error && errno != EEXIST) err(EX_CANTCREAT, "UID"); + createDir("UID"); + createDir("message"); export = exportThreads(imap, resp.data); } |