From: Philipp Takacs Date: Fri, 26 Oct 2018 19:53:36 +0000 (+0200) Subject: read the defaultfolder from the profile X-Git-Tag: mmh-0.4~17 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=fa1c9e13c8bae76993ec43f56685fa0057758579 read the defaultfolder from the profile context_read now creates the inbox specified in the profile, instand of create the compiletime default. --- 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