Hi Zhang,
shame on me, that was the only thing to setup before running the iRedMail.sh script and I didn't run it.
Anyway, I have rerun the installation, on a fresh jail, but it failed. It seems that postgresql setup fails at some point and the server does not start successfully or the script fails to connect, resulting in an empty database.
I tried to add a "trust" line in pg_hba.conf so I can connect to postgresql server and run the "pgsql_init.pgsql" from the runtime dir just to try if this is enough, but there are still errors in /var/log/maillog file about amavisd that cannot connect to the postgresql server. I performed a quick check and, as expected and reasonable, the database is called by many services.
Please find below the relevant lines from the new install.log:
[...snip...]
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/local/bin/postgres -D /usr/local/pgsql/data
or
/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
+ < DEBUG > Make sure PostgreSQL binds to local address: 192.168.2.232.
+ < DEBUG > Set client_min_messages to ERROR.
+ < DEBUG > Copy iRedMail SSL cert/key with strict permission.
+ < DEBUG > Start PostgreSQL server
pg_ctl: PID file "/usr/local/pgsql/data/postmaster.pid" does not exist
Is server running?
starting server anyway
pg_ctl: could not read file "/usr/local/pgsql/data/postmaster.opts"
+ < DEBUG > Sleep 5 seconds for PostgreSQL daemon initialize ...
+ < DEBUG > Setting password for PostgreSQL admin: (pgsql).
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
+ < DEBUG > Update pg_hba.conf to force local users to authenticate with md5.
+ < DEBUG > Restart PostgreSQL server and sleeping for 5 seconds.
pg_ctl: PID file "/usr/local/pgsql/data/postmaster.pid" does not exist
Is server running?
starting server anyway
pg_ctl: could not read file "/usr/local/pgsql/data/postmaster.opts"
+ < DEBUG > Generate /usr/local/pgsql/.pgpass.
+ < DEBUG > Generating SQL template for postfix virtual hosts: /root/iRedMail-0.9.4/runtime/pgsql_init.pgsql.
+ < DEBUG > Import virtual mail accounts: /root/iRedMail-0.9.4/runtime/pgsql_init.pgsql.
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[ INFO ] Setup daily cron job to backup PostgreSQL databases with /var/vmail/backup/backup_pgsql.sh
[ INFO ] Configure Postfix (Message Transfer Agent).
+ < DEBUG > Enable chroot.
+ < DEBUG > Enable submission and additional transports required by Amavisd and Dovecot.
+ < DEBUG > Copy: /etc/{hosts,resolv.conf,localtime,services} -> /var/spool/postfix/etc/
+ < DEBUG > Configure Postfix for SQL/LDAP lookup.
+ < DEBUG > Enable postscreen service.
* [BACKUP] /usr/local/etc/postfix/main.cf -> /usr/local/etc/postfix/main.cf.2016.04.23.14.35.02.
* [BACKUP] /usr/local/etc/postfix/master.cf -> /usr/local/etc/postfix/master.cf.2016.04.23.14.35.02.
* Comment out 'smtp inet ... smtpd' service in /usr/local/etc/postfix/master.cf.
* Uncomment the new 'smtpd pass ... smtpd' service in /usr/local/etc/postfix/master.cf.
* Uncomment the new smtp inet ... postscreen service in /usr/local/etc/postfix/master.cf.
* Uncomment the new 'tlsproxy unix ... tlsproxy' service in /usr/local/etc/postfix/master.cf.
* Uncomment the new 'dnsblog unix ... dnsblog' service in /usr/local/etc/postfix/master.cf.
* Update /usr/local/etc/postfix/main.cf to enable postscreen.
* Create /var/spool/postfix//var/db/postfix/postscreen_cache.db.
* Reloading postfix service to read the new configuration.
* postscreen is now enabled.
[ INFO ] Configure Dovecot (pop3/imap/managesieve server).
+ < DEBUG > Configure dovecot: /usr/local/etc/dovecot/dovecot.conf.
+ < DEBUG > Copy global sieve filter rule file: /var/vmail/sieve/dovecot.sieve.
+ < DEBUG > Create dovecot log file: /var/log/dovecot.log.
+ < DEBUG > Create dovecot log file: /var/log/dovecot-sieve.log.
+ < DEBUG > Create dovecot log file: /var/log/dovecot-lmtp.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.
ln: /usr/lib/sendmail: Read-only file system
[ INFO ] Configure ClamAV (anti-virus toolkit).
+ < DEBUG > Configure ClamAV: /usr/local/etc/clamd.conf.
+ < DEBUG > Configure freshclam: /usr/local/etc/freshclam.conf.
+ < DEBUG > Add clamav user to amavid group.
[ INFO ] Configure Amavisd-new (interface between MTA and content checkers).
+ < DEBUG > Configure amavisd-new: /usr/local/etc/amavisd.conf.
+ < DEBUG > Generate DKIM pem files: /var/lib/dkim/XXXXXXXX.XXX.pem.
+ < DEBUG > Setting cron job for vmail user to delete virus mail per month.
+ < DEBUG > Import Amavisd database and privileges.
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[ INFO ] Configure SpamAssassin (content-based spam filter).
+ < DEBUG > Copy sample SpamAssassin config file: /root/iRedMail-0.9.4/samples/spamassassin/local.cf -> /usr/local/etc/mail/spamassassin/local.cf.
+ < DEBUG > Enable crontabs for SpamAssassin update.
+ < DEBUG > Compile SpamAssassin ruleset into native code.
Apr 23 14:35:10.732 [88463] info: generic: base extraction starting. this can take a while...
cd /
rm -rf /tmp/.spamassassin88463H0IcXitmp
[ INFO ] Configure iRedAPD (postfix policy daemon).
+ < DEBUG > Extracting: iRedAPD-1.8.0.tar.bz2 -> /opt
+ < DEBUG > Configure iRedAPD.
+ < DEBUG > Make iredapd start after system startup.
+ < DEBUG > Import iRedAPD database template.
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
+ < DEBUG > Updating greylisting whitelists based on whitelist domain names.
[ INFO ] Configure iRedAdmin (official web-based admin panel).
[...snip...]
Please let me know if I can help in some way.
Thank you,
tino