349 |
* IMAP APPEND: append message to the end of a mailbox. |
* IMAP APPEND: append message to the end of a mailbox. |
350 |
*/ |
*/ |
351 |
int |
int |
352 |
imap_append(conn_t * conn, char *mbox, unsigned int size) |
imap_append(conn_t * conn, char *mbox, char *flags, char *date, unsigned int size) |
353 |
{ |
{ |
354 |
reset_buffer(&obuf); |
reset_buffer(&obuf); |
355 |
check_buffer(&obuf, strlen("APPEND") + strlen(mbox) + |
check_buffer(&obuf, strlen("APPEND") + strlen(mbox) + strlen(flags) + |
356 |
strlen(ultostr(size, 10)) + 18); |
strlen(date) + strlen(ultostr(size, 10)) + 24); |
357 |
|
|
358 |
snprintf(obuf.data, obuf.size, "%04X APPEND \"%s\" {%d}\r\n", tag, mbox, |
snprintf(obuf.data, obuf.size, "%04X APPEND \"%s\" (%s) \"%s\" {%d}\r\n", |
359 |
size); |
tag, mbox, flags, date, size); |
360 |
|
|
361 |
return send_command(conn, obuf.data); |
return send_command(conn, obuf.data); |
362 |
} |
} |