rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | README | LICENSE

imap.h (2887B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #ifndef __IMAP_H__
      7 #define __IMAP_H__
      8 
      9 #include "net.h"
     10 #include "llist.h"
     11 #include "parser.h"
     12 
     13 typedef struct imap_t imap_t;
     14 struct imap_t {
     15 	net_t *fd;
     16 	int msgid;
     17 
     18 	char *netspec;
     19 	char *user;
     20 	char *pass;
     21 
     22 	char *imaperror;
     23 
     24 	char *selected;
     25 
     26 	int starttls;
     27 
     28 	llist_t *caps;
     29 	parser_t *parser;
     30 };
     31 
     32 imap_t *imap_new(char *netspec, char *user, char *pass);
     33 void imap_free(imap_t *imap);
     34 
     35 int imap_isstratom(char *key);
     36 
     37 void imap_die(imap_t *imap, char *fmt, ...);
     38 
     39 llist_t *imap_llist2ids(char *cfgn, char *mailbox, llist_t *ids);
     40 llist_t *imap_str2ids(char *cfgn, char *mailbox, char *str);
     41 llist_t *imap_argv2ids(char *cfgn, char *mailbox, int argc, char *argv[]);
     42 char *imap_ids2str(llist_t *ids);
     43 
     44 void imap_cmd(imap_t *imap, char *cmd, ...);
     45 void imap_simplecmd(imap_t *imap, char *cmd);
     46 int imap_parseline(imap_t *imap, llist_t **ret);
     47 int imap_result(imap_t *imap, llist_t **ret);
     48 int imap_simpleresult(imap_t *imap);
     49 
     50 int imap_connect(imap_t *imap);
     51 int imap_closefolder(imap_t *imap);
     52 void imap_close(imap_t *imap);
     53 int imap_capabilityset(imap_t *imap, llist_t *retcaps);
     54 int imap_capability(imap_t *imap);
     55 int imap_starttls(imap_t *imap);
     56 int imap_authenticate(imap_t *imap);
     57 int imap_init(imap_t *imap);
     58 
     59 int imap_append(imap_t *imap, char *mb, llist_t *flags, char *tdate,
     60 		char *msg);
     61 int imap_noop(imap_t *imap);
     62 int imap_logout(imap_t *imap);
     63 int imap_expunge(imap_t *imap);
     64 int imap_copy(imap_t *imap, llist_t *ids, char *tomb);
     65 int imap_createfolder(imap_t *imap, char *mb);
     66 int imap_deletefolder(imap_t *imap, char *mb);
     67 llist_t *imap_fetch(imap_t *imap, llist_t *ids, char *req);
     68 llist_t *imap_fetchprepare(imap_t *imap, llist_t *ids, char *req);
     69 llist_t *imap_fetchbody(imap_t *imap, llist_t *ids);
     70 llist_t *imap_fetchheaders(imap_t *imap, llist_t *ids);
     71 llist_t *imap_fetchpart(imap_t  *imap, llist_t *ids, char *part);
     72 llist_t *imap_fetchraw(imap_t *imap, llist_t *ids);
     73 llist_t *imap_status(imap_t *imap, char *mb);
     74 llist_t *imap_listresponse(imap_t *imap, char *cmd);
     75 llist_t *imap_subscribed(imap_t *imap);
     76 llist_t *imap_listfolders(imap_t *imap);
     77 llist_t *imap_statuses(imap_t *imap);
     78 int imap_renamefolder(imap_t *imap, char *old, char *new);
     79 llist_t *imap_search(imap_t *imap, char *pattern);
     80 llist_t *imap_sort(imap_t *imap, char *criteria, char *pattern);
     81 llist_t *imap_thread(imap_t *imap, char *algorithm, char *pattern);
     82 int imap_select(imap_t *imap, char *mb);
     83 int imap_store(imap_t *imap, llist_t *ids, char *item, llist_t *flags);
     84 int imap_setflags(imap_t *imap, llist_t *ids, llist_t *flags);
     85 int imap_delflags(imap_t *imap, llist_t *ids, llist_t *flags);
     86 llist_t *imap_getflags(imap_t *imap, llist_t *ids);
     87 int imap_delete(imap_t *imap, llist_t *ids);
     88 int imap_move(imap_t *imap, llist_t *ids, char *mb);
     89 int imap_subscribe(imap_t *imap, char *mb);
     90 int imap_unsubscribe(imap_t *imap, char *mb);
     91 
     92 #endif
     93