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

Want to support HowtoForge? Become a subscriber!
 
Submitted by Terrible Monster (Contact Author) (Forums) on Wed, 2011-12-07 17:20. ::

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:

nano /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:

nano /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:

nano /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:

nano /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.