Changeset 1383:48430ce6f7b2
- Timestamp:
- 1999-11-22 08:01:39 (9 years ago)
- Branch:
- HEAD
- Files:
-
- 12 modified
-
OPS (modified) (3 diffs)
-
browser.c (modified) (3 diffs)
-
functions.h (modified) (1 diff)
-
imap/BUGS (modified) (2 diffs)
-
imap/README (modified) (1 diff)
-
imap/TODO (modified) (3 diffs)
-
imap/imap.c (modified) (3 diffs)
-
imap/imap.h (modified) (1 diff)
-
imap/imap_private.h (modified) (1 diff)
-
imap/message.c (modified) (1 diff)
-
imap/util.c (modified) (5 diffs)
-
pgppubring.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OPS
r1306 r1383 7 7 OP_BROWSER_VIEW_FILE "view file" 8 8 OP_BROWSER_TELL "display the currently selected file's name" 9 OP_BROWSER_SUBSCRIBE "subscribe to current mailbox (IMAP Only)"10 OP_BROWSER_UNSUBSCRIBE "unsubscribe to current mailbox (IMAP Only)"11 OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP Only)"9 OP_BROWSER_SUBSCRIBE "subscribe to current mailbox (IMAP only)" 10 OP_BROWSER_UNSUBSCRIBE "unsubscribe to current mailbox (IMAP only)" 11 OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP only)" 12 12 OP_CHANGE_DIRECTORY "change directories" 13 13 OP_CHECK_NEW "check mailboxes for new mail" … … 48 48 OP_DECODE_SAVE "make decoded copy (text/plain) and delete" 49 49 OP_DELETE "delete the current entry" 50 OP_DELETE_MAILBOX "delete the current mailbox (IMAP only)" 50 51 OP_DELETE_SUBTHREAD "delete all messages in subthread" 51 52 OP_DELETE_THREAD "delete all messages in thread" … … 113 114 OP_MAIN_UNTAG_PATTERN "untag messages matching a pattern" 114 115 OP_MIDDLE_PAGE "move to the middle of the page" 116 OP_NEW_MAILBOX "create a new mailbox (IMAP only)" 115 117 OP_NEXT_ENTRY "move to the next entry" 116 118 OP_NEXT_LINE "scroll down one line" -
browser.c
r1349 r1383 338 338 state->entry = (struct folder_file *) safe_malloc (sizeof (struct folder_file) * state->entrymax); 339 339 memset (state->entry, 0, sizeof (struct folder_file) * state->entrymax); 340 #ifdef USE_IMAP 341 state->imap_browse = 0; 342 #endif 340 343 if (menu) 341 344 menu->data = state->entry; … … 597 600 menu->tag = file_tag; 598 601 599 menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER, FolderHelp); 602 menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER, 603 FolderHelp); 600 604 601 605 init_menu (&state, menu, title, sizeof (title), buffy); … … 794 798 mutt_ungetch (0, OP_CHECK_NEW); 795 799 break; 800 801 case OP_NEW_MAILBOX: 802 mutt_error (_("Creating mailboxes is not yet supported.")); 803 break; 804 805 case OP_DELETE_MAILBOX: 806 if (!mx_is_imap (state.entry[menu->current].name)) 807 mutt_error (_("Delete is only supported for IMAP mailboxes")); 808 else 809 { 810 char msg[LONG_STRING]; 811 char* mbox; 812 int nentry = menu->current; 813 814 imap_parse_path (state.entry[nentry].name, NULL, 0, NULL, 815 NULL, &mbox); 816 snprintf (msg, sizeof (msg), _("Really delete mailbox \"%s\"?"), 817 mbox); 818 if (mutt_yesorno (msg, M_NO) == M_YES) 819 { 820 if (!imap_delete_mailbox (Context, mbox)) 821 { 822 /* free the mailbox from the browser */ 823 safe_free ((void **) &((state.entry)[nentry].name)); 824 safe_free ((void **) &((state.entry)[nentry].desc)); 825 /* and move all other entries up */ 826 if (nentry+1 < state.entrylen) 827 memmove (state.entry + nentry, state.entry + nentry + 1, 828 sizeof (struct folder_file) * (state.entrylen - (nentry+1))); 829 state.entrylen--; 830 mutt_message _("Mailbox deleted."); 831 init_menu (&state, menu, title, sizeof (title), buffy); 832 MAYBE_REDRAW (menu->redraw); 833 } 834 } 835 else 836 mutt_message _("Mailbox not deleted."); 837 } 838 break; 796 839 #endif 797 840 -
functions.h
r1349 r1383 328 328 { "view-file", OP_BROWSER_VIEW_FILE, " " }, 329 329 #ifdef USE_IMAP 330 { "new-mailbox", OP_NEW_MAILBOX, "n" }, 331 { "delete-mailbox", OP_DELETE_MAILBOX, "d" }, 330 332 { "subscribe", OP_BROWSER_SUBSCRIBE, "s" }, 331 333 { "unsubscribe", OP_BROWSER_UNSUBSCRIBE, "u" }, -
imap/BUGS
r1343 r1383 1 1 In no particular order: 2 3 * Mutt doesn't detect when a mailbox has only been opened read-only 4 (because, say, another process has it open), so it lets you store 5 changes that it can't commit. 6 --> just pick up the [READ-ONLY] in the tagged response, set mutt's flag 7 8 * ~h searches download the entire folder, setting everything to \Seen in 9 the process. 10 --> Use SEARCH? or at least try to use .PEEK when doing scans. I've been 11 thinking of going to always PEEK anyway, but then you'd have to store 12 updates for every message you touched. Maybe a config option? 2 13 3 14 * No checks are performed on long commands to make sure that they are … … 41 52 42 53 Brendan Cully <brendan@kublai.com> 43 Updated 199911 0254 Updated 19991110 -
imap/README
r1310 r1383 26 26 * Preserve message keywords 27 27 * Preserve deleted messages if you don't choose to expunge them 28 * Delete mailboxes (from the browser) -
imap/TODO
r1282 r1383 28 28 PRIORITY: [** ] 29 29 30 * See if we can't add more info to the IMAP browser than just name (without 31 incurring too much overhead). eg which folders contain new mail, size, 32 number of messages. 33 34 PRIORITY: [** ] 35 30 36 [ -- speed -- ] 31 37 * Persistent caching of data. I think the nicest way to do this is to store … … 42 48 the server changes its file format, bad things might happen. Could be 43 49 worked around with a specific Mutt header in all messages, probably. 50 51 PRIORITY: [* ] 52 53 * Instead of testing for the existence of a mailbox for APPEND, just append 54 and create/retry on failure. This is only a small bandwidth savings, but 55 it should be easy. 44 56 45 57 PRIORITY: [* ] … … 61 73 62 74 Brendan Cully <brendan@kublai.com> 63 Updated: 1999 091175 Updated: 19991119 -
imap/imap.c
r1373 r1383 43 43 static int imap_check_capabilities (IMAP_DATA *idata); 44 44 45 int imap_create_mailbox (CONTEXT* ctx, char* mailbox) 46 { 47 char buf[LONG_STRING], mbox[LONG_STRING]; 48 49 imap_quote_string (mbox, sizeof (mbox), mailbox); 50 snprintf (buf, sizeof (buf), "CREATE %s", mbox); 51 52 if (imap_exec (buf, sizeof (buf), CTX_DATA, buf, 0) != 0) 53 { 54 imap_error ("imap_create_mailbox()", buf); 55 return -1; 56 } 57 return 0; 58 } 59 60 int imap_delete_mailbox (CONTEXT* ctx, char* mailbox) 61 { 62 char buf[LONG_STRING], mbox[LONG_STRING]; 63 64 imap_quote_string (mbox, sizeof (mbox), mailbox); 65 snprintf (buf, sizeof (buf), "DELETE %s", mbox); 66 67 if (imap_exec (buf, sizeof (buf), CTX_DATA, buf, 0) != 0) 68 { 69 imap_error ("imap_delete_mailbox", buf); 70 return -1; 71 } 72 73 return 0; 74 } 75 45 76 void imap_set_logout (CONTEXT *ctx) 46 77 { … … 713 744 } 714 745 715 int imap_create_mailbox (IMAP_DATA* idata, char* mailbox)716 {717 char buf[LONG_STRING], mbox[LONG_STRING];718 719 imap_quote_string (mbox, sizeof (mbox), mailbox);720 snprintf (buf, sizeof (buf), "CREATE %s", mbox);721 722 if (imap_exec (buf, sizeof (buf), idata, buf, 0) != 0)723 {724 imap_error ("imap_create_mailbox()", buf);725 return (-1);726 }727 return 0;728 }729 730 746 int imap_open_mailbox_append (CONTEXT *ctx) 731 747 { … … 799 815 return (-1); 800 816 } 801 if (imap_create_mailbox ( idata, mailbox) < 0)817 if (imap_create_mailbox (ctx, mailbox) < 0) 802 818 { 803 819 return (-1); -
imap/imap.h
r1373 r1383 23 23 #include "mailbox.h" 24 24 25 /* imap.c */ 25 26 int imap_check_mailbox (CONTEXT *ctx, int *index_hint); 27 int imap_create_mailbox (CONTEXT* idata, char* mailbox); 26 28 int imap_close_connection (CONTEXT *ctx); 29 int imap_delete_mailbox (CONTEXT* idata, char* mailbox); 27 30 int imap_open_mailbox (CONTEXT *ctx); 28 31 int imap_open_mailbox_append (CONTEXT *ctx); -
imap/imap_private.h
r1373 r1383 150 150 /* -- private IMAP functions -- */ 151 151 /* imap.c */ 152 int imap_create_mailbox (IMAP_DATA* idata, char* mailbox);153 152 int imap_make_msg_set (char* buf, size_t buflen, CONTEXT* ctx, int flag, 154 153 int changed); -
imap/message.c
r1373 r1383 581 581 return -1; 582 582 } 583 if (imap_create_mailbox ( CTX_DATA, mbox) < 0)583 if (imap_create_mailbox (ctx, mbox) < 0) 584 584 return -1; 585 585 } -
imap/util.c
r1373 r1383 129 129 130 130 /* set default port */ 131 *port = 0; 131 if (port) 132 *port = 0; 132 133 if (socktype) 133 134 *socktype = M_NEW_SOCKET; … … 136 137 return -1; 137 138 pc++; 138 n = 0; 139 while (*pc && *pc != '}' && *pc != ':' && *pc != '/' && (n < hlen-1)) 140 host[n++] = *pc++; 141 host[n] = 0; 142 /* catch NULL hosts */ 143 if (!*host) 139 /* skip over the entire host, but copy in only what we have room for */ 140 for (n = 0; *pc && *pc != '}' && *pc != ':' && *pc != '/'; pc++) 141 if (n+1 < hlen) 142 host[n++] = *pc; 143 if (hlen) 144 host[n] = 0; 145 146 /* catch NULL hosts, unless we're deliberately not parsing them */ 147 if (hlen && !*host) 144 148 { 145 149 dprint (1, (debugfile, "imap_parse_path: NULL host in %s\n", path)); … … 158 162 c = *pc; 159 163 *pc = '\0'; 160 *port = atoi (pt); 161 if (!port) 164 if (port) 165 *port = atoi (pt); 166 if (port && !*port) 162 167 { 163 168 dprint (1, (debugfile, "imap_parse_path: bad port in %s\n", path)); … … 179 184 if (socktype) 180 185 *socktype = M_NEW_SSL_SOCKET; 181 if ( !*port)186 if (port && !*port) 182 187 *port = IMAP_SSL_PORT; 183 188 } else … … 188 193 pc++; 189 194 190 if ( !*port)195 if (port && !*port) 191 196 *port = IMAP_PORT; 192 197 -
pgppubring.c
r1348 r1383 134 134 } 135 135 136 pgpring_find_candidates (kring, argv + optind, argc - optind);136 pgpring_find_candidates (kring, (const char**) argv + optind, argc - optind); 137 137 138 138 return 0;
