Qmailadmin with Lighttpd

Configure Qmailadmin to work with the Lighttpd webserver.

Lighttpd Configuration
With a basic Lighttpd server configured as per this site's instructions and running under daemontools, create a file /service/lighttpd/root/qmailadmin.inc to hold the server options for Qmailadmin:

alias.url = (
"/cgi-bin/qmailadmin" => "/var/websites/mail/cgi-bin/qmailadmin",
"/images/qmailadmin" => "/var/websites/mail/htdocs/images/qmailadmin"
)

$HTTP["url"] =~ "^/cgi-bin/qmailadmin" {
cgi.assign = ( "/var/websites/mail/cgi-bin/qmailadmin" => "" )
}

Edit your lighttpd.conf and add an include for your qmailadmin.inc file:

include "qmailadmin.inc"

Also, make sure CGIs are enabled in your lighttpd.conf with something similar to:

server.modules = (
"mod_cgi",
)

Securing Qmailadmin
If you are going to have Qmailadmin accessible from the public internet, you should encrypt the connection as user IDs and passwords are used.

Assuming you've already created an SSL certificate and configured Lighttpd according to the Lighttpd SSL instructions:
Redirect all qmailadmin requests, that don't come from the 192.168.0.0/24 network, to SSL:

alias.url = (
"/cgi-bin/qmailadmin" => "/var/websites/mail/cgi-bin/qmailadmin",
"/images/qmailadmin" => "/var/websites/mail/htdocs/images/qmailadmin"
)

$HTTP["url"] =~ "^/cgi-bin/qmailadmin" {
cgi.assign = ( "/var/websites/mail/cgi-bin/qmailadmin" => "" )
$SERVER["socket"] == ":80" {
  $HTTP["remoteip"] != "192.168.0.0/24" {
   url.redirect = ( "^/(.*)" => "https://%1/$1" )
  }
}
}

Resources
http://gryniewicz.com/blogs/dang/2007/05/16/qmailadmin-on-lighttpd/
http://forum.lighttpd.net/topic/1053

Credits

Various bits of code, scripts, and procedures were put together with information from John Simpson's qmail.jms1.net website. It's an excellent resource on managing and setting up a Qmail server.

Recent Updates

  • 1 year 7 months ago
  • 1 year 7 months ago
  • 1 year 7 months ago
    php 8.x
  • 1 year 7 months ago
    10.6.7
  • 1 year 7 months ago
    Drop Centos 5/6 stuff