cURL / Mailing Lists / curl-users / Single Mail

curl-users

Questions about IMAP

From: Marcus Clyne <marcus_at_mobileaws.com>
Date: Wed, 22 Apr 2015 12:03:06 -0400

Hi,

I'm trying to create an email-scraping tool using IMAP on curl. I have
two questions:

1) What is the request to download the headers from an email in a
mailbox other than 'Inbox'? The current commands I've tried are like this:

e.g. if the mailbox is [Gmail]/Inbox

curl --request 'SELECT "[Gmail]/Important"; FETCH 1 BODY[HEADER]' --url
'imaps://imap.gmail.com/' ...
curl --request ' "[Gmail]/Important" FETCH 1 BODY[HEADER]' --url
'imaps://imap.gmail.com/' ...
curl --request "FETCH 1 BODY[HEADER] "[Gmail]/Important" ' --url
'imaps://imap.gmail.com/' ...
curl --request "FETCH 1 BODY[HEADER]' --url
'imaps://imap.gmail.com/[Gmail]/Important' ...

Note: I can SELECT the mailbox, and there are 3 emails listed in it.

2) What is the request for downloading a list of attachments for an email?

3) What is the request for downloading a specific email attachment for
an email?

Thanks for any help with any of these.

Marcus.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-04-22