Koozali.org: home of the SME Server

Viewing images in attached word documents in Horde

Offline holck

  • *
  • 322
  • +1/-0
Viewing images in attached word documents in Horde
« on: January 28, 2007, 09:26:09 PM »
I have previously posted how to do this in SME server version 6; this is a suggestion for version 7.1

When viewing attached word documents in Horde, pictures are not shown.
The reason, I found out, is that wvhtml writes embedded images in the /tmp directory, whereas the web server tries to find them in the /home/httpd/html/horde/imp/ directory.

I have made a few patches to make the images show, as explained below.

Copy the file 85HordeAccess from
Code: [Select]
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/
to
Code: [Select]

/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

Add the following lines to the new copy of 85HordeAccess, after the line
Code: [Select]
# Horde specific configuration files:
Code: [Select]
<Directory /tmp>
  <FilesMatch "msword.*">
     Order Allow,Deny
     Allow from all
  </FilesMatch>
</Directory>

Create the directory
Code: [Select]
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts
Copy the file 30WebMailAliases from
Code: [Select]
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/
to
Code: [Select]
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
after this line
Code: [Select]

        $OUT .= "    Alias       /$place   $dirs{$place}\n";

in the new copy of 30WebMailAliases, add the following two lines
Code: [Select]
       $OUT .= "    RewriteEngine on\n";
        $OUT .= "    RewriteRule ^/horde/imp/msword(.+) /tmp/msword\$1 [L]\n";

Expand the new template:
Code: [Select]
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf    
Restart httpd:
Code: [Select]
/etc/rc7.d/S86httpd-e-smith sigusr1
That is it, I hope it works. The solution opens a small security hole: if outsiders can guess the names of msword* files in the /tmp directory, they can read these files.
......

Offline gregswallow

  • *
  • 651
  • +1/-0
Viewing images in attached word documents in Horde
« Reply #1 on: February 02, 2007, 08:25:57 AM »
Pleas open a New Feature Request bug report against SME Server Future with all this info please.  Thanks.