Exemplo n.º 1
0
int mailimap_acl_deleteacl_send(mailstream * fd,
        const char * mailbox,
        const char * identifier)
{
  int r;

  r = mailimap_token_send(fd, "DELETEACL");
  if (r != MAILIMAP_NO_ERROR)
	  return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_mailbox_send(fd, mailbox);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_acl_identifier_send(fd, identifier);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 2
0
static int mailimap_xlist_send(mailstream * fd,
                               const char * mb, const char * list_mb)
{
  int r;
  
  r = mailimap_token_send(fd, "XLIST");
  if (r != MAILIMAP_NO_ERROR)
    return r;
  
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  
  r = mailimap_mailbox_send(fd, mb);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  
  r = mailimap_list_mailbox_send(fd, list_mb);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  
  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 3
0
int mailimap_acl_listrights_send(mailstream * fd,
        const char * mailbox,
        const char * identifier)
{
  int r;

  r = mailimap_token_send(fd, "LISTRIGHTS");
  if (r != MAILIMAP_NO_ERROR)
	  return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_mailbox_send(fd, mailbox);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_acl_identifier_send(fd, identifier);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 4
0
int mailimap_acl_myrights_send(mailstream * fd,
        const char * mailbox)
{
  int r;

  r = mailimap_token_send(fd, "MYRIGHTS");
  if (r != MAILIMAP_NO_ERROR)
	  return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_mailbox_send(fd, mailbox);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 5
0
int mailimap_acl_getacl_send(mailstream * fd,
        const char * mailbox)
{
  int r;

  r = mailimap_token_send(fd, "GETACL");
  if (r != MAILIMAP_NO_ERROR)
	  return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_mailbox_send(fd, mailbox);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 6
0
int mailimap_acl_setacl_send(mailstream * fd,
        const char * mailbox,
        const char * identifier,
        const char * mod_rights)
{
  int r;

  r = mailimap_token_send(fd, "SETACL");
  if (r != MAILIMAP_NO_ERROR)
	  return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_mailbox_send(fd, mailbox);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_acl_identifier_send(fd, identifier);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  r = mailimap_acl_mod_rights_send(fd, mod_rights);
  if (r != MAILIMAP_NO_ERROR)
    return r;

  return MAILIMAP_NO_ERROR;
}
Exemplo n.º 7
0
int mailimap_select_qresync_send(mailstream * fd, const char * mb,
  uint32_t uidvalidity, uint64_t modseq_value,
  struct mailimap_set * known_uids,
  struct mailimap_set * seq_match_data_sequences,
  struct mailimap_set * seq_match_data_uids)
{
  int r;
  
  /*
  select-param        =  "QRESYNC" SP "(" uidvalidity SP
  mod-sequence-value [SP known-uids]
  [SP seq-match-data] ")"
  */
  
  r = mailimap_token_send(fd, "SELECT");
  if (r != MAILIMAP_NO_ERROR)
    return r;
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  r = mailimap_mailbox_send(fd, mb);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
	r = mailimap_token_send(fd, "QRESYNC");
	if (r != MAILIMAP_NO_ERROR)
		return r;
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
	r = mailimap_oparenth_send(fd);
	if (r != MAILIMAP_NO_ERROR)
		return r;
  r = mailimap_number_send(fd, uidvalidity);
	if (r != MAILIMAP_NO_ERROR)
		return r;
  r = mailimap_space_send(fd);
  if (r != MAILIMAP_NO_ERROR)
    return r;
  r = mailimap_mod_sequence_value_send(fd, modseq_value);
	if (r != MAILIMAP_NO_ERROR)
		return r;
	if (known_uids != NULL) {
    r = mailimap_space_send(fd);
    if (r != MAILIMAP_NO_ERROR)
      return r;
    r = mailimap_set_send(fd, known_uids);
    if (r != MAILIMAP_NO_ERROR)
      return r;
  }
  if ((seq_match_data_sequences != NULL) && (seq_match_data_uids != NULL)) {
    r = mailimap_space_send(fd);
    if (r != MAILIMAP_NO_ERROR)
      return r;
    /* seq-match-data      =  "(" known-sequence-set SP known-uid-set ")" */
  	r = mailimap_oparenth_send(fd);
  	if (r != MAILIMAP_NO_ERROR)
  		return r;
    r = mailimap_set_send(fd, seq_match_data_sequences);
    if (r != MAILIMAP_NO_ERROR)
      return r;
    r = mailimap_space_send(fd);
    if (r != MAILIMAP_NO_ERROR)
      return r;
    r = mailimap_set_send(fd, seq_match_data_uids);
    if (r != MAILIMAP_NO_ERROR)
      return r;
  	r = mailimap_cparenth_send(fd);
  	if (r != MAILIMAP_NO_ERROR)
  		return r;
  }
	r = mailimap_cparenth_send(fd);
	if (r != MAILIMAP_NO_ERROR)
		return r;
	
  return MAILIMAP_NO_ERROR;
}