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

Diff of /imapfilter/imap.c

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

revision 1.13 by lefcha, Mon Sep 10 23:43:29 2001 UTC revision 1.14 by lefcha, Sun Sep 30 20:17:29 2001 UTC
# Line 24  int send_command(char *cmd) Line 24  int send_command(char *cmd)
24      printf("debug: sending command: %s", cmd);      printf("debug: sending command: %s", cmd);
25  #endif  #endif
26    
27      if (write(sock, cmd, strlen(cmd)) == -1) {      if (write(sock, cmd, strlen(cmd)) == -1)
28          error("imapfilter: error while sending command; %s",          fatal(ERROR_NETWORK, "imapfilter: error while sending command; %s",
29                strerror(errno));                strerror(errno));
         return 1;  
     }  
30    
31      return 0;      return 0;
32  }  }
# Line 84  int imap_login(char *user, char *pass) Line 82  int imap_login(char *user, char *pass)
82    
83  /*  /*
84   * IMAP EXAMINE: access a mailbox in READ-ONLY mode.   * IMAP EXAMINE: access a mailbox in READ-ONLY mode.
85   */   *
86  int imap_examine(char *mbox)  int imap_examine(char *mbox)
87  {  {
88      char cmd[MEDIUM_CMD];      char cmd[MEDIUM_CMD];
# Line 94  int imap_examine(char *mbox) Line 92  int imap_examine(char *mbox)
92      snprintf(cmd, MEDIUM_CMD, "%X EXAMINE \"%s\"\r\n", tag++, mbox);      snprintf(cmd, MEDIUM_CMD, "%X EXAMINE \"%s\"\r\n", tag++, mbox);
93    
94      return send_command(cmd);      return send_command(cmd);
95  }  }*/
   
96    
97    
98  /*  /*
# Line 162  int imap_search(char *search) Line 159  int imap_search(char *search)
159  /*  /*
160   * IMAP FETCH: retrieves data associated with a message.   * IMAP FETCH: retrieves data associated with a message.
161   */   */
162  int imap_fetch(char *mesg, char *headers)  int imap_fetch(int peek, char *mesg, char *headers)
163  {  {
164      char cmd[MEDIUM_CMD];      char cmd[MEDIUM_CMD];
165    
166      verbose("Client request:  FETCH\n");      verbose("Client request:  FETCH\n");
167    
168      snprintf(cmd, MEDIUM_CMD,      snprintf(cmd, MEDIUM_CMD,
169               "%X FETCH %s BODY[HEADER.FIELDS (%s)]\r\n", tag++, mesg,               "%X FETCH %s BODY%s[HEADER.FIELDS (%s)]\r\n", tag++, mesg,
170               headers);               (peek ? ".PEEK" : ""), headers);
171    
172      return send_command(cmd);      return send_command(cmd);
173  }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26