1mail::ACCOUNT::createmFaoilld:e:rA(C3CxO)UNT Synchronous APmIairle:f:eArCeCnOcUeNT::createFolder(3x)
2
3
4
6 mail::ACCOUNT::createFolder - Create a new folder
7
9 #include <libmail/sync.H>
10
11 mail::ACCOUNT *mail;
12 mail::folder *folder;
13
14
15
16 mail::folder *f=mail->createFolder (const mail::folder *parentFolder,
17 std::string name, bool createDirectory);
18
19 bool ok=mail->createFolder (const mail::folder *folder, bool createDi‐
20 rectory);
21
22 std::string errmsg=mail->getErrmsg();
23
25 Most mail accounts support the ability to create and delete folders,
26 which are arranged in a tree-like hierarchy. mail::ACCOUNT::create‐
27 Folder creates a new folder. There are two versions of this function.
28
29 The first version creates a subfolder of an existing folder, parent‐
30 Folder. name is the new folder's name, in the application's character
31 set. If the folder is succesfully created a mail::folder object is
32 returned that represents the newly-created folder (the application is
33 responsible for destroying the new mail::folder object).
34
35 The second version creates a new folder that's specified by an existing
36 mail::folder object (which is usually created by mail::ACCOUNT::get‐
37 FolderFromString(3x) or mail::ACCOUNT::getFolderFromPath(3x)).
38
39 Note: createDirectory should be set to true to create a new
40 folder directory, and false for a regular folder. See
41 mail::folder::createSubFolder(3x) for more information.
42
43 Note: Some mail servers reserve certain characters which cannot
44 be used in folder names. IMAP mail servers use a special char‐
45 acter (usually "/" or ".") as a separator between names in a
46 hierarchical folder path. The actual character varies from
47 server to server. An attempt to create/rename a folder whose
48 name includes a reserved character will fail. Different IMAP
49 servers use different hierarchy separator characters. An
50 attempt to create a folder may fail on one IMAP server even if
51 another IMAP server can succesfully create a folder with the
52 same name. This is, unfortunately, a design flaw in the IMAP
53 protocol.
54
55 Note: Maildir folders created by are compatible and can be read
56 by the Courier-IMAP server. Names of maildir folders may con‐
57 tain any character, including the characters ":", "/", ".", "~",
58 and ":". However, if the same folders are exported via IMAP,
59 folders whose name includes these characters may not be readable
60 by some IMAP clients. Even a LibMAIL application may not be
61 able to read one of these folders via IMAP.
62
63 Note: Mbox mail folders created by LibMAIL are mostly compatible
64 and can be exported by IMAP servers that read mbox-formatted
65 mail folders (with some limitations, such as that the same mbox
66 folder cannot be open by LibMAIL and another application at the
67 same time). Names of mbox folders can contain any character,
68 including the characters "/", and "~". However if mbox folders
69 are exported via IMAP, folders whose name includes these charac‐
70 ters may not be readable by some IMAP clients.
71
73 This first mail::ACCOUNT::createFolder function returns a NULL pointer
74 if it cannot create the new folder, for some reason; the second
75 mail::ACCOUNT::createFolder function returns false if it fails.
76
78 mail::ACCOUNT::getFolderFromPath(3x), mail::ACCOUNT::getFolderFrom‐
79 String(3x), mail::folder::createSubFolder(3x), mail::setAppCharset(3x).
80
81
82
83 10 April 2006 mail::ACCOUNT::createFolder(3x)