<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin+on+RHEL4'
         s:cUser='john'
         s:oUser=''
         s:mUser='john'>
        <s:name>knowledgebase/linux/mail/postfixadmin on RHEL4</s:name>
        <s:content>1 Deprecated, for a newer howto (if your using Centos5) go here: &#xD;&#xA;&#xD;&#xA;http://rimuhosting.com/knowledgebase/linux/mail/postfixadmin&#xD;&#xA;&#xD;&#xA;1 RPM Based PostfixAdmin install&#xD;&#xA;&#xD;&#xA;If you are using RHEL and would like to install PostfixAdmin then here are the steps.  &#xD;&#xA;&#xD;&#xA;The default RPM does not have mysql support, but you can use an RPM build for centos.  I used wget to fetch from here: &#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/centosplus/i386/RPMS/postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386.rpm&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;I used this one which is built for PostgreSQL as well as MySQL since it&apos;s a newer version that the one built solely for MySQL. &#xD;&#xA;&#xD;&#xA;If you do not have PostgreSQL installed, you will need to install it to satisfy the dependency, even though we will not use it, or you could try installing with the --nodeps flag.   &#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;rpm -e postfix &#xD;&#xA;rpm -ivh postfix-2.2.10-1.RHEL4.2.mysql_pgsql.c4.i386.rpm &#xD;&#xA;warning: postfix-2.2.10-1.RHEL4.2.mysql_pgsql.c4.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821&#xD;&#xA;Preparing...                ########################################### [100%]&#xD;&#xA;   1:postfix                ########################################### [100%]&#xD;&#xA;postconf -m | grep mysql&#xD;&#xA;mysql&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The newer packages, now complain about some MySQL libraries: &#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;[root@vps ~]# rpm -ivh postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386.rpm &#xD;&#xA;warning: postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821&#xD;&#xA;error: Failed dependencies:&#xD;&#xA;        libmysqlclient.so.15 is needed by postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386&#xD;&#xA;        libmysqlclient.so.15(libmysqlclient_15) is needed by postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386&#xD;&#xA;        libpq.so.4 is needed by postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386&#xD;&#xA;        postgresql is needed by postfix-2.2.10-1.1.el4.centos.mysql_pgsql.plus.i386&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;I upgraded MySQL from 4.1.20 in this case to a 5.0.x version following our notes here: &#xD;&#xA;&#xD;&#xA;http://bliki.rimuhosting.com/space/knowledgebase/linux/miscapplications/rpm+based+mysql5+install&#xD;&#xA;&#xD;&#xA;And then it installed ok.  &#xD;&#xA;&#xD;&#xA;I found that I could use the regular RHEL dovecot package, at least no problems reported yet&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;rpm -qa | grep dovecot&#xD;&#xA;dovecot-0.99.11-4.EL4&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Get postfixadmin, which is at sourceforge now:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;wget http:\//optusnet.dl.sourceforge.net/sourceforge/postfixadmin/postfixadmin-2.1.0.tgz&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Or the most recent version as of last time we installed:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;wget http:\//easynews.dl.sourceforge.net/sourceforge/postfixadmin/postfixadmin-2.2.0-RC1.tar.gz&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Red Hat specific fiddling:&#xD;&#xA;&#xD;&#xA;{code:none} &#xD;&#xA;mv postfixadmin-2.1.0.tgz /var/www/html/&#xD;&#xA;tar -zxvf /var/www/html/postfixadmin-2.1.0.tgz&#xD;&#xA;cd /var/www/html/postfixadmin-2.1.0&#xD;&#xA;cp config.inc.php.sample config.inc.php&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;These next steps are blatantly copied from our Debian-based howto:&#xD;&#xA;http://bliki.rimuhosting.com/space/knowledgebase/linux/mail/postfixadmin+on+debian+sarge&#xD;&#xA;&#xD;&#xA;Configure Postfix Admin to match your setup (e.g. to make the database passwords match, set your default domain, etc)&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;vi config.inc.php&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Or to quickly change the default domain to your own:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;replace &quot;change-this-to-your.domain.tld&quot; &quot;yourdomain.com&quot; -- config.inc.php&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Also set these variables, to simplify things:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;$CONF[&apos;domain_path&apos;] = &apos;YES&apos;;&#xD;&#xA;$CONF[&apos;domain_in_mailbox&apos;] = &apos;NO&apos;;&#xD;&#xA;$CONF[&apos;encrypt&apos;] = &apos;cleartext&apos;;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Change the permissions on the postfixadmin directory if you don&apos;t want any local users accessing it:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;chown -R apache:apache postfixadmin&#xD;&#xA;chmod -R 700 postfixadmin&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then browse to http://yourdomain.com/postfixadmin/ or http://yourip/postfixadmin/. It will prompt you to run Setup. Make sure the Setup Checker says &apos;OK&apos; for everything.&#xD;&#xA;&#xD;&#xA;Remove the setup.php as it recommends.&#xD;&#xA;&#xD;&#xA;Setup the .htaccess by changing the path of the .htpasswd file to /var/www/postfixadmin/admin/.htpasswd, and set an admin password&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;cd admin/&#xD;&#xA;vi .htaccess&#xD;&#xA;htpasswd .htpasswd admin&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then browse to http://yourdomain.com/postfixadmin/admin. You should get prompted. Login as &apos;admin&apos; with your newly created password.&#xD;&#xA;From here you can add domains, mailboxes, etc. But Postfix won&apos;t see these yet. We need to install Postfix, and configure it.&#xD;&#xA;&#xD;&#xA;Install Postfix, SASL2 with MySQL support&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install postfix-mysql postfix-tls libsasl2-modules-sql libsasl2-modules&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Add the following to /etc/postfix/main.cf&lt;br /&gt;&#xD;&#xA;  Change the UID of 106 to that of your postfix user (89 on CentOS)&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf&#xD;&#xA;virtual_gid_maps = static:89&#xD;&#xA;virtual_mailbox_base = /home/vmail&#xD;&#xA;virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf&#xD;&#xA;virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf&#xD;&#xA;virtual_minimum_uid = 89&#xD;&#xA;virtual_transport = virtual&#xD;&#xA;virtual_uid_maps = static:89&#xD;&#xA;&#xD;&#xA;broken_sasl_auth_clients = yes&#xD;&#xA;smtpd_recipient_restrictions =&#xD;&#xA;  permit_mynetworks,&#xD;&#xA;  permit_sasl_authenticated,&#xD;&#xA;  reject_non_fqdn_hostname,&#xD;&#xA;  reject_non_fqdn_sender,&#xD;&#xA;  reject_non_fqdn_recipient,&#xD;&#xA;  reject_unauth_destination,&#xD;&#xA;  reject_unauth_pipelining,&#xD;&#xA;  reject_invalid_hostname&#xD;&#xA;smtpd_sasl_auth_enable = yes&#xD;&#xA;smtpd_sasl_local_domain = $myhostname&#xD;&#xA;smtpd_sasl_security_options = noanonymous&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Create the following files in /etc/postfix/:&#xD;&#xA;&#xD;&#xA;mysql_virtual_alias_maps.cf&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;user = postfix&#xD;&#xA;password = postfix&#xD;&#xA;hosts = localhost&#xD;&#xA;dbname = postfix&#xD;&#xA;table = alias&#xD;&#xA;select_field = goto&#xD;&#xA;where_field = address&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;mysql_virtual_domains_maps.cf&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;user = postfix&#xD;&#xA;password = postfix&#xD;&#xA;hosts = localhost&#xD;&#xA;dbname = postfix&#xD;&#xA;table = domain&#xD;&#xA;select_field = domain&#xD;&#xA;where_field = domain&#xD;&#xA;additional_conditions = and backupmx = &apos;0&apos; and active = &apos;1&apos;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;mysql_virtual_mailbox_maps.cf&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;user = postfix&#xD;&#xA;password = postfix&#xD;&#xA;hosts = localhost&#xD;&#xA;dbname = postfix&#xD;&#xA;table = mailbox&#xD;&#xA;select_field = maildir&#xD;&#xA;where_field = username&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;For SMTP AUTH, I have these cyrus-sasl packages installed, not sure I need all of them:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;rpm -qa | grep sasl&#xD;&#xA;cyrus-sasl-plain-2.1.19-5.EL4&#xD;&#xA;cyrus-sasl-sql-2.1.19-5.EL4&#xD;&#xA;cyrus-sasl-md5-2.1.19-5.EL4&#xD;&#xA;cyrus-sasl-2.1.19-5.EL4&#xD;&#xA;cyrus-sasl-devel-2.1.19-5.EL4&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Setup the following in /usr/lib/sasl2/smtpd.conf:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;pwcheck_method: auxprop&#xD;&#xA;mech_list: PLAIN LOGIN&#xD;&#xA;auxprop_plugin: sql&#xD;&#xA;sql_verbose: yes&#xD;&#xA;sql_engine: mysql&#xD;&#xA;sql_hostnames: localhost&#xD;&#xA;sql_user: postfix&#xD;&#xA;sql_passwd: postfix&#xD;&#xA;sql_database: postfix&#xD;&#xA;sql_select: select password from mailbox where username = &apos;%u@%r&apos;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Create the Dovecot/MySQL setup in /etc/dovecot-mysql.conf using these settings:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;db_host = 127.0.0.1&#xD;&#xA;db_port = 3306&#xD;&#xA;db = postfix&#xD;&#xA;db_user = postfix&#xD;&#xA;db_passwd = postfix&#xD;&#xA;db_client_flags = 0&#xD;&#xA;default_pass_scheme = PLAIN&#xD;&#xA;password_query = SELECT password FROM mailbox WHERE username = &apos;%u&apos;&#xD;&#xA;user_query = SELECT maildir, 106 AS uid, 106 AS gid FROM mailbox WHERE username = &apos;%u&apos;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then configure Dovecot to use MySQL by setting these options in /etc/dovecot.conf:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;auth_userdb = mysql /etc/dovecot-mysql.conf&#xD;&#xA;auth_passdb = mysql /etc/dovecot-mysql.conf&#xD;&#xA;first_valid_uid = 106&#xD;&#xA;default_mail_env = maildir:/home/vmail/%d/%n&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Also setup which protocols you want it to handle (you&apos;ll need regular IMAP for most webmail packages):&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;protocols =  imaps imap pop3s pop3&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Restart dovecot and postfix and check if it works. &#xD;&#xA;&#xD;&#xA;Now login to postfixadmin/admin and setup a test account.  You can send a test message from the server to test it:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;echo &quot;test postfixadmin&quot; | mail -s test test@yourdomain.com&#xD;&#xA;{code}&#xD;&#xA;</s:content>
        <s:mTime>2008-10-07 19:22:36.404</s:mTime>
        <s:cTime>2007-05-21 00:13:44.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/Postfix mbox to Maildir conversion'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/mass emailing best practices'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/Mail and DNS'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/mail not going through'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/xen'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/distros/RHEL 4'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#maildrop notes'/>
                <rdf:li rdf:resource='#john'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/rpm based php5.1 install'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#retep/extra packages for rhel4 and centos5'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/dovecot compile'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/Build php 5.1.6 rpm on RHEL4'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#Introduction to VoIP and Asterisk'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/where has my disk space gone'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
