[imp] trailer.txt with multuple domains

Rich Lafferty rich@horde.org
Wed, 21 Mar 2001 09:54:12 -0500


On Wed, Mar 21, 2001 at 01:59:55PM +0100, Jorge Izquierdo (jizquierdo@sgi.es) wrote:
> I would like if it´s posible to switch to different trailer.txt files on the
> same IMP system depending on the domain a server is dealing with. I mean, if
> I´m using a virtual domain it should be added to my messages a trailer
> different than when I´m using another one.
> 
> Could anyone give me some hints on how doing this? Is posible anything
> similar to this operation?

You can't do it as-is out of the box. If you know PHP at all, you
might be able to get away with modifying horde/imp/compose.php3 where
it reads 

   $config_trailer = "\n" . implode(@file('./config/trailer.txt'),  '');

to read something like (and this is off the top of my head, so I
strongly encourage testing it first)

   $config_trailer = "\n" . implode(@file('./config/trailer-'.$imp->server.'.txt'), '');

and then if your (IMAP) servers are mail.foo.com and mail.bar.net, have files
names "trailer-mail.foo.com.txt" and "trailer-mail.bar.com.txt" in
horde/imp/config/. Of course, if you wanted to use something other
than the IMAP server as the condition, then you'd just stick in
another variable. 

If that works (test it! I haven't!) then it should hold you over. I'm
going to bring up the idea of making all of those included files
PHP-parsed rather than just parsed for a few environment variables.
(I'm not sure if that's a good idea or not, yet.)

  -Rich

-- 
------------------------------ Rich Lafferty ---------------------------
 Sysadmin/Programmer, Instructional and Information Technology Services
   Concordia University, Montreal, QC                 (514) 848-7625
------------------------- rich@alcor.concordia.ca ----------------------