This section describes the inner working of MailMan
for installation administrators that want to customize their installations.
Branding your MailMan installation
All of MailMan's output is defined by a collection
of HTML templates. The templates are the ".htm"
files that begin with "t_" in your
distribution. We have provided a sample look and feel for MailMan
that is based on our web site that you are welcome to use for
as long as you like. If you would prefer to exercise greater control
over the appearance of your installation though, you can easily
customize your templates.
When you begin the customization process,
simply open the templates in any HTML editor and make your modifications.
Remember that the behavior of MailMan is dictated by hidden fields
contained within the HTML templates, so make sure that you go
slowly and check your results often, as it may be possible to
'break' your installation by accidentally deleting or modifying
important keywords. We hope to provide more detailed information
on what MailMan's keywords are and what they mean in this document
at a later date. Since most changes that most people make to the
MailMan configuration are color and logo-oriented, we have centralized
all of MailMan's color specifications into a single CSS file that
you can modify without even modifying a single template file.
and SMTP server names
Another common modification is rigging the names of
the POP3 and SMTP servers so that your users don't have to provide
anything other than a username and password. The POP3 server that
Mailman uses is specified in the HTML templates by the parameter
"SERVER". The only place where MailMan
normally accepts this value from the default templates is in the
template "t_login.htm". One simple
and quick way to rig the name of the server is to provide a default
value by altering the form field element. To do this, open "t_login.htm"
in an HTML editor or text editor and locate the form field:
<input type="text" name="SERVER" size="30">
...and replace it with:
<input type="text" name="SERVER" size="30"
The box will now be filled in by default for the user
when they log on, but your users will still have the option of
overriding the selection if they like. If you have a group of
different mail servers, then you can use this technique to replace
the "input" tag with a "select" tag for providing
a drop-down list of mail servers. If you need to do that and you
don't understand what we mean, then just contact
us for assistance, we're happy to help.
The SMTP server used by MailMan is specified
by the parameter "OUTGOING" in the
Change the form fields that set the "OUTGOING"
keyword in "t_messageform.htm" in order
to rig the outgoing SMTP server to something specific. Keep in
mind that any alterations to the templates don't prevent people
from "spoofing" your installation and manually ordering
it to connect to any server that they like. If you are concerned
about long-term security then you should use the method below
to hard-code your server names into the script itself.
Hard-coding the server names into the script
If you want to make sure that your MailMan installation
can only access the specific servers that you want, then you can
hard-code the names of the POP3 and SMTP server into the script
itself. To do this, find the locations of the servers in your
"t_login.htm" and "t_messageform.htm"
templates as described above, and remove the entire "<input>"
field from your templates entirely. We have constructed the templates
so that you can pretty easily remove the entire form row in both
cases, just remove everything from the "<tr>"
before the "input" element
to the "</tr>" after
it, including the "<tr>"
and "</tr>" tags themselves.
Finally, set the configuration variables "$strIncomingServer"
and "$strOutgoingServer" in the MailMan
script itself, as illustrated in the comments. Those variables
are set toward the top of the script. If you set these values,
then even if a hacker attempts to spoof a login page to redirect
MailMan to a different server, it will always use the servers
that you specify.
Rigging a MailMan installation to use a particular
To rig MailMan to always use the frames or no-frames
mode, just remove the entire rows in your "t_login.htm"
template that pertain to selecting the interface and then add
a hidden form tag that specifies which interface you want to use.
It should look like:
<input type="hidden" name="NOFRAMES" value="TRUE">
...or you can specify "FRAMES" if you like
that interface and you want your users to be forced to use it.
for "From" lines in outbound mail
When MailMan produces the message composition form
for sending new messages, it needs to fill in a value for the
user's "From" line. MailMan will automatically guess
an email address based on the user's POP3 username and the server
name. In some cases this address is either a lot more specific
than necessary (i.e., "email@example.com"
instead of "firstname.lastname@example.org")
or completely wrong (i.e., "email@example.com"
instead of "firstname.lastname@example.org").
There are lots of options for configuring the way that MailMan
infers outbound "From" email addresses. For information
on all of those options, please look at the settings listed in
your "mailman.cgi" script
file in the section labeled "Email Address
Settings". The configuration options are "From
Domain Trim", "From Domain Name", "Username
is the Email Address", "Email Address Mapping File",
and "Outgoing Domain Name". We have tried to organize
these options in the order in which they are most-commonly needed
by our users. The documentation in the script on these settings
is extensive, but if you have any questions about any of the settings
then please just contact
us and we will be happy to help.
It is not possible for MailMan to include a "MailMan()"
keyword in the templates so that the image URLs can be automatically
rewritten. This is because the keyword would make the image URLs
invalid in the raw HTML template files, which would make customizing
the templates with an HTML editor very difficult. Originally there
was no way to correct your image URLs other than by actually editing
the templates, but this is an inconvenient solution. To rectify
this situation and make things easier for site maintainers, we
have included the "$strURLImageLocation"
configuration variable. This variable contains a string that will
be prepended to the image URLs when the template is processed
at runtime. To use this variable, set it to the exact value that
you want prepended to image names in order to make them into URLs
that will point to your image directory. For instance, if you
bury your images in an "images" directory
under the directory where MailMan is installed, set this to "images/"
(with the slash). If you put your images in a completely different
directory, something that is rooted, like "/mailman/images/"
might be what you are looking for. In the most extreme cases you
can do away with relative URLs entirely and provide a complete
absolute URL like the one below:
strURLImageLocation = 'http://www.endymion.com/images/';
Altering the message composition box
We've done our best to make sure Mailman is cosmetically
pleasing on as many different kinds of browsers as possible; however,
there have been some reports of the "message input" field being
too large or too small, thus making it quite cumbersome to write
an email. The choice is ultimately up to you.
To alter the size of the message composition
box, use the ".formText"
CSS item in your "style.css"
file. Don't forget that Netscape version 4 is broken with this
as it is broken in regard to many things, so you will also have
to manually alter a "font" tag that surrounds the "textarea"
form input box on the message composition page if you want your
changes to also affect Netscape 4. Later, saner versions of Netscape
that are based on Mozilla's Gecko engine do not have this problem.
Another option is to change the value in
the "cols=" expression from 80 to a smaller number. This will
make the box thinner.
Logging users directly in
If you are generating a dynamic web page with user
information, then you can create a link that will log the user
straight in to MailMan. Simply create a link to your MailMan installation
that includes parameters for the information provided by the login
form. For example, to log in to a MailMan installation at http://mail.mycompany.com/mailman/mailman.cgi,
your link would look like this:
Replace the "U1" with your
user's POP3 user name, replace "P1"
with your user's POP3 password, and replace "S1"
with the name of the mail server. When your user follows this
link, MailMan will interpret the parameters as if the user had
submitted the login form. You can include other parameters from
the form as well, such as specifying frames or no-frames mode.