cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: POP3 how to save attachment into the file

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Sun, 16 Mar 2014 18:59:11 +0000

On Sun, 16 Mar 2014, Petr Láznovský wrote:

> Using this command to retrieve single message from POP3
> server, got me message header, text and than (probably
> BASE64) encoded attachment.
>
> curl.exe -l -u user_at_host.com:password pop3://mainserver --request "RETR
3174"

Note: There isn't any need to issue a custom request for retrieving a
message, 3174 as the path part of the URL will perform the same ;-)

> Is there any switch to decode and save attachment or should
> I parse output and pipe file part to some decoder?

You need to parse the output yourself. E-mail messages can be quite
complicated as a message can contain a sub-message, that contains a
sub-message that contains several sub-messages (for example when you have
both plain and html content with several file attachments or inline images)
and as the e-mail protocols are still in their infancy this hasn't been
built into curl yet.

Kind Regards

Steve

-------------------------------------------------------------------
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 2014-03-16