Opened 3 years ago

Last modified 3 years ago

#1487090 reopened Feature Requests

threads view and sent mails

Reported by: vituko Owned by:
Priority: 5 Milestone: later
Component: Core functionality Version: 0.4.2
Severity: normal Keywords: folder, sent mail, threads
Cc:

Description

As suggested in forum, I move here a thread. The pasted code is to try to improve the thread functionality, for me is enough, so can be helpful for someone else. It could also be a start point to address this limitation in next releases.

xxx

Threads work well but I have a doubt about sent mails.

A thread is a conversation : sent and incoming mail. But by default each of these sets are in a diferent folder : sent and inbox, so the threads in each of these folders are incomplete. Have someone a suggestion to this issue? I think that sent mails, when belonging to a thread should appear in this folder (where the thread belongs to). Am I wrong?

xxx

Well, Ive seen how it works, with imap threads extension. I dont know the syntax of queries and maybe the server implementation could take care about this (Dovecot in my case). Any way the roundcube imap client could also do recursive queries of headers just to show the full conversations tree and maybe store the relationships in the db (caching).

But for me and now, the fastest workaround I found, was to use INBOX for sent_mbox (and maybe drafts_mbox). It was disabled by default (dont know why), I had to change a file :

program/steps/settings/func.inc -> function rcmail_user_prefs -> case 'folders': -> $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 'maxlength' => 30, 'exceptions' => array(/*'INBOX'*/)));

This could have further implications : maybe filters will also now apply to sent mails,... let's see. But conversations are very important for me and yes, just another suggestion : the message view could show the tipical mailing lists buttons : previous/next by date/thread.

xxx

Well, I realized that it wasnt so cool as expected : if I answer a mail that is not in inbox (cause of filters, for example) the answer goes anyway to my inbox. So this small change seems to correct this problem (Ive not really studied the code!!) :

program/steps/mail/sendmail.inc, line 581 :
--> Context :
Determine which folder to save message
if ($savedraft)
$store_target = $CONFIGdrafts_mbox?;
else { -> bracket added
$store_target = isset($_POST_store_target?) ? get_input_value('_store_target', RCUBE_INPUT_POST) : $CONFIGsent_mbox?;
--> Added :

if ((! empty ($_SESSIONcompose?reply_uid?)
! empty ($_SESSIONcompose?forward_uid?)) && ! empty ($_SESSIONcompose?mailbox?) && $store_target == 'INBOX')

$store_target = $_SESSIONcompose?mailbox? ;
}

The idea is to store the sent mails, when the preferences are INBOX and we are currently replying or forwarding to a previous message, in its same folder. It should be extended to drafts too... next time.

Change History (6)

comment:1 Changed 3 years ago by vituko

Sorry:

--> Context :
// Determine which folder to save message
if ($savedraft)
$store_target = $CONFIG['drafts_mbox'];
else { --> bracket added
$store_target = isset($_POST['_store_target']) ? get_input_value('_store_target', RCUBE_INPUT_POST) : $CONFIG['sent_mbox'];
--> Added :
if ((! empty ($_SESSION['compose']['reply_uid']) || ! empty ($_SESSION['compose']['forward_uid'])) && ! empty ($_SESSION['compose']['mailbox']) && $store_target == 'INBOX')
$store_target = $_SESSION['compose']['mailbox'] ;
}

comment:2 Changed 3 years ago by alec

  • Resolution set to duplicate
  • Status changed from new to closed

IMAP THREAD command works per-folder. As for now this will be not changed. The request to save sent messages in folder of replied message is a duplicate (plugin saveinsamefolder implements this).

comment:3 Changed 3 years ago by vituko

Ok, and where is this plugin or which is its exact name?

Just not found...

comment:4 Changed 3 years ago by alec

search for saveinsamefolder in plugins list on wiki.

comment:5 Changed 3 years ago by vituko

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Found, almost exactly the same fast approach that I found (but with the plugin api).

So yet far from being perfect : if I start a thread (sent) the answer (inbox) will be in a different folder, if the thread is in a special folder because of a subject filter, all is almost right, but if I move a thread, the next messages will continue to go to inbox, etc.

What I meant is a special treatment of threads as a unit : I want to still have all my sent mails in my sent folder when I work chronologically and so on, but in thread mode, the thread is where its last message is (and when in sent folder, also in the previous one : inbox... or indeed in every folder where theres a message). I also want a navigation bar in the message view : previous/next by date/thread and a more accesible way to switch between thread and chronological view in listing mode.

The imap threads way is maybe a limitation, but as said, recursive requests are a possibility and a caching db is another one.

Its a feature request, isnt it? So its the way a mail client should work (or allow doing it) for me, its not the gmail way but yes, it takes some ideas.

comment:6 Changed 3 years ago by alec

  • Component changed from Addressbook to Core functionality
Note: See TracTickets for help on using tickets.