Roundcube Community Forum

Miscellaneous => Roundcube Discussion => Topic started by: pratik_1712 on January 20, 2011, 03:55:55 AM

Title: Retrieve and set Email Header
Post by: pratik_1712 on January 20, 2011, 03:55:55 AM
I want to add additional headers to the sent emails and also to retrieve the same in the received ones..

How can this be implemented..??

Are there plugins available which does this already..??
If Not..
Guide me to appropriate resource..
Any help will be highly appreciated..

Thanks and Regards,
Pratik
Title: Retrieve and set Email Header
Post by: Julius Caesar on January 20, 2011, 05:03:29 AM
Have you tried installing the plugin 'show_additional_headers' ?
Title: Retrieve and set Email Header
Post by: pratik_1712 on January 22, 2011, 07:40:01 AM
Quote from: Julius Caesar;32593
Have you tried installing the plugin 'show_additional_headers' ?

@julius: I am familiar with the plugin.. Thanks anyway i went through it again.. was helpful..

What i am looking for is to retrieve a particular header and displaying it in the list of the mails, along with the sender name, subject, date, etc..

show_additional_headers retrieve them in the show or preview pane for a message at a time.. I need it to be in the main list and for all the message..

I am not sure do i have to make an ajax call.. or some other method..?? Any help is welcome..

Thanks and Regards,
Pratik
Title: Retrieve and set Email Header
Post by: pratik_1712 on January 22, 2011, 07:48:43 AM
i think i have to use this hook "mailboxes_list".. not sure though.. but if any plugin do use the same.. redirect me..???
Any other opinion..???
Title: Retrieve and set Email Header
Post by: rosali on January 24, 2011, 03:48:02 AM
Look into my calendar plugin.

Search for 'x-rc-attachment'.

To retrieve the additonal headers 'message_list' hook is the right hook.

To show additional columns in the message list you may want to look into
'chbox' plugin.
Title: Retrieve and set Email Header
Post by: pratik_1712 on January 24, 2011, 06:30:38 AM
I used 'chbox' plugin to learn about adding column sometimes back.. That is working fine..
I added few more functionalities to it as per need..
But the problem is to fetch a header('Reputation' already present in the mails) from all the mails and to display it in the column..
Any Help or Recommendation is Welcome..
Title: Retrieve and set Email Header
Post by: rosali on January 24, 2011, 06:49:51 AM
As mentioned check my calendar plugin hook 'messages_list'

In my case the IMAP server receives:

"IMAPD"   2156   272   "2011-01-24 09:24:28.078"   "127.0.0.1"   "RECEIVED: A0007 FETCH 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101 (UID RFC822.SIZE FLAGS INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE LIST-POST DISPOSITION-NOTIFICATION-TO USER-AGENT X-RC-ATTACHMENT USER-AGENT X-RC-ATTACHMENT LIST-HELP LIST-SUBSCRIBE LIST-UNSUBSCRIBE LIST-POST LIST-OWNER LIST-ARCHIVE)])"

... X-RC-ATTACHMENT ...

and returns that header!

Code: [Select]


in init section:

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

associated method:

  function pass_ics_header($p){
    if(is_array($p['messages'])){
      foreach($p['messages'] as $message){  
        if($message->others['x-rc-attachment']){
          $message->list_flags['extra_flags']['ics'] = 1;
        }
      }
    }
    return $p;
  }
Title: Retrieve and set Email Header
Post by: pratik_1712 on January 31, 2011, 04:08:27 AM
Do i have to make any changes in CSS for this..??
Its not displaying the flag..
Title: Retrieve and set Email Header
Post by: pratik_1712 on February 01, 2011, 01:00:41 AM
The 'ics' is used for what purpose..??
I am unable to comprehend the whole calendar plugin..
Any other plugin which uses the similar way for displaying header values at a go in the main page..??

Thanks and Regards,
Pratik
Title: Retrieve and set Email Header
Post by: pratik_1712 on February 01, 2011, 04:12:09 AM
Got it working.. Was doing something wrong with the variables..
Thanks for all the help..
It was very helpful..

Regards,
Pratik
Title: Retrieve and set Email Header
Post by: parkduyanh on July 13, 2011, 11:26:38 AM
Have you tried installing the plugin 'show_additional_headers' ?