Curl_safefree(imapc->mailbox);
Curl_safefree(imapc->mailbox_uidvalidity);
+ /* Check we have a mailbox */
+ if(!imap->mailbox) {
+ failf(conn->data, "Cannot SELECT without a mailbox.");
+ return CURLE_URL_MALFORMAT;
+ }
+
/* Make sure the mailbox is in the correct atom format */
mailbox = imap_atom(imap->mailbox);
if(!mailbox)
struct IMAP *imap = conn->data->state.proto.imap;
char *mailbox;
+ /* Check we have a mailbox */
+ if(!imap->mailbox) {
+ failf(conn->data, "Cannot APPEND without a mailbox.");
+ return CURLE_URL_MALFORMAT;
+ }
+
/* Check we know the size of the upload */
if(conn->data->set.infilesize < 0) {
failf(conn->data, "Cannot APPEND with unknown input file size\n");
static CURLcode imap_do(struct connectdata *conn, bool *done)
{
CURLcode result = CURLE_OK;
- struct IMAP *imap;
*done = FALSE; /* default to false */
if(result)
return result;
- imap = conn->data->state.proto.imap;
-
/* Parse the URL path */
result = imap_parse_url_path(conn);
if(result)
if(result)
return result;
- /* Check we have a mailbox for FETCH and APPEND commands */
- if(!imap->custom && !imap->mailbox) {
- failf(conn->data, "FETCH and APPEND require a mailbox.");
- return CURLE_URL_MALFORMAT;
- }
-
result = imap_regular_transfer(conn, done);
return result;