Append to INBOX if an explicit path wasn't supplied.
Showing
1 changed file
with
8 additions
and
2 deletions
... | @@ -889,9 +889,14 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) | ... | @@ -889,9 +889,14 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) |
889 | url_get_path (mailbox->url, NULL, 0, &n); | 889 | url_get_path (mailbox->url, NULL, 0, &n); |
890 | if (n == 0) | 890 | if (n == 0) |
891 | { | 891 | { |
892 | if (!(path = strdup ("INBOX"))) | ||
893 | { | ||
892 | free (abuf); | 894 | free (abuf); |
893 | return EINVAL; | 895 | return ENOMEM; |
896 | } | ||
894 | } | 897 | } |
898 | else | ||
899 | { | ||
895 | path = calloc (n + 1, sizeof (*path)); | 900 | path = calloc (n + 1, sizeof (*path)); |
896 | if (path == NULL) | 901 | if (path == NULL) |
897 | { | 902 | { |
... | @@ -900,6 +905,7 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) | ... | @@ -900,6 +905,7 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) |
900 | } | 905 | } |
901 | url_get_path (mailbox->url, path, n + 1, NULL); | 906 | url_get_path (mailbox->url, path, n + 1, NULL); |
902 | } | 907 | } |
908 | } | ||
903 | 909 | ||
904 | /* FIXME: we need to get the envelope_date and use it. | 910 | /* FIXME: we need to get the envelope_date and use it. |
905 | currently it is ignored. */ | 911 | currently it is ignored. */ |
... | @@ -970,7 +976,7 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) | ... | @@ -970,7 +976,7 @@ imap_append_message0 (mailbox_t mailbox, message_t msg) |
970 | MAILBOX_DEBUG0 (m_imap->mailbox, MU_DEBUG_PROT, f_imap->buffer); | 976 | MAILBOX_DEBUG0 (m_imap->mailbox, MU_DEBUG_PROT, f_imap->buffer); |
971 | 977 | ||
972 | default: | 978 | default: |
973 | /* mu_error ("imap_append: unknow state\n"); */ | 979 | /* mu_error ("imap_append: unknown state\n"); */ |
974 | break; | 980 | break; |
975 | } | 981 | } |
976 | f_imap->state = IMAP_NO_STATE; | 982 | f_imap->state = IMAP_NO_STATE; | ... | ... |
-
Please register or sign in to post a comment