Roundcube Community Forum


[SOLVED] Show real sender for shared "Sent Items" folder

Started by mkrc21, April 11, 2021, 06:43:07 AM

Previous topic - Next topic



I've configured RC to support shared folders (acl plugin together with dovecot) - which works perfectly.

But I'm searching for a way to display the real sender in the "fromto" for emails shown in a shared "Sent Items" folder, instead
of the user's email sharing this folder.

To clarify:

1) is sharing his Sent Items folder

2) subscribed to's shared Sent Items

3) Instead of the real sender always sees as sender for emails in the Sent Items folder

Can somebody please direct me in a way to solve this issue?

I'm glad to write a plugin - but I currently don't have a good starting point.

Ideally, the sender should only be adapted for subscriptions to shared "Sent Items" folders.

Thanks a lot.


Already found a solution after checking the plugin hooks.

I am using the messages_list hook for a custom plugin which works (surprise, suprise) as it should and I'm able
to change the sender accordingly.

Great, if something documented just works :)

In case you are interested here's the code:


 * Displays actual sender for e-mails in shared Sent folder.
 * @author Matthias Kerstner
class show_actual_sender_for_shared_sent_folder extends rcube_plugin
public $task 'mail';

$this->add_hook('messages_list', array($this'do_show_actual_sender_for_shared_sent_folder'));


foreach($args['messages'] as $msg) {   
  if(preg_match('#^shared\/[^\/]+\/Sent( Items)?$#'$msg->folder)) {
$msg->from $msg->to;