cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: POP3 how to save attachment into the file

From: Petr Lázňovský <lazna_at_volny.cz>
Date: Sun, 16 Mar 2014 23:43:16 +0100

> 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.

Thank for reply, I just found cool utility which simply extract attached file(s) from saved email file:

http://www.fpx.de/fp/Software/UUDeview/

uudeview.exe -q -i message.eml

This command save attachment from message contained single attachment into UNKNOWN.001 file.

L.

-------------------------------------------------------------------
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