/* * Fetch the FLAGS of the messages. */ int request_fetchflags(session *ssn, const char *mesg, char **flags) { int t, r; TRY(t = send_request(ssn, "UID FETCH %s FLAGS", mesg)); TRY(r = response_fetchflags(ssn, t, flags)); return r; }
/* * Fetch the FLAGS of the messages. */ int request_fetchflags(const char *server, const char *port, const char *user, const char *mesg, char **flags) { int t, r; session *s; if (!(s = session_find(server, port, user))) return -1; t = imap_fetch(s, mesg, "FLAGS"); if ((r = response_fetchflags(s, t, flags)) == -1) goto fail; return r; fail: close_connection(s); session_destroy(s); return -1; }