The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mail::Toaster::CGI

SYNOPSIS

index.cgi - A pretty web interface that showcases the abundant features of a mail toaster.

DESCRIPTION

A cgi application and HTML template for a standard mail page.

This module contains the subroutines that are used by index.cgi. They're named well so you should have no problems reading through index.cgi and understanding exactly what it's doing.

new

        use Mail::Toaster::CGI;
        my $toaster_cgi = Mail::Toaster::CGI->new();

Once you have a Mail::Toaster::CGI object, you can call any of the following methods.

instructions

Displays the end user instructions displayed on the web page. Uses values from toaster.conf.

    $toaster_cgi->instructions($conf);

Displays the logo using the URL and alt data from toaster.conf.

    $toaster_cgi->logo($conf);

heading

Displays the HTML heading using the data from toaster.conf.

    $toaster_cgi->heading($conf);

imp_submit

        $toaster_cgi->imp_submit($conf, $ssl, $host);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to.

SetVWebSubmit

        $toaster_cgi->vwebmail_submit($conf, $ssl, $host);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to.

qss_stats_submit

    $toaster_cgi->qss_stats_submit($conf, $ssl, $host);

Generate the HTML code that renders the Qmail Scanner Statistics table and form that you see in index.cgi.

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection, $host is the hostname to submit the form to, and $path is the path to isoqlog on the remote server. A typical invocation might look like this:

    $toaster_cgi->qss_stats_submit($conf, 1, "matt.cadillac.net" );

isoqlog_submit

        use Mail::Toaster::CGI;
        isoqlog_submit($conf, $ssl, $host);

Generate the HTML code that renders the Isoqlog table and form that you see in index.cgi.

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection, $host is the hostname to submit the form to. A typical invocation might look like this:

        isoqlog_submit($conf, 1, "matt.cadillac.net");

rrdutil_submit

        $toaster_cgi->rrdutil_submit($conf, $ssl, $host);

Generate the HTML code that renders the table and embedded form that you see in index.cgi.

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to.

cookies_expire

Very simple use of CGI's cookie method. To expire the cookie we just set it's expiration to a negative value.

qmailadmin_submit

        $toaster_cgi->qmailadmin_submit($conf, $ssl, $host);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to.

sqwebmail_submit

        $toaster_cgi->sqwebmail_submit($conf, $ssl, $host);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to.

squirrelmail_submit

        $toaster_cgi->squirrelmail_submit($conf, $ssl, $host);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $host is the hostname to submit the form to. $path is the installed URL path on the server.

cookies_set

Very simple use of CGI's cookie method. We save a cookie with the users email address and another one for for whether they selected Use SSL.

ssl_line

        $toaster_cgi->ssl_line($ssl, $editable);

$ssl is a binary value, representing whether the form URL should be http or https, based on the users selection. $editable is a binary value, determining if the SSL preference is available or not.

        $toaster_cgi->cookie_line($save);

$save is a binary value, are the users settings saved or not?

email_line

        $toaster_cgi->email_line($address, $editable);

$address is the email address to display in the form.

$editable is whether or not the address field is editable.

process_shell

Since we're a CGI app, we don't expect to be run from the command line except to test. This little sub just lets you know everything that was supposed to load did and that the CGI should work right.

AUTHOR

Matt Simerson <matt@tnpi.biz>

BUGS

None known. Report any to author.

TODO

TODO is caught up. Yay!

SEE ALSO

The following are all man/perldoc pages:

 Mail::Toaster 
 Mail::Toaster::Apache 
 Mail::Toaster::CGI  
 Mail::Toaster::DNS 
 Mail::Toaster::Darwin
 Mail::Toaster::Ezmlm
 Mail::Toaster::FreeBSD
 Mail::Toaster::Logs 
 Mail::Toaster::Mysql
 Mail::Toaster::Passwd
 Mail::Toaster::Perl
 Mail::Toaster::Provision
 Mail::Toaster::Qmail
 Mail::Toaster::Setup
 Mail::Toaster::Utility

 Mail::Toaster::Conf
 toaster.conf
 toaster-watcher.conf

 http://matt.simerson.net/computing/mail/toaster/
 http://matt.simerson.net/computing/mail/toaster/docs/

COPYRIGHT

Copyright (c) 2004-2005, The Network People, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the The Network People, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.