[sylpheed:31464] Re: [Libsylph] Help for saving attached images

Hiroyuki Yamamoto hiro-y at kcn.ne.jp
Tue Jun 19 10:59:04 JST 2007


On Mon, 18 Jun 2007 17:29:15 +0200
Massimiliano Calamelli <mcalamelli at gmail.com> wrote:

> Hi, i need an help to understand how to save the images that are
> attached to an email. I'm browsing Sylpheed's code, but atm my tests
> are failed... I wish to find this feature in libsylph, but without
> translation it's hard to do. I've also tried to translate online docs
> with babelfish, but it the result isn't good. 

See mimeview.c::mimeview_save_as().

To save the attached files, you can use the following functions:

MimeInfo *procmime_scan_message         (MsgInfo        *msginfo);

gint procmime_get_part                  (const gchar    *outfile,
                                         const gchar    *infile,
                                         MimeInfo       *mimeinfo);

First, look for the MimeInfo tree and find the image part, and pass it
to procmime_get_part() to get the contents as a file.

Hiroyuki Yamamoto <hiro-y at kcn.ne.jp>

More information about the Sylpheed mailing list