Baruwa on Ubuntu/Debian

As of Baruwa 1.1.0 an Apt repo is provided to enable users of Ubuntu and Debian to install Baruwa using apt-get.

Install & Configure RabbitMQ

Install RabbitMQ:

# apt-get install rabbitmq-server

Configure RabbitMQ

Create a user and virtual host for baruwa:

# rabbitmqctl add_user baruwa your_password
# rabbitmqctl add_vhost baruwa
# rabbitmqctl set_permissions -p baruwa baruwa ".*" ".*" ".*"

Delete the guest user:

# rabbitmqctl delete_user guest

See the RabbitMQ Admin Guide for more information.


Please ensure that you control access to your RabbitMQ install as to prevent an unauthorized clients from accessing your broker.

Baruwa Apt install

The Baruwa Apt server is located at

To install from this server you need to enable it by adding its gpg key and adding it to your /etc/apt/sources.list file:

# wget -O - | apt-key add -

Then add the following to your sources file


deb "dist" main

Replace “dist” with the name of the release you are running: (squeeze, wheezy, sid)


deb "dist" main

Replace “dist” with the name of the release you are running: (lucid, maverick, natty oneiric)

You can now install Baruwa from the APT repo:

# apt-get update
# apt-get install baruwa

Automated configuration

The installation process will also configure apache, mysql and baruwa should you choose let the install configure the system for you.

The install asks you for the following info

  • apache virtualhost name (The name used to configure the baruwa apache virtualhost)
  • database host (The hostname or ip of the host running your mysql database)
  • database admin user (A user account with admin access on the database server)
  • database admin password (The password fo the above user)
  • database user (The user baruwa will use to connect to the database)
  • database password (The password for the above)
  • database name (The name of the baruwa database)
  • rabbitmq host (The rabbitMQ hostname or IP address)
  • rabbitmq vhost (The RabbitMQ vhost)
  • rabbitmq user (The RabbitMQ user)
  • rabbitmq password (The RabbitMQ password)
  • baruwa admin user (The baruwa admin user)
  • baruwa admin password (The baruwa admin user password)
  • baruwa admin email (The baruwa admin user email address)

Populate the database:

# baruwa-admin syncdb --noinput
# for name in  $(echo "accounts messages lists reports status fixups config"); do
        baruwa-admin migrate $name;

Create the admin user account:

# baruwa-admin createsuperuser

Configure MailScanner

It is assumed that you have a working MailScanner system already configured, if you are installing from scratch please refer to their documentation on how to configure MailScanner. The Baruwa repo includes mailscanner and it will be installed automatically when you install baruwa.


Starting with Baruwa version 1.1.0 you no longer have to edit and set the DB authentication details in each and every Custom module, you just set them up once in the MailScanner configuration file, A Baruwa MailScanner configuration file is installed as /etc/MailScanner/conf.d/baruwa.conf

Edit the provided Baruwa MailScanner config file /etc/MailScanner/conf.d/baruwa.conf, you need to make sure the following options are correct:

Quarantine User = exim #(Or what ever your `Run As User` is set to)
DB DSN = DBI:mysql:database=baruwa;host=spam01;port=3306 #set to valid DSN
DB Username = baruwa # your DB username
DB Password = password # your DB password

To actually quarantine and later process messages with in Baruwa, set store as one of your keywords for the Spam Actions and High Scoring Spam Actions MailScanner options.

The provided MailScanner configuration provides for SQL logging, Whitelists and Blacklists and Per user settings.

Apply configuration changes

Test your configuration for any errors:

# MailScanner --lint

Restart MailScanner:

# /etc/init.d/mailscanner restart

Configure Baruwa

Edit the file and make configuration changes to suit your site.:

# vi /etc/baruwa/


Make sure you change the SECRET_KEY, DO NOT USE THE DEFAULT, If you have a cluster the key should be the same on all the machines in the cluster.

Configure Email Signature management

Baruwa now supports the management of email signatures / disclaimers from within the web interface. Signatures are configured on a domain and user level.

Both HTML and text signatures are supported, HTML signatures support embedding of one graphical image, which can be uploaded via the HTML editor interface.

The backend that handles the signatures needs to be initialized before you can begin to manage the signatures via the interface.

To initialize the backend run:

# baruwa-admin initconfig

This will ask you for the hostname of the system you are setting up, and then initialize the system for you. The command does attempt to guess your hostname, so if its correct just press enter.

You need to initialize each of your machines if you are running a clustered setup.


Verify that is working

Check your log files you should see

Baruwa SQL logger:

Aug  9 18:58:27 localhost MailScanner[8470]: Logging message 1OiVg7-0003zS-9s to Baruwa SQL
Aug  9 18:58:27 localhost MailScanner[11052]: 1OiVg7-0003zS-9s: Logged to Baruwa SQL

Baruwa Lists:

Aug 9 18:32:42 localhost MailScanner[27260]: Starting Baruwa whitelists
Aug 9 18:32:42 localhost MailScanner[27260]: Read 6 whitelist items
Aug 9 18:32:42 localhost MailScanner[27260]: Ip blocks whitelisted

Baruwa User settings:

Aug 9 15:00:03 localhost MailScanner[25708]: Baruwa - Populating spam score settings
Aug 9 15:00:03 localhost MailScanner[25708]: Read 1 spam score settings
Aug 9 14:59:53 localhost MailScanner[25668]: Baruwa - Populating high spam score settings
Aug 9 14:59:53 localhost MailScanner[25668]: Read 1 high spam score settings

Point your browser to http://hostname_used login with admin user and password and start working. You can now use the interface to add users, domains and process messages, etc etc.

Need help

If your installation is not working as expected, support is available, you can get free and friendly support from the list or paid support from the author or other companies that support baruwa.