/[mailutils]/mailutils/mailbox/pop/mbox.c
ViewVC logotype

Diff of /mailutils/mailbox/pop/mbox.c

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

revision 1.75 by polak, Wed May 14 21:46:58 2003 UTC revision 1.76 by polak, Mon May 19 18:46:33 2003 UTC
# Line 107  enum pop_state Line 107  enum pop_state
107  #define CAPA_SASL            0x00000080  #define CAPA_SASL            0x00000080
108  #define CAPA_STLS            0x00000100  #define CAPA_STLS            0x00000100
109  #define CAPA_IMPLEMENTATION  0x00000200  #define CAPA_IMPLEMENTATION  0x00000200
 static unsigned long capa;  
110    
111  static void pop_destroy        __P ((mailbox_t));  static void pop_destroy        __P ((mailbox_t));
112    
# Line 185  struct _pop_data Line 184  struct _pop_data
184    void *func;  /*  Indicate a command is in operation, busy.  */    void *func;  /*  Indicate a command is in operation, busy.  */
185    size_t id;   /* A second level of distincion, we maybe in the same function    size_t id;   /* A second level of distincion, we maybe in the same function
186                    but working on a different message.  */                    but working on a different message.  */
187      unsigned long capa; /* Server capabilities */
188    enum pop_state state;    enum pop_state state;
189    pop_message_t *pmessages;    pop_message_t *pmessages;
190    size_t pmessages_count;    size_t pmessages_count;
# Line 664  pop_open (mailbox_t mbox, int flags) Line 664  pop_open (mailbox_t mbox, int flags)
664    
665        if (!strncasecmp (mpd->buffer, "+OK", 3))        if (!strncasecmp (mpd->buffer, "+OK", 3))
666          {          {
667            capa = 0;            mpd->capa = 0;
668            do            do
669              {              {
670                status = pop_read_ack (mpd);                status = pop_read_ack (mpd);
# Line 682  pop_open (mailbox_t mbox, int flags) Line 682  pop_open (mailbox_t mbox, int flags)
682                   is an optional command in POP3. -- W.P. */                   is an optional command in POP3. -- W.P. */
683    
684                if (!strncasecmp (mpd->buffer, "TOP", 3))                if (!strncasecmp (mpd->buffer, "TOP", 3))
685                  capa |= CAPA_TOP;                  mpd->capa |= CAPA_TOP;
686                else if (!strncasecmp (mpd->buffer, "USER", 4))                else if (!strncasecmp (mpd->buffer, "USER", 4))
687                  capa |= CAPA_USER;                  mpd->capa |= CAPA_USER;
688                else if (!strncasecmp (mpd->buffer, "UIDL", 4))                else if (!strncasecmp (mpd->buffer, "UIDL", 4))
689                  capa |= CAPA_UIDL;                  mpd->capa |= CAPA_UIDL;
690                else if (!strncasecmp (mpd->buffer, "STLS", 4))                else if (!strncasecmp (mpd->buffer, "STLS", 4))
691                  capa |= CAPA_STLS;                  mpd->capa |= CAPA_STLS;
692              }              }
693            while (mpd->nl);            while (mpd->nl);
694          }          }
# Line 1381  pop_uid (message_t msg,  size_t *puid) Line 1381  pop_uid (message_t msg,  size_t *puid)
1381    
1382  /* Get the UIDL.  Client should be prepare since it may fail.  UIDL is  /* Get the UIDL.  Client should be prepare since it may fail.  UIDL is
1383     optional on many POP servers.     optional on many POP servers.
1384     FIXME:  We should check the "capa & CAPA_UIDL" and fall back to a md5 scheme ?     FIXME:  We should check the "mpd->capa & CAPA_UIDL" and fall back to
1385     Or maybe check for "X-UIDL" a la Qpopper ?  */     a md5 scheme ? Or maybe check for "X-UIDL" a la Qpopper ?  */
1386  static int  static int
1387  pop_uidl (message_t msg, char *buffer, size_t buflen, size_t *pnwriten)  pop_uidl (message_t msg, char *buffer, size_t buflen, size_t *pnwriten)
1388  {  {
# Line 1518  pop_top (header_t header, char *buffer, Line 1518  pop_top (header_t header, char *buffer,
1518    switch (mpd->state)    switch (mpd->state)
1519      {      {
1520      case POP_NO_STATE:      case POP_NO_STATE:
1521        if (capa & CAPA_TOP)        if (mpd->capa & CAPA_TOP)
1522          {          {
1523            status = pop_writeline (mpd, "TOP %d 0\r\n", mpm->num);            status = pop_writeline (mpd, "TOP %d 0\r\n", mpm->num);
1524            CHECK_ERROR (mpd, status);            CHECK_ERROR (mpd, status);

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26