Name Last Update
..
README Loading commit data...
mail_users.sql Loading commit data...
pam_pgsql.conf Loading commit data...
virtual_domains.cf Loading commit data...
virtual_mailboxes.cf Loading commit data...

README

About
=====

This directory contains sample files for setting up a Noosfero-integrated mail
service with Postfix, Courier Mail Server and PostgreSQL. The instructions
assume a Debian GNU/Linux system, and were tested specifically in the "etch"
release (the stable release at the time of writing the instructions).

Installation
============

Install and configure Noosfero
-------------------------------

Follow Noosfero's own instructions. Before letting users register at your Noosfero site, add the following line to config/local.rb:

User.system_encryption_method = :md5

NOTE: the mail system will work __only__ if Noosfero uses md5 passwords!

In the instructions below, replace **NOOSFERO_DB** with the name of the
Noosfero database you'll use for production (e.g. "noosfero_production",
"noosfero" etc).

Install the required packages for the mail system
-------------------------------------------------

Create a system user for the virtual mail folders. This user will be used by
Postfix for delivering mail into the folders.

addgroup --gid 5000 vmail
adduser --system --uid 5000 --gid 5000 vmail

Configure a read-only user for your database
--------------------------------------------

Create a user in the PostgreSQL database that will be used by the mail authentication mechanisms to connect to the database. Become the postgres user and issue the command (replace **DBUSER** with the name you choose for this user):

createuser -P **DBUSER**

The -P option tells createuser to ask you for a password. Remember to take note
of this password. From now on, we'll refer to it as **DBPASSWORD**. When you
see **DBPASSWORD** in the instructions below, replace it with the password you
typed. Similarly, when you see **DBUSER** in the instructions below, replace it
with the username you chose to this database user.

Configure the PostgreSQL database
---------------------------------

Create the database view that will be queried by Courier's PostgreSQL
authentication module:

psql **NOOSFERO_DB** < mail_users.sql

After that, assure you give read permissions on the recently-created view to the user you created before:

psql **NOOSFERO_DB**
[...]
=> grant select on mail_users to **DBUSER**;

Configure courier to authenticate against the PostgreSQL database:
------------------------------------------------------------------

in /etc/courier/authdaemonrc, find the line that defines authmodulelist and change it to look like this:

authmodulelist="authpgsql"

Then find the authpgsqlrc file and set the indicated settings as follows:

--------------------8

and you must set /var/spool/postfix/var/run/saslauthd with

dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd
adduser postfix sasl