read the defaultfolder from the profile
authorPhilipp Takacs <philipp@bureaucracy.de>
Fri, 26 Oct 2018 19:53:36 +0000 (21:53 +0200)
committerPhilipp Takacs <philipp@bureaucracy.de>
Sun, 25 Nov 2018 13:29:17 +0000 (14:29 +0100)
context_read now creates the inbox specified in the profile,
instand of create the compiletime default.

sbr/context_read.c
test/tests/config/test-inbox [new file with mode: 0644]

index cfdcff2..51592a9 100644 (file)
@@ -137,7 +137,7 @@ context_read(void)
        /*
        ** Create the default folder (inbox)
        */
-       cp = toabsdir(defaultfolder);
+       cp = toabsdir(getdeffol());
        if (stat(cp, &st) == -1) {
                if (!makedir(cp)) {
                        adios(EX_CANTCREAT, cp, "Unable to create the default folder");
diff --git a/test/tests/config/test-inbox b/test/tests/config/test-inbox
new file mode 100644 (file)
index 0000000..997e52e
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+######################################################
+#
+# Test the creation of the inbox
+#
+######################################################
+
+export MMHP="$MH_TEST_DIR/profile2"
+rm -rf "$MH_TEST_DIR/Mail2"
+printf "Path: %s\n" "$MH_TEST_DIR/Mail2" > "$MMHP"
+
+< /dev/null | folder > /dev/null
+if [ ! -d "$MH_TEST_DIR/Mail2" ]; then
+       exit 1
+fi
+
+if [ ! -d "$MH_TEST_DIR/Mail2/inbox" ]; then
+       exit 1
+fi
+
+folder -create +test > /dev/null
+rmdir "$MH_TEST_DIR/Mail2/inbox"
+
+printf "inbox: testinbox\n" >> $MMHP
+< /dev/null | folder > /dev/null
+if [ ! -d "$MH_TEST_DIR/Mail2/testinbox" ]; then
+       exit 1
+fi
+
+if [ -d "$MH_TEST_DIR/Mail2/inbox" ]; then
+       exit 1
+fi