From fa1c9e13c8bae76993ec43f56685fa0057758579 Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Fri, 26 Oct 2018 21:53:36 +0200 Subject: [PATCH] read the defaultfolder from the profile context_read now creates the inbox specified in the profile, instand of create the compiletime default. --- sbr/context_read.c | 2 +- test/tests/config/test-inbox | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 test/tests/config/test-inbox diff --git a/sbr/context_read.c b/sbr/context_read.c index cfdcff2..51592a9 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -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 index 0000000..997e52e --- /dev/null +++ b/test/tests/config/test-inbox @@ -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 -- 1.7.10.4