<<< Date Index >>>     <<< Thread Index >>>

What search function to use? What function changes mailboxes?



Hello,

I'm trying to implement a new feature that I need in order to make the most use 
of my e-mail. What I want is for mutt to search the All Mail folder from gmail 
imap when I use the parent-message action on an e-mail. All Mail is an imap 
folder contains all the e-mail I've received and sended so far; the reason for 
what I want is so that I can remove e-mails from my inbox while keeping them in 
All Mail. When I get a new e-mail from a thread that's not in my inbox anymore, 
I'd like to be able to retrieve the whole conversation. As far as I know the 
only way to do that would be by changing mutt's code. If it's a configurable, 
then I would be very happy to know how to configure it :-).

In order to implement that I was looking for a function that would take a 
string such as "~i message-id@xxxxxx" and give me back a HEADER. I'm kinda lost 
in the flow of things. I think imap_search is what will end up being called, 
but I probably need to call something higher up. I probably need to switch to 
All Mail folder (before doing the search) and then switch back, is that 
correct? If so, what functions should I look at? Is there a developer manual 
somewhere I didn't look?

I want to implement it like this:
    1. User press P
    2. Take the message-id from the current message
    3. Look All Mail for that message-id
    4. Do the normal algorithm for getting the parent on All Mail folder
    5. Copy the parent to inbox folder
    6. Do again the normal algorithm for getting the parent, but this time on 
Inbox

I know message-id is set by the sender of the email and could be non-unique, 
but I don't know of a better identifier than that. Worst that could happen is 
not being able to retrieve the parent e-mail for some thread.

[]'s
Rafael