title: Deleting a message over imap using curl
body: <p>I am working on a project where I need to read messages in an inbox on an imap server, process it and then delete the email from the inbox. </p>
  
  <p>I can successufully get the email without any issue, the problem I am having is the delete. </p>
  
  <p>I can fetch the email using the following:</p>
  
  <pre><code>curl --url "imaps://imap.gmail.com:993/inbox;UID=1" --user "user:password"
  </code></pre>
  
  <p>This works perfectly fine for getting the email, I successfully process it without issue so now when I try and delete it I use the following:</p>
  
  <pre><code>curl --url "imaps://imap.gmail.com:993/inbox;UID=1" --user "user:password" -X 'UID STORE 1 +Flags \Deleted'
  </code></pre>
  
  <p>But I then get the following response:</p>
  
  <pre><code>curl: (21) Quote command returned error
  curl: (6) Could not resolve host: STORE
  curl: (6) Could not resolve host: 1
  curl: (6) Could not resolve host: +Flags
  curl: (6) Could not resolve host: \Deleted'
  </code></pre>