[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Munging mailboxes
From: |
Sam Roberts |
Subject: |
Re: Munging mailboxes |
Date: |
Sat, 15 Dec 2001 17:02:50 -0500 |
User-agent: |
Mutt/1.3.16i |
Bonjour,
Quoting Michael Schuerig <address@hidden>, who wrote:
> I'm interested in mailutils mostly for its mailbox/folder handling
> capabilities. Tasks I'd like to use it for are similar to this: Extract
> attachments from each message in a folder; save it to a file in some
> given directory; replace the attachment part of the original message
> with a link to the saved file.
mailutils hasn't been used for this kind of thing a lot, AFAIK, so the
APIs aren't always there, or publically exposed, or documented.
In this case there is a message_attachment_filename() that gets the
filename of the attachment, but it's not publically exposed. It, or
something like it, should be. message_save_attachment() has stub code
to use this name if you pass NULL for a filename, but there is what
looks like a bug preventing it being used this way. You could remove
the check for the filename arg being NULL and see how it works for you.
> What I don't yet understand is how to deal with attachments. I see that
> I can accessed the individual parts of a multipart message. But how do
> I get at the original filename and other attributes of an attached-file
> part?
I don't know of a way to do this, but its the kind of thing I'd like
to add when I have time. But I have very little time. Do you? :-)
> Also, how can I decode the part's contents and avoid reading it
> into memory entirely?
Not exactly sure what you mean here.
I don't think you can do anything but save a part decoded into a file,
so how would you get it into memory at all? And message_t uses temp
files a bunch, it seems, so it won't stick a whole message in memory.
> Obviously, programming tasks of this kind in C is somewhat tedious.
Hopefully not as tedious as the API matures!
> That's why I'm pondering wrapping the needed parts of mailutils in
> Ruby. Unless, by chance, someone has already done this.
No, but that would be really cool! I noticed Ruby's mailbox handling
wasn't very complete, and it didn't have imap support. I've been looking
for any excuse to do some work in Ruby. A side effect of doing this
is it might make hacking a test suite together a lot easier.
Bon chance,
Sam
--
Sam Roberts <address@hidden> (Vivez sans temps mort!)
- Munging mailboxes, Michael Schuerig, 2001/12/14
- Re: Munging mailboxes,
Sam Roberts <=
- Re: Munging mailboxes, Michael Schuerig, 2001/12/16
- Re: Munging mailboxes, Alain Magloire, 2001/12/16
- Re: Munging mailboxes, Sam Roberts, 2001/12/16
- Re: Munging mailboxes, Alain Magloire, 2001/12/16
- Re: Munging mailboxes, Jeff Bailey, 2001/12/16
- Re: Munging mailboxes, Alain Magloire, 2001/12/16
- Re: Munging mailboxes, Michael Schuerig, 2001/12/16
Re: Munging mailboxes, Sam Roberts, 2001/12/16