bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Email


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Email
Date: Mon, 31 Mar 2003 11:07:23 +0300

Hi,

> There is message_create_attachment() function in mailutils
> but it can't attach file in existing message(message_t type).
> (Actually I don't know how to do it. =)

The function message_create_attachment only creates an attachment, it
does not actually attach it to another message. To attach a message,
use mime_add_part function. The scenario is:

1) Create a MIME object using mime_create
2) Create your attachments (either directly or using one of
the functions from attachment.c) and append them to the MIME
object using mime_add_part().
3) Call mime_get_message(). It will return the message object
associated with the MIME object. This is what you need: a message
with all the attachments included.

See the following sources for examples:

libsieve/actions.c        build_mime() function at line 126
mh/mhn.c                  edit_mime() at line 2156.

> IMHO, it should be added the functions about attach file.
> I.E, message_add_attachment(), message_remove_attachment() is needed.

I doubt if it would be a reasonable thing to do. Attachments should
be added to the MIME object, which helds all the information necessary
for the proper encapsulation. Message_t simply lacks the necessary
mechanisms, and it shouldn't have them, anyway.

Regards,
Sergey








reply via email to

[Prev in Thread] Current Thread [Next in Thread]