/[imapfilter]/imapfilter/imap.c
ViewVC logotype

Diff of /imapfilter/imap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by lefcha, Fri Feb 13 12:17:16 2004 UTC revision 1.45 by lefcha, Sat Feb 14 19:14:43 2004 UTC
# Line 92  imap_capability(connection_t * conn) Line 92  imap_capability(connection_t * conn)
92    
93    
94  /*  /*
95   * IMAP NAMESPACE: discovers the prefix and delimeter of namespaces used by   * IMAP NAMESPACE: discovers the prefix and delimeter of namespaces used by the
96   * the server for mailboxes (RFC 2342).   * server for mailboxes (RFC 2342).
97   */   */
98  int  int
99  imap_namespace(connection_t * conn)  imap_namespace(connection_t * conn)
# Line 209  int imap_list(connection_t *conn, char * Line 209  int imap_list(connection_t *conn, char *
209    
210    
211  /*  /*
212   * IMAP SUBSCRIBE: adds the specified mailbox name to the server's   * IMAP SUBSCRIBE: adds the specified mailbox name to the server's set of
213   * set of "active" or "subscribed" mailboxes.   * "active" or "subscribed" mailboxes.
214   */   */
215  int  int
216  imap_subscribe(connection_t * conn, char *mbox)  imap_subscribe(connection_t * conn, char *mbox)
# Line 268  imap_status(connection_t * conn, char *m Line 268  imap_status(connection_t * conn, char *m
268          buffer_check(&obuf, strlen("STATUS") + strlen(mbox) +          buffer_check(&obuf, strlen("STATUS") + strlen(mbox) +
269              strlen(items) + 18);              strlen(items) + 18);
270    
271          snprintf(obuf.data, obuf.size, "%04X STATUS \"%s\" (%s)\r\n", tag, mbox, items);          snprintf(obuf.data, obuf.size, "%04X STATUS \"%s\" (%s)\r\n", tag,
272                mbox, items);
273    
274          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
275  }  }
# Line 302  imap_search(connection_t * conn, char *c Line 303  imap_search(connection_t * conn, char *c
303              strlen(search) + 15);              strlen(search) + 15);
304    
305          if (*charset)          if (*charset)
306                  snprintf(obuf.data, obuf.size, "%04X SEARCH CHARSET \"%s\" %s\r\n",                  snprintf(obuf.data, obuf.size,
307                      tag, charset, search);                      "%04X SEARCH CHARSET \"%s\" %s\r\n", tag, charset, search);
308          else          else
309                  snprintf(obuf.data, obuf.size, "%04X SEARCH %s\r\n", tag, search);                  snprintf(obuf.data, obuf.size, "%04X SEARCH %s\r\n", tag,
310                        search);
311    
312          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
313  }  }
# Line 319  imap_fetch(connection_t * conn, char *me Line 321  imap_fetch(connection_t * conn, char *me
321  {  {
322    
323          buffer_reset(&obuf);          buffer_reset(&obuf);
324          buffer_check(&obuf, strlen("FETCH") + strlen(mesg) + strlen(items) + 14);          buffer_check(&obuf,
325                strlen("FETCH") + strlen(mesg) + strlen(items) + 14);
326    
327          snprintf(obuf.data, obuf.size, "%04X FETCH %s %s\r\n", tag, mesg, items);          snprintf(obuf.data, obuf.size, "%04X FETCH %s %s\r\n", tag, mesg,
328                items);
329    
330          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
331  }  }
# Line 340  imap_store(connection_t * conn, char *me Line 344  imap_store(connection_t * conn, char *me
344    
345          snprintf(obuf.data, obuf.size, "%04X STORE %s %sFLAGS.SILENT (%s)\r\n",          snprintf(obuf.data, obuf.size, "%04X STORE %s %sFLAGS.SILENT (%s)\r\n",
346              tag, mesg, (mode == ACTION_FLAG_REPLACE ? "" :              tag, mesg, (mode == ACTION_FLAG_REPLACE ? "" :
347                  mode == ACTION_FLAG_ADD ? "+" : "-"), flags);              mode == ACTION_FLAG_ADD ? "+" : "-"), flags);
348    
349          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
350  }  }
# Line 356  imap_copy(connection_t * conn, char *mes Line 360  imap_copy(connection_t * conn, char *mes
360          buffer_reset(&obuf);          buffer_reset(&obuf);
361          buffer_check(&obuf, strlen("COPY") + strlen(mesg) + strlen(mbox) + 16);          buffer_check(&obuf, strlen("COPY") + strlen(mesg) + strlen(mbox) + 16);
362    
363          snprintf(obuf.data, obuf.size, "%04X COPY %s \"%s\"\r\n", tag, mesg, mbox);          snprintf(obuf.data, obuf.size, "%04X COPY %s \"%s\"\r\n", tag, mesg,
364                mbox);
365    
366          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
367  }  }
# Line 373  imap_append(connection_t * conn, char *m Line 378  imap_append(connection_t * conn, char *m
378          buffer_check(&obuf, strlen("APPEND") + strlen(mbox) + strlen(flags) +          buffer_check(&obuf, strlen("APPEND") + strlen(mbox) + strlen(flags) +
379              strlen(date) + strlen(ultostr(size, 10)) + 24);              strlen(date) + strlen(ultostr(size, 10)) + 24);
380    
381          snprintf(obuf.data, obuf.size, "%04X APPEND \"%s\" (%s) \"%s\" {%d}\r\n",          snprintf(obuf.data, obuf.size,
382              tag, mbox, flags, date, size);              "%04X APPEND \"%s\" (%s) \"%s\" {%d}\r\n", tag, mbox, flags, date,
383                size);
384    
385          return send_command(conn, obuf.data, NULL);          return send_command(conn, obuf.data, NULL);
386  }  }

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26