Comments on Virtual Users And Domains With Postfix, Courier And MySQL (Fedora 8)

Virtual Users And Domains With Postfix, Courier And MySQL (Fedora 8) This document describes how to install a mail server based on Postfix that is based on virtual users and domains, i.e. users and domains that are in a MySQL database. I'll also demonstrate the installation and configuration of Courier (Courier-POP3, Courier-IMAP), so that Courier can authenticate against the same MySQL database Postfix uses. The resulting Postfix server is capable of SMTP-AUTH and TLS and quota (quota is not built into Postfix by default, I'll show how to patch your Postfix appropriately). Passwords are stored in encrypted form in the database (most documents I found were dealing with plain text passwords which is a security risk). In addition to that, this tutorial covers the installation of Amavisd, SpamAssassin and ClamAV so that emails will be scanned for spam and viruses.

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

I also needed to install cyrus-sasl:

yum -y install cyrus-sasl

It wasn´t installed before and  isn´t present in paragraph 3 of this article.

By: Slawek

You don't have to disable selinux !

I found help here:
http://wiki.centos.org/HowTos/SELinux

I had problems during configure postfix + mysql + courier-imap
(elements: postfix_virtual_t , courier_authdaemon_t , postfix_smtpd_t)

You do have to analyze logs: /var/log/messages and /var/log/audit/audit.log
You have to make sure, that it isn't file permision problem.
You have to make sure, that it isn't selinux file context problem. 

  1. after problem occurs check logs:
    tail /var/log/messages
    and find:
    setroubleshoot: SELinux is preventing xxxx (<element>) .... For complete SELinux messages. run sealert -l <alert_identifier>
    e.g. <element> = postfix_virtual_t
  2. create selinux policy module:
    grep <element> /var/log/audit/audit.log | audit2allow -M <module_name>
    e.g.
    grep postfix_virtual_t /var/log/audit/audit.log | audit2allow -M postfixvirtual
    it creates two files .te (text version of module), .pp (module)
  3. display and check .te file
    e.g.
    cat postfixvirtual.te
  4. if it is ok load module:
    semodule -i postfixvirtual.pp
  5. test if it works, if not go back to step 1 and repeat (I had to do 3 times for every element)