static int imap_check_acl (IMAP_DATA * idata);
static int imap_check_capabilities (IMAP_DATA * idata);
static void imap_set_flag (IMAP_DATA * idata, int aclbit, int flag,
static int imap_check_acl (IMAP_DATA * idata);
static int imap_check_capabilities (IMAP_DATA * idata);
static void imap_set_flag (IMAP_DATA * idata, int aclbit, int flag,
/* imap_get_flags: Make a simple list out of a FLAGS response.
* return stream following FLAGS response */
/* imap_get_flags: Make a simple list out of a FLAGS response.
* return stream following FLAGS response */
if (*s != '(') {
debug_print (1, ("bogus FLAGS response: %s\n", s));
return NULL;
}
/* create list, update caller's flags handle */
if (*s != '(') {
debug_print (1, ("bogus FLAGS response: %s\n", s));
return NULL;
}
/* create list, update caller's flags handle */
/* note bad flags response */
if (*s != ')') {
debug_print (1, ("Unterminated FLAGS response: %s\n", s));
/* note bad flags response */
if (*s != ')') {
debug_print (1, ("Unterminated FLAGS response: %s\n", s));
else if (ascii_strncasecmp ("OK [PERMANENTFLAGS", pc, 18) == 0) {
debug_print (2, ("Getting mailbox PERMANENTFLAGS\n"));
/* safe to call on NULL */
else if (ascii_strncasecmp ("OK [PERMANENTFLAGS", pc, 18) == 0) {
debug_print (2, ("Getting mailbox PERMANENTFLAGS\n"));
/* safe to call on NULL */
/* skip "OK [PERMANENT" so syntax is the same as FLAGS */
pc += 13;
if ((pc = imap_get_flags (&(idata->flags), pc)) == NULL)
/* skip "OK [PERMANENT" so syntax is the same as FLAGS */
pc += 13;
if ((pc = imap_get_flags (&(idata->flags), pc)) == NULL)
if (mutt_bit_isset (idata->rights, ACL_WRITE))
imap_add_keywords (flags, hdr, idata->flags, sizeof (flags));
if (mutt_bit_isset (idata->rights, ACL_WRITE))
imap_add_keywords (flags, hdr, idata->flags, sizeof (flags));
/* UW-IMAP is OK with null flags, Cyrus isn't. The only solution is to
* explicitly revoke all system flags (if we have permission) */
/* UW-IMAP is OK with null flags, Cyrus isn't. The only solution is to
* explicitly revoke all system flags (if we have permission) */
imap_set_flag (idata, ACL_WRITE, 1, "\\Answered ", flags, sizeof (flags));
imap_set_flag (idata, ACL_DELETE, 1, "\\Deleted ", flags, sizeof (flags));
imap_set_flag (idata, ACL_WRITE, 1, "\\Answered ", flags, sizeof (flags));
imap_set_flag (idata, ACL_DELETE, 1, "\\Deleted ", flags, sizeof (flags));
imap_quote_string (term, sizeof (term), delim);
mutt_buffer_addstr (buf, term);
break;
imap_quote_string (term, sizeof (term), delim);
mutt_buffer_addstr (buf, term);
break;
/* all this listing/browsing is a mess. I don't like that name is a pointer
* into idata->buf (used to be a pointer into the passed in buffer, just
* as bad), nor do I like the fact that the fetch is done here. This
/* all this listing/browsing is a mess. I don't like that name is a pointer
* into idata->buf (used to be a pointer into the passed in buffer, just
* as bad), nor do I like the fact that the fetch is done here. This
* FIXME. ?! */
int imap_parse_list_response (IMAP_DATA * idata, char **name, int *noselect,
int *noinferiors, char *delim)
* FIXME. ?! */
int imap_parse_list_response (IMAP_DATA * idata, char **name, int *noselect,
int *noinferiors, char *delim)
/* fire off command */
snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",
/* fire off command */
snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",