On Friday 11 July 2003 15:28, Jesse Guardiani wrote: > On Friday 11 July 2003 14:27, Sam Varshavchik wrote: > > Jesse Guardiani writes: > > > Does that make sense? > > > > > > Do you think it's valuable functionality? I do because it will make > > > installing alternate or additional templates much easier. > > > > Yes, I already applied it. > > OK, great. I'm preparing a documentation patch to compliment the two > patches you've accepted now. I hope to finish it by the end of the day.
Here's the INSTALL.html patch. See attached. I think we might want to break this and the Domain-based template section out into a separate README.templates.html file in the future, but this should work for now. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net
--- INSTALL.html.old Fri Jul 11 16:58:23 2003 +++ INSTALL.html Fri Jul 11 16:41:12 2003 @@ -27,7 +27,9 @@ options</a></li> <li><a href="#changepass">Password changes</a></li> <li><a href="#runtime">Runtime configuration</a></li> + <li><a href="#sessiontimeouts">Adjusting session timeouts</a></li> <li><a href="#domaintemps">Domain-based templates</a></li> + <li><a href="#nametemps">Name-based templates</a></li> <li><a href="#shared">Shared folders</a></li> <li><a href="#ldapabook">LDAP address books</a></li> <li><a href="#filters">Mail Filtering</a></li> @@ -959,7 +961,7 @@ Additional timezones can be entered into this file to be shown on the login screen.</p> -<h2><a name="domaintemps" id="domaintemps">Adjusting session timeouts</a></h2> +<h2><a name="sessiontimeouts" id="sessiontimeouts">Adjusting session timeouts</a></h2> <p>A login session is automatically logged out after certain period of inactivity. The timeout period defaults to 20 minutes, and is set by the @@ -1019,6 +1021,90 @@ [...] </VirtualHost></pre> The possibilities are endless. + +<h2><a name="nametemps" id="nametemps">Name-based templates</a></h2> + +<p>In versions of sqwebmail greater than sqwebmail-3.5.3.20030629 it is +possible to display two or more templates from the same CGI binary WITHOUT +setting up multiple domain names.</p> + +<p>For example, with Name-based templates an sqwebmail administrator +can set up sqwebmail to display a template in the <code>/usr/local/share/sqwebmail/html</code> +directory when sqwebmail is called from the URL: <code>http://www.foo.com/cgi-bin/sqwebmail</code> +</p> +<p>And display a <b>different</b> template in the <code>/usr/local/share/sqwebmail/alternate-html</code> +directory when sqwebmail is called from the URL: <code>http://www.foo.com/cgi-bin/sqwebmail-alt-template</code></p> + +<p>This is made possible by a little web server magic (explained below in the +section entitled <a href="#nametempsapache">"Apache Name-based template configuration example"</a>) +and the setting of TWO sqwebmail environment variables:</p> + +<p> +<code>SQWEBMAIL_TEMPLATEDIR</code><br> +<code>SQWEBMAIL_IMAGEURL</code> +</p> + +<p>You should recognize the SQWEBMAIL_TEMPLATEDIR environment variable from +the section above on <a href="#domaintemps">Domain-based templates</a>. If +you haven't read that section yet, please do so now.</p> + +<p>The SQWEBMAIL_IMAGEURL environment variable is new in versions of sqwebmail +greater than sqwebmail-3.5.3.20030629. It allows us to set, at run time, the +image URL, or the root URL, in which to look for our template's images. This +image URL is then automatically inserted into the current template anytime a +conditional image tag or an IMAGEURL tag is encountered.</p> + +<p>This is an example of a conditional image tag:</p> + +<p><code>[EMAIL PROTECTED], ... @[EMAIL PROTECTED]</code></p> + +<p>The conditional image tag is replaced at template processing time with an HTML +<img src="..."> tag <b>if</b> (hence the word "conditional") sqwebmail +is set up to display images.</p> + +<p>This is an example of an IMAGEURL tag:</p> + +<p><code>[#IMAGEURL#]</code></p> + +<p>The <code>IMAGEURL</code> tag is replaced at template processing time with +the contents of the <code>SQWEBMAIL_IMAGEURL</code> environment variable, if +set, and otherwise with the value of the <code>--with-imageurl</code> configure +option, which defaults to "<code>/webmail</code>". +</p> + +<h3><a name="nametempsapache" id="nametempsapache">Apache Name-based template configuration example</a></h3> + +<p>Let's take a look at a simple Apache Name-based sqwebmail template +configuration example:</p> +<br> + +<pre> + + # Sqwebmail Alternate Template URL + ScriptAlias /cgi-bin/sqwebmail-alt-template <i>"/usr/local/apache/cgi-bin/sqwebmail"</i> + + <Location <i>/cgi-bin/sqwebmail-alt-template</i>> + Setenv SQWEBMAIL_TEMPLATEDIR <i>"/usr/local/share/sqwebmail/alternate-template"</i> + Setenv SQWEBMAIL_IMAGEURL <i>"/alternate-webmail"</i> + [...] + </Location> + +</pre> + +<p>The above should allow your users to run sqwebmail with the template in +<code>/usr/local/share/sqwebmail/alternate-template</code> and an image URL +of <code>/alternate-webmail</code>, simply by calling sqwebmail from the +following URL:</p> + +<p><code>http://www.yourdomain.com/cgi-bin/sqwebmail-alt-template</code></p> + +<p>The original sqwebmail templates would then still be available from this +URL:</p> + +<p><code>http://www.yourdomain.com/cgi-bin/sqwebmail</code></p> + +<p>Using Apache's <Location> directive we can utilize a virtually +unlimited number of templates without setting up a single virtual domain.</p> <h2><a name="shared" id="shared">Shared folders</a></h2>