bug-mailutils
[Top][All Lists]
Advanced

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

Re: [bug-mailutils] Email


From: md
Subject: Re: [bug-mailutils] Email
Date: Mon, 31 Mar 2003 17:17:53 -0500

Sergey:

Your working knowledge of this library is probably more
efficient than my ability to sift through a lot of source code.

The biggest issue I have with mailutils is figuring out what each
component like
address and mime object actually do.

This request is something I am sure many people would want to get
started using the library
and learning the layout of the code.

Maybe you could give a quick function sequence requirement for the
following scenarios:

1) Send message with attachment

A) Create message
B) In C code, determine the from and to addresses
B) add file attachment as mime encoded
C) send message to SMTP server using a password to gain access to send

I have been looking at mail.remote example for some time and it seems to
want get from standard input
during mailer_send_message( ) .

What I am interested is providing the data for the subject, the body,
and a file for the attachment,
then sending to a SMTP server with a username and password.

Of course, this would involve no user involvement at all

2) Retrieve message from POP3 server and decode mime-encoded attachment
to a file.

A) Log in to pop3 server
B) Retrieve messages from server
B) obtain from, to, and subject information
C) decode MIME attached file into file on disk

Thanks for any response you can offer.

Mark Diener



Sergey Poznyakoff wrote:
> 
> 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
> 
> _______________________________________________
> Bug-mailutils mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-mailutils





reply via email to

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