1MAIL::ACCOUNT::CREAT(3x)Cone: COnsole Newsreader And EMAIL::ACCOUNT::CREAT(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 mail::folder *f=mail->createFolder(const mail::folder *parentFolder,
15 std::string name,
16 bool createDirectory);
17
18 bool ok=mail->createFolder(const mail::folder *folder,
19 bool createDirectory);
20
21 std::string errmsg=mail->getErrmsg();
22
24 Most mail accounts support the ability to create and delete folders,
25 which are arranged in a tree-like hierarchy.
26 mail::ACCOUNT::createFolder creates a new folder. There are two
27 versions of this function.
28
29 The first version creates a subfolder of an existing folder,
30 parentFolder. name is the new folder´s name, in the application´s
31 character set. If the folder is succesfully created a mail::folder
32 object is returned that represents the newly-created folder (the
33 application is 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
37 mail::ACCOUNT::getFolderFromString(3x) or
38 mail::ACCOUNT::getFolderFromPath(3x)).
39
40 Note
41 createDirectory should be set to true to create a new folder
42 directory, and false for a regular folder. See
43 mail::folder::createSubFolder(3x) for more information.
44
45 Note
46 Some mail servers reserve certain characters which cannot be used
47 in folder names. IMAP mail servers use a special character (usually
48 "/" or ".") as a separator between names in a hierarchical folder
49 path. The actual character varies from server to server. An attempt
50 to create/rename a folder whose name includes a reserved character
51 will fail. Different IMAP servers use different hierarchy separator
52 characters. An attempt to create a folder may fail on one IMAP
53 server even if another IMAP server can succesfully create a folder
54 with the same name. This is, unfortunately, a design flaw in the
55 IMAP protocol.
56
57 Note
58 Maildir folders created by are compatible and can be read by the
59 Courier-IMAP[1] server. Names of maildir folders may contain any
60 character, including the characters ":", "/", ".", "~", and ":".
61 However, if the same folders are exported via IMAP, folders whose
62 name includes these characters may not be readable by some IMAP
63 clients. Even a
64
65
66
67 LibMAIL application may not be able to read one of these folders
68 via IMAP.
69
70 Note
71 Mbox mail folders created by
72
73
74
75 LibMAIL are mostly compatible and can be exported by IMAP servers
76 that read mbox-formatted mail folders (with some limitations, such
77 as that the same mbox folder cannot be open by
78
79
80
81 LibMAIL and another application at the same time). Names of mbox
82 folders can contain any character, including the characters "/",
83 and "~". However if mbox folders are exported via IMAP, folders
84 whose name includes these characters may not be readable by some
85 IMAP clients.
86
88 This first mail::ACCOUNT::createFolder function returns a NULL pointer
89 if it cannot create the new folder, for some reason; the second
90 mail::ACCOUNT::createFolder function returns false if it fails.
91
93 mail::ACCOUNT::getFolderFromPath(3x),
94 mail::ACCOUNT::getFolderFromString(3x),
95 mail::folder::createSubFolder(3x), mail::setAppCharset(3x).
96
98 1. Courier-IMAP
99 http://www.courier-mta.org
100
101
102
103[FIXME: source] 05/08/2010 MAIL::ACCOUNT::CREAT(3x)