Installing Maia Mailguard On Debian Lenny (Virtual Users/Domains With Postfix/MySQL) - Page 4

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Tue, 2010-07-06 16:30. ::

You should read the help page to learn how to use Maia Mailguard:

Here's the settings page for your mail account:

While you browse the Maia web interface, you might encounter some fatal PHP errors, such as this one:

Fatal error: Call to undefined function subtr() in /var/www/maia/wblist.php on line 190

I had to fix the following files to make these errors go away:

vi /var/www/maia/wblist.php

In line 190, there's the line

if (subtr(get_database_type($dbh),0,5) == "mysql") {

The function must be substr, not subtr:

[...]
  //if (subtr(get_database_type($dbh),0,5) == "mysql") {
  if (substr(get_database_type($dbh),0,5) == "mysql") {
[...]

Fatal error: Call to undefined function subtr() in /var/www/maia/cache.php on line 238

Again, we have this subtr error, so change subtr to substr in /var/www/maia/cache.php on line 238:

vi /var/www/maia/cache.php

[...]
        if (substr(get_database_type($this->dbtype),0,5) == "mysql") {
[...]

Fatal error: Call to undefined function response_text() in /var/www/maia/cache.php on line 406

This error can be fixed by simply commenting out line 406:

vi /var/www/maia/cache.php

[...]
        //$this->smarty->assign("actionlang", response_text($this->type));
[...]

Fatal error: Call to undefined function subtr() in /var/www/maia/maia_db.php on line 1954

Here we have the subtr error again - replace subtr with substr:

vi /var/www/maia/maia_db.php

[...]
        if (substr(get_database_type($dbh),0,5) == "mysql") {
[...]

Here are a few more screenshots of the Maia Mailguard interface. Here you can whitelist and blacklist email addresses:

Here's the statistics page:

From the statistics page, you can access your spam and virus mails - they are quarantined, and it's possible to rescue these mails from the quarantine (they will then be delivered to your mailbox), to delete them, or to confirm their status:

 

12 Creating Cron Jobs For Maia's Maintenance Scripts

Maia Mailguard comes with some maintenance scripts that need to be run regularly. It's best to set up cron jobs that are run by the user amavis:

crontab -u amavis -e

10 * * * * /var/lib/amavis/maia/scripts/process-quarantine.pl &> /dev/null
@hourly /var/lib/amavis/maia/scripts/stats-snapshot.pl &> /dev/null
@daily /var/lib/amavis/maia/scripts/expire-quarantine-cache.pl &> /dev/null
@weekly /var/lib/amavis/maia/scripts/send-quarantine-reminders.pl &> /dev/null
*/10 * * * * /var/lib/amavis/maia/scripts/send-quarantine-digests.pl &> /dev/null

 

13 Deleting The /var/www/maia/admin Subdirectory

Now that Maia Mailguard is up and running properly, you should delete the /var/www/maia/admin subdirectory for security reasons:

rm -fr /var/www/maia/admin

 

14 Modifying Email Templates

If you like, you can modify the email templates for emails to users whose quarantines/caches start to get large (/var/lib/amavis/maia/templates/reminder.tpl) and for new users (/var/lib/amavis/maia/templates/newuser.tpl).

The following variables are available for /var/lib/amavis/maia/templates/reminder.tpl:

Placeholder Expands To
%%VIRUSCOUNT%% Number of viruses in quarantine
%%SPAMCOUNT%% Number of suspected spam items in quarantine
%%BANNEDCOUNT%% Number of items with banned file attachments in quarantine
%%HEADERCOUNT%% Number of items with invalid mail headers in quarantine
%%VIRUSSIZE%% Total size of all viruses in quarantine
%%SPAMSIZE%% Total size of all suspected spam items in quarantine
%%BANNEDSIZE%% Total size of all items with banned file attachments in quarantine
%%HEADERSIZE%% Total size of all items with invalid mail headers in quarantine
%%MAIAURL%% URL users should visit to log into Maia Mailguard
%%ADMINEMAIL%% Email address of the mail administrator
%%EXPIRYPERIOD%% Number of days items are allowed to live in quarantine
%%OLDESTITEMTTL%% Number of days before the oldest quarantined item is deleted
%%OLDESTITEMAGE%% Age (in days) of the oldest item in quarantine

The following variables are available for /var/lib/amavis/maia/templates/newuser.tpl:

Placeholder Expands To
%%LOGIN%% The new user's temporary login name
%%PASSWORD%% The new user's temporary password
%%LOGINURL%% URL users should visit to login to Maia Mailguard
%%ADMINEMAIL%% Email address of the mail administrator

 

15 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Joshua (not registered) on Wed, 2010-08-11 20:35.
I keep seeing the Maia Mailguard server (literally, it's in the room down the hall) and I mean to try it for my own personal use, but I haven't really got around to it. We use it at an ISP level and it works extremely well. This guide should hopefully help me get off my rear and install it on some more servers.
Submitted by David Morton (not registered) on Sat, 2010-07-10 14:22.

As a developer for Maia Mailguard, I appreciate any the effort put into making a tutorial like this, however, I'm a little confused about the lack of communication with our community shown at the end of this tutorial.

We have an active community on the users mailing list, which you can join here:

https://www.maiamailguard.com/maia/wiki/MaiaMailingLists

It is unfortunate that the author happened to check out the 1.0 branch when he did, as it was one of the strangest states I've ever left that tree in.  I have since committed fixes for the items listed at the end of this tutorial.   A quick note on the mailing list could have had that fixed sooner and allowed the author to skip the work of documenting it!

 @Boudewijn Ector:  I develop Maia on Ubuntu, so it runs quite well on Debian-like systems.  If you have problems, please join the mailing list!   Having said that, we are in the process of packaging it up into an Ubuntu set of packages, so it will get easier when we finish that up. :)

 Lastly, I would like to point out that this tutorial uses screenshots from the "Ocean Blue" theme, which is the theme that has received less love.  The "Desert Sand" theme has a much more polished look to it, and is much preferred.

 

Submitted by Anonymous (not registered) on Mon, 2010-07-12 13:42.

If your developing maya for Ubuntu, which is nice, but wouldn't it not be nicer to port it to debian itself and let the ubuntu developers adapt it.

 

Submitted by Boudewijn Ector (not registered) on Sat, 2010-07-10 00:13.

Dear Author,


Well done! Maia is great, and debian is great!

Too bad there's no such thing as a debian package. Although I've been using FreeBSD together with Maia for years, I've been trying for some time to get Maia to work on Debian.

 

A minor comment (I might make more during the implementation of maia on my debian system): 

One might try :

svn checkout https://www.maiamailguard.com/svn/branches/1.0

 Instead of including a version number: this will automatically get the newest version in SVN. Minor note: watch out, this might be an unstable version!

Submitted by Keith (not registered) on Sat, 2010-07-10 18:04.
The developers of Maia have fixed the PHP errors described in this article so a checkout of the latest 1.x branch will not need to have these corrections applied.