[sylpheed:32866] Re: Display an e-mail from an arbitrary file

Hiroyuki Yamamoto hiro-y at kcn.ne.jp
Mon Feb 16 11:06:31 JST 2009


Hello,

On Sun, 15 Feb 2009 00:59:22 +0100
Jan Stępień <jan at stepien.cc> wrote:

> I'm wondering whether there's a possibility to display an e-mail
> stored in a file outside of Sylpheed's mailboxes. What I am thinking
> of is an option to enter a path to a file (via File/Open or command
> line argument) which would be opened in a MessageView. I tried to
> experiment with "--open" argument but it seems that it isn't what
> I've been looking for.

It is not implemented yet.

> Assuming that no such option may exist yet, I've started to browse the
> source trying to find a place to begin hacking. Setting
> msginfo->file_path field to an e-mail's path at the beginning of
> messageview_show function enabled me to force Sylpheed to display any
> file that I've pointed it to. Unfortunately without taking care of the
> rest of msginfo's fields the e-mail had not been rendered correctly,
> as the data that remained in the struct caused some problems. For
> example, the character encoding used to be incorect or multi-part
> messages were displayed as ordinary ones. Due to lack of knowledge of
> how to create, modify and use MsgInfo struct I've been unable to make
> it work. Having no available documentation, I've tried to figure it
> out by browsing the source but I've came to a conclusion that asking
> for help here may speed up the process significantly.
> 
> Unless the feature I'm writing about already exists, I'd like to ask
> you if you could send me some hints regarding where I should look for
> inspiration and what issues should I keep in mind before beginning to
> code. Any advice would be very welcome.

I've written a similar code recently for the remote POP3 mailbox.
Check src/rpop3.c: rpop3_retr_recv(), which temporarily stores a message
on POP3 server, and parses and displays it.

        msginfo = procheader_parse_file(file, flags, FALSE);
        msginfo->file_path = g_strdup(file);

        msgview = messageview_create_with_new_window();
        messageview_show(msgview, msginfo, FALSE);

There is a documentation of LibSylph, but it is still only in Japanese.

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


More information about the Sylpheed mailing list