Difference between revisions of "Postfix How-To"

From Secure Computing Wiki
Jump to: navigation, search
Line 39: Line 39:
 
<pre># fetch http://www.purplehat.org/downloads/postfix_guide/postfix-db.sql</pre>
 
<pre># fetch http://www.purplehat.org/downloads/postfix_guide/postfix-db.sql</pre>
 
</ol>
 
</ol>
 +
 +
==== Install Dovecot ====
 +
<ol><li>Install Dovecot from ports:
 +
<pre># cd /usr/ports/mail/dovecot
 +
# make all install clean</pre>
 +
<li>Make sure options SSL, IPv6, POP3, and MySQL are selected.
 +
<li>Enable Dovecot at startup in /etc/rc.conf:
 +
<pre> #echo ‘dovecot_enable=”YES”‘ >> /etc/rc.conf</pre>
 +
<li>Copy example configurations to correct locations:
 +
<pre>#cd /usr/local/etc/
 +
#cp dovecot-example.conf dovecot.conf
 +
#cp dovecot-sql-example.conf dovecot-sql.conf</pre>
 +
<li>Create the certificate directory, and place your ssl-certificates:
 +
<pre># mkdir /etc/certs
 +
# cp ssl.crt ssl.key /etc/certs</pre>

Revision as of 13:26, 24 April 2007

  • Loosly follows the How-To at www.purplehat.org.

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’;
    >FLUSH PRIVILEGES;
    >quit

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:
    sendmail_enable="NO"
    sendmail_submit_enable="NO"
    sendmail_outbound_enable="NO"
    sendmail_msp_queue_enable="NO"
  5. Add the following lines to /etc/periodic.conf:
    daily_clean_hoststat_enable="NO"
    daily_status_mail_rejects_enable="NO"
    daily_status_include_submit_mailq="NO"
    daily_submit_queuerun="NO"

Initialize the Database

  1. Download the SQL file
    # fetch http://www.purplehat.org/downloads/postfix_guide/postfix-db.sql

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