- if (folder == NULL) {
- maildir = db_path;
- } else {
- strip_trailing (folder, '/');
- if (! is_valid_folder_name (folder)) {
- fprintf (stderr, "Error: invalid folder name: '%s'\n", folder);
- return EXIT_FAILURE;
- }
- maildir = talloc_asprintf (config, "%s/%s", db_path, folder);
- if (! maildir) {
- fprintf (stderr, "Out of memory\n");
- return EXIT_FAILURE;
- }
- if (create_folder && ! maildir_create_folder (config, maildir))
- return EXIT_FAILURE;
+ if (! is_valid_folder_name (folder)) {
+ fprintf (stderr, "Error: invalid folder name: '%s'\n", folder);
+ return EXIT_FAILURE;
+ }
+
+ maildir = talloc_asprintf (config, "%s/%s", db_path, folder);
+ if (! maildir) {
+ fprintf (stderr, "Out of memory\n");
+ return EXIT_FAILURE;