a non-existant folder.
test/bad-input/test-header \
test/burst/test-burst test/burst/test-burst-mime \
test/comp/test-comp-format test/dist/test-dist \
- test/folder/test-create test/folder/test-packf \
- test/folder/test-recurse test/folder/test-sortm \
- test/folder/test-total \
+ test/folder/test-create test/folder/test-nocreate \
+ test/folder/test-packf test/folder/test-recurse \
+ test/folder/test-sortm test/folder/test-total \
test/format/test-curses test/format/test-dp \
test/format/test-fmtdump test/format/test-functions \
test/format/test-localmbox test/format/test-myname \
- Added support to send(1) to specify switches to post(1) based on address or
domain name in From: header line in message draft.
- post(8) -snoop now attempts to decode base64-encoded SMTP traffic.
+- folder(1) -nocreate now prints a warning message for a non-existant folder.
-----------------
OBSOLETE FEATURES
-.TH FOLDER %manext1% "January 1, 2001" "%nmhversion%"
+.TH FOLDER %manext1% "August 29, 2016" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.B \-nocreate
will cause
.B folder
-to exit
+to print an error message and exit
without creating a non-existant folder.
.\"
.\" note - this doesn't work at present
--- /dev/null
+#!/bin/sh
+######################################################
+#
+# Test -nocreate.
+#
+######################################################
+
+if test -z "${MH_OBJ_DIR}"; then
+ srcdir=`dirname "$0"`/../..
+ MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+set +e
+run_test 'run_prog folder -nocreate +testfolder 2>&1' \
+ 'folder: folder testfolder does not exist'
+set -e
+if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then
+ printf %s "folder should not have been created"
+ exit 1
+fi
+
+exit ${failed:-0}
static int sfold (struct msgs *, char *);
static void readonly_folders (void);
+/*
+ * Function for printing error message if folder does not exist with
+ * -nocreate.
+ */
+void
+nonexistant_folder (int status) {
+ NMH_UNUSED (status);
+ adios (NULL, "folder %s does not exist", folder);
+}
+
int
main (int argc, char **argv)
* Check if folder exists. If not, then see if
* we should create it, or just exit.
*/
- create_folder (m_maildir (folder), fcreat, done);
+ create_folder (m_maildir (folder), fcreat, nonexistant_folder);
if (get_folder_info (folder, msg) && argfolder) {
/* update current folder */