Postfix How-To

From Secure Computing Wiki
Revision as of 14:26, 24 April 2007 by Ecrist (Talk | contribs)

Jump to: navigation, search
  • Loosly follows the How-To at

Install MySQL

  1. Install MySQL 5.0 Port:
    #cd /usr/ports/databases/mysql50-server
    #make all install clean
  2. Add MySQL to system startup in /etc/rc.conf:
    #echo ‘mysql_enable=”YES”‘ >> /etc/rc.conf
  3. Start MySQL
    #/usr/local/etc/rc.d/mysql-server start
  4. Secure MySQL root account:
    #mysql -u root mysql
    >UPDATE user SET Password=PASSWORD(’mysql_root_password‘) WHERE user=’root’;

Postfix Installation

  1. Install Postfix port:
    # cd /usr/ports/mail/postfix
    # make install clean
  2. When asked for options, select PCRE, DOVECOT, TLS, BDB, MYSQL, and VDA.
  3. You will be asked if you want to activate postfix in /etc/mail/mailer.conf - select yes.
    Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y
  4. Add the following lines to /etc/rc.conf:
  5. Add the following lines to /etc/periodic.conf:

Initialize the Database

  1. Download the SQL file
    # fetch

Install Dovecot

  1. Install Dovecot from ports:
    # cd /usr/ports/mail/dovecot
    # make all install clean
  2. Make sure options SSL, IPv6, POP3, and MySQL are selected.
  3. Enable Dovecot at startup in /etc/rc.conf:
     #echo ‘dovecot_enable=”YES”‘ >> /etc/rc.conf
  4. Copy example configurations to correct locations:
    #cd /usr/local/etc/
    #cp dovecot-example.conf dovecot.conf
    #cp dovecot-sql-example.conf dovecot-sql.conf
  5. Create the certificate directory, and place your ssl-certificates:
    # mkdir /etc/certs
    # cp ssl.crt ssl.key /etc/certs