On Tue, 08 Feb 2011 08:26:09 +0100, A.L.E.C wrote:
> On 07.02.2011 23:14, Julien Vehent wrote:
>
> rcube_imap must know what headers do you expect.
>
>> // get dspam signature header (%s macro)
>> if(preg_match("/%s/",$command)){
>
> $RCMAIL->imap->fetch_add_headers .= ' x-dspam-signature';
>
>>      $MESSAGE = new rcube_message($uid);
>>      $dspam_signature = $MESSAGE->get_header('x-dspam-signature');
>

 Hi alec,
 It gives me a strange behavior. It works when I mark as spam (fetch the 
 x-dspam-signature, execute the command and move the message to Junk 
 special folder).
 But when I do the opposite (mark as ham, from Junk to Inbox), it 
 doesn't fetch the signature.

 The block of code should is the same. So I don't understand.

 -------
  // get dspam signature header (if %s macro is used)
  if(preg_match("/%s/",$command)){

     $rcmail->imap->fetch_add_headers .= ' x-dspam-signature';
     $MESSAGE = new rcube_message($uid);
     $dspam_signature = $MESSAGE->get_header('x-dspam-signature');

     $tmp_command = str_replace('%s', $dspam_signature,$command);
 }
 exec($tmp_command, $output);
 -------

 Note that when I parse directly the raw message using a regex, It works 
 both ways.

> or set 'fetch_headers' variable of imap_init hook. See
> show_additional_headers plugin.

 I can't use imap_init hook in the markasjunk2 driver.


 Thanks
 Julien
_______________________________________________
List info: http://lists.roundcube.net/dev/
BT/8f4f07cd

Reply via email to