- if (strftime (time_str, sizeof (time_str),
- "%Y%m%d%H%M%S", &gm_time_tm) == 0) {
- fprintf (stderr, "Internal error formatting time\n");
- exit (1);
- }
+ gio_status = g_io_channel_seek_position (channel, body_offset,
+ G_SEEK_SET, &error);
+ if (gio_status != G_IO_STATUS_NORMAL) {
+ fprintf (stderr, "Error: %s\n", error->message);
+ exit (1);
+ }
+
+ gio_status = g_io_channel_read_to_end (channel, &body_str,
+ NULL, &error);
+ if (gio_status != G_IO_STATUS_NORMAL) {
+ fprintf (stderr, "Error: %s\n", error->message);
+ exit (1);
+ }
+
+ gen_terms (term_gen, "body", body_str);
+
+ g_free (body_str);
+ g_io_channel_close (channel);
+
+ from = g_mime_message_get_sender (message);
+ addresses = internet_address_list_parse_string (from);
+
+ add_terms_address_addrs (doc, addresses, "from_email");
+
+ add_terms_address_addrs (doc,
+ g_mime_message_get_all_recipients (message),
+ "to_email");