Hi perlporter,
Could you try the latest development again? It works for me here: FreeBSD 9.0-RELEASE with ezjail.
MySQL permission issue should be fixed with addition SQL command (in functions/mysql.sh):
-- Allow GRANT privilege
UPDATE user SET Grant_priv='Y' WHERE User='${MYSQL_ROOT_USER}' AND Host='${SQL_HOSTNAME}';
Below are steps:
- Check out the latest development version: hg clone https://bitbucket.org/zhb/iredmail
- Update parameter LOCAL_ADDRESS to the IP of your Jail in iRedMail/conf/global before you execute it:
export LOCAL_ADDRESS='192.168.x.x'
Here 192.168.x.x is the IP address of your Jail. As you already know, SQL_HOSTNAME will be set to 192.168.x.x automatically.
- Start iRedMail installer with below command:
# _DEBUG=YES bash iRedMail.sh
With _DEBUG=YES, it will output some more detail info, so that i can know which steps were not successfully performed.
Be careful, port security/cyrus-sasl2 may interrupt iRedMail installation, don't panic, install it manually then re-execute iRedMail.sh.
# cd /usr/ports/security/cyrus-sasl2/
# make clean
# make install clean
Here's output of installation if you're interested in:
********************************************************************
* Start iRedMail Configurations
********************************************************************
< INFO > Create SSL certification files.
< INFO > Create required system accounts: vmail, iredapd, iredadmin.
< DEBUG > Create HOME folder for vmail user.
< DEBUG > Create system user/group: vmail:vmail.
< DEBUG > Create directory to store user sieve rule files: /var/vmail/sieve.
< DEBUG > Create system user: iredadmin.
< DEBUG > Create system user: iredapd.
< INFO > Configure Apache web server and PHP.
< Backup > /usr/local/etc/apache22/httpd.conf -> httpd.conf.2012.08.21.11.58.57.
< Backup > /usr/local/etc/apache22/extra/httpd-ssl.conf -> httpd-ssl.conf.2012.08.21.11.58.57.
< DEBUG > Basic configurations.
< DEBUG > Set correct SSL Cert/Key file location.
< DEBUG > Enable modules.
< DEBUG > Configure Apache.
< DEBUG > Add setting in /etc/rc.conf: apache22_enable='YES'
< DEBUG > Add setting in /etc/rc.conf: htcacheclean_enable='NO'
< DEBUG > Disable several functions: /usr/local/etc/php.ini.
< DEBUG > Hide PHP Version in Apache from remote users requests: /usr/local/etc/php.ini.
< DEBUG > Increase 'memory_limit' to 128M: /usr/local/etc/php.ini.
< DEBUG > Increase 'upload_max_filesize', 'post_max_size' to 10/12M: /usr/local/etc/php.ini.
< DEBUG > Disable php extension: suhosin. /usr/local/etc/php.ini.
< INFO > Configure MySQL database server.
< DEBUG > Starting MySQL.
< DEBUG > Add setting in /etc/rc.conf: mysql_enable='YES'
< DEBUG > Sleep 5 seconds for MySQL daemon initialize ...
< DEBUG > Grant access privilege from 172.16.122.244 ...
< DEBUG > Initialize MySQL database.
< DEBUG > Generating SQL template for postfix virtual hosts: /root/iRedMail/conf/mysql_vmail.sql.
< DEBUG > Import postfix virtual hosts/users: /root/iRedMail/conf/mysql_vmail.sql.
< INFO > Configure Postfix (Message Transfer Agent).
< Backup > /usr/local/etc/postfix/main.cf -> main.cf.2012.08.21.11.58.57.
< Backup > /usr/local/etc/postfix/master.cf -> master.cf.2012.08.21.11.58.57.
< DEBUG > Enable chroot.
< DEBUG > Copy: /etc/{hosts,resolv.conf,localtime,services} -> /var/spool/postfix/etc/
< Backup > /etc/mail/mailer.conf -> mailer.conf.2012.08.21.11.58.57.
< DEBUG > Add setting in /etc/rc.conf: postfix_enable='YES'
< DEBUG > Add setting in /etc/rc.conf: sendmail_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: sendmail_submit_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: sendmail_outbound_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: sendmail_msp_queue_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: daily_clean_hoststat_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: daily_status_mail_rejects_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: daily_status_include_submit_mailq='NO'
< DEBUG > Add setting in /etc/rc.conf: daily_submit_queuerun='NO'
< DEBUG > Configure Postfix for MySQL lookup.
< DEBUG > Set file permission: Owner/Group -> postfix/postfix, Mode -> 0640.
< DEBUG > Configure SMTP SASL authentication.
< DEBUG > Enable TLS/SSL support in Postfix.
< INFO > Configure Policyd (postfix policy server, version 1.8).
< DEBUG > Add user and group for policyd: policyd:policyd.
< DEBUG > Initialize MySQL database of policyd.
< DEBUG > Configure policyd: /usr/local/etc/postfix-policyd-sf.conf.
< DEBUG > Setting cron job for policyd user: policyd.
< DEBUG > Add setting in /etc/rc.conf: postfix_policyd_sf_enable='YES'
< INFO > Configure Dovecot (pop3/imap/managesieve server, version 2).
< DEBUG > Configure dovecot: /usr/local/etc/dovecot/dovecot.conf.
< DEBUG > Copy sample sieve global filter rule file: /var/vmail/sieve/dovecot.sieve.sample.
< DEBUG > Create dovecot log file: /var/log/dovecot.log, /var/log/sieve.log.
< DEBUG > Enable dovecot SASL support in postfix: /usr/local/etc/postfix/main.cf.
< DEBUG > Create directory for Dovecot plugin: Expire.
< DEBUG > Setting logrotate for dovecot log file.
< DEBUG > Add setting in /etc/rc.conf: dovecot_enable='YES'
< INFO > Configure ClamAV (anti-virus toolkit).
< Backup > /usr/local/etc/clamd.conf -> clamd.conf.2012.08.21.11.58.57.
< Backup > /usr/local/etc/freshclam.conf -> freshclam.conf.2012.08.21.11.58.57.
< DEBUG > Configure ClamAV: /usr/local/etc/clamd.conf.
< DEBUG > Configure freshclam: /usr/local/etc/freshclam.conf.
< DEBUG > Add clamav user to amavid group.
< DEBUG > Add setting in /etc/rc.conf: clamav_clamd_enable='YES'
< DEBUG > Add setting in /etc/rc.conf: clamav_freshclam_enable='YES'
< INFO > Configure Amavisd-new (interface between MTA and content checkers).
< Backup > /usr/local/etc/amavisd.conf -> amavisd.conf.2012.08.21.11.58.57.
< Backup > /usr/local/etc/amavisd.conf -> amavisd.conf.2012.08.21.11.58.57.
< DEBUG > Configure amavisd-new: /usr/local/etc/amavisd.conf.
< DEBUG > Add setting in /etc/rc.conf: amavisd_enable='YES'
< DEBUG > Add setting in /etc/rc.conf: amavisd_pidfile='/var/amavis/amavisd.pid'
< DEBUG > Add setting in /etc/rc.conf: amavis_milter_enable='NO'
< DEBUG > Add setting in /etc/rc.conf: amavis_p0fanalyzer_enable='NO'
< DEBUG > Generate DKIM pem files: /var/lib/dkim/a.cn.pem.
< DEBUG > Setting cron job for vmail user to delete virus mail per month.
< DEBUG > Import Amavisd database and privileges.
< INFO > Configure SpamAssassin (content-based spam filter).
< DEBUG > Generate new configuration file: /usr/local/etc/mail/spamassassin/local.cf.
< DEBUG > Enable crontabs for SpamAssassin update.
< DEBUG > Compile SpamAssassin ruleset into native code.
< INFO > Configure iRedAPD (postfix policy daemon).
< DEBUG > Extracting: iRedAPD-1.3.8.tar.bz2 -> /opt
< DEBUG > Configure iRedAPD.
< DEBUG > Make iredapd start after system startup.
< DEBUG > Add setting in /etc/rc.conf: iredapd_enable='YES'
< INFO > Configure iRedAdmin (official web-based admin panel).
< DEBUG > Extracting: iRedAdmin-0.1.9.tar.bz2 -> /usr/local/www
< DEBUG > Set correct permission for iRedAdmin: /usr/local/www/iRedAdmin-0.1.9.
< DEBUG > Create directory alias for iRedAdmin.
< DEBUG > Import iredadmin database template.
< DEBUG > Configure iRedAdmin.
< DEBUG > Configure general settings.
< DEBUG > Configure iredadmin database related settings.
< DEBUG > Configure MySQL related settings.
< DEBUG > Configure Policyd related settings.
< DEBUG > Configure Amavisd related settings.
< INFO > Configure Awstats (logfile analyzer for mail and web server).
< DEBUG > Generate apache config file for awstats: /usr/local/etc/apache22/Includes/awstats.conf.
< DEBUG > Setup user auth for awstats: /usr/local/etc/apache22/Includes/awstats.conf.
< DEBUG > Config awstats to analyze apache web access log: /usr/local/www/awstats/cgi-bin/awstats.web.conf.
< Backup > /usr/local/www/awstats/cgi-bin/awstats.model.conf -> awstats.model.conf.2012.08.21.11.58.57.
< DEBUG > Config awstats to analyze postfix mail log: /usr/local/www/awstats/cgi-bin/awstats.smtp.conf.
< DEBUG > Setting cronjob for awstats.
< INFO > Configure Roundcube webmail.
< DEBUG > Create directory alias for Roundcubemail.
< Backup > /usr/local/www/apache22/data/index.html -> index.html.2012.08.21.11.58.57.
< DEBUG > Import MySQL database and privileges for Roundcubemail.
< DEBUG > Configure database for Roundcubemail: /usr/local/www/roundcube/config/*.
< DEBUG > Enable and config plugin: managesieve.
< DEBUG > Enable and config plugin: password.
< INFO > Configure phpMyAdmin (web-based MySQL management tool).
< DEBUG > Create directory alias for phpMyAdmin in Apache: /usr/local/etc/apache22/Includes/phpmyadmin.conf.
< DEBUG > Config phpMyAdmin: /usr/local/www/phpMyAdmin/config.inc.php.
*************************************************************************
* iRedMail-0.8.1 installation and configuration complete.
*************************************************************************
< DEBUG > Decrease sshd service start order via chkconfig.
< DEBUG > Setup backup script: /var/vmail/backup/backup_mysql.sh
< INFO > Updating SpamAssassin rules (sa-update), please wait ...
< INFO > Compiling SpamAssassin rulesets (sa-compile), please wait ...
< INFO > Updating ClamAV database (freshclam), please wait ...
ClamAV update process started at Tue Aug 21 13:32:47 2012
Downloading main.cvd [100%]
main.cvd updated (version: 54, sigs: 1044387, f-level: 60, builder: sven)
Downloading daily.cvd [100%]
daily.cvd updated (version: 15279, sigs: 258017, f-level: 63, builder: guitar)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 188, sigs: 38, f-level: 63, builder: neo)
Database updated (1302442 signatures) from database.clamav.net (IP: 200.236.31.1)
WARNING: Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.sock
connect(): No such file or directory
********************************************************************
* URLs of installed web applications:
*
* - Webmail: httpS://mx.irm.org/mail/
* - Admin Panel (iRedAdmin): httpS://mx.irm.org/iredadmin/
* + Username: postmaster@a.cn, Password: www
*
********************************************************************
* Congratulations, mail server setup complete. Please refer to tip
* file for more information:
*
* - /root/iRedMail/iRedMail.tips
*
* And it's sent to your mail account postmaster@a.cn.
*
* Please reboot your system to enable mail services.
*
********************************************************************
Output of netstat (172.16.122.244 is the IP address of Jail):
# netstat -nal -p tcp | grep 172.16.122.244
tcp4 0 0 172.16.122.244.443 *.* LISTEN
tcp4 0 0 172.16.122.244.80 *.* LISTEN
tcp4 0 0 172.16.122.244.7777 *.* LISTEN
tcp4 0 0 172.16.122.244.10025 *.* LISTEN
tcp4 0 0 172.16.122.244.587 *.* LISTEN
tcp4 0 0 172.16.122.244.25 *.* LISTEN
tcp4 0 0 172.16.122.244.3306 172.16.122.244.43143 ESTABLISHED
tcp4 0 0 172.16.122.244.43143 172.16.122.244.3306 ESTABLISHED
tcp4 0 0 172.16.122.244.10031 *.* LISTEN
tcp4 0 0 172.16.122.244.9998 *.* LISTEN
tcp4 0 0 172.16.122.244.10024 *.* LISTEN
tcp4 0 0 172.16.122.244.3306 *.* LISTEN