Configuring postfix
We'll be working with two backends, I left the election for you but postfix/cyrus
guys prefer sasl with mysql (in fact, it replaced the other method long time ago).
Personally, I started using the unix way, but I soon realised that it wasn't useful
for funambol, as you've got to create an account on your system for every mail user.
Of course, It's good for tests when you'll use only one user, as it's easy as hell to add new users
Standard configuration
First of all edit main.cf to change some things like * myhostname | Your fqdn.
- mydestination | local domainnames, comma separated
- relayhost | Where to deliver outgoing mails. If none they'll be directly delivered | to destination smtp hosts
- mailbox transport | How to handle mails accepted for local delivery
- virtual_alias_maps = hash:/etc/postfix/virtual, mysql:/etc/postfix/mysql-virtual | Where to lookup for virtual alias.
Then we uncomment the following on master.cf:
submission inet n - - - - smtpd
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
Configuring sasl
Add the following to /etc/postfix/sasl/smtpd.conf:
pwcheck_method: saslauthd
mech_list: digest-md5 cram-md5
Also, you'll have to put this for sasl auth on main.cf:
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetwork
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes # You can remove this.
smtpd_sasl_path = smtpd
And this for use cyrus mail transport:
mailbox_transport = cyrus
So we'll check passwd with sasl auth daemon.
To work with mysql
You've got to configure in /etc/postfix/mysql-virtual your database, like this:
hosts = localhost # Database host
user = mail # Database username
password = secret # And pass
dbname = mail # DB name where users are stored
table = virtual # table name
select_field = dest
where_field = alias
additional_conditions = and status = ’1’
To work with unix auth
It should work with debian default configs, just check that the next file has MECHANISMS="pam"
in redhat:
/etc/sysconfig/saslauthd
and in debian:
/etc/default/sasld (debian-based)
Other toughs
All files in /etc/postfix must be g+r and root:postfix.
Done
Okay, you'll be able now to add users as system users or at the mysql db.
Now you can install some front-end like cyrus web admin for managing users or
using cyrusadm command line
|