Debugging the iRedmail stack

iRedMail is a script that will take care of all the configuration of a mail server. That’s a lot less trouble for the admin as it’s really automagical! But recently after upgrading Ubunt server 12.04 to 14.04, I couldn’t send/receive my mails anymore.

And as everytime, I completly forgot where are the proper log to consult, which program were installed by iRedMail etc…Here is a post to simplify this next time I’ll have a problem:

iRedMail Debugging

If not able to send/receive mails, first try to connect the IMAP server (dovecot) using K9-mail or Roundcube. (Dovecot log : /etc/log/dovecot.log)

If login is OK, try sending a mail. And look at /etc/log/mail.log and /etc/log/mail.err

If you see :  connect to 127.0.0.1[127.0.0.1]:10024: Connection refused the it means that Amavis is not running (port 10024). Try restarting  /etc/init.d/amavis restart   and check that it’s well running netstat -tap | grep amavisd   if not, it could be that you server do not have enough RAM (iRedMail needs 1Go minimum). In such case, you still can run the mail server, but you’ll have to disable Amavis/ClamAV/SpamAssassin.

If your server has 1Go, then you should run Amavis in debug mode using /etc/init.d/amavis debug   and see the output.

In my case, a folder in /var/lib/amavis didn’t had the appropriate rights and Amavis daemon couldn’t write inside (see below debug output)

/usr/sbin/amavisd-new[29699]: (!!)TROUBLE in pre_loop_hook: QUARANTINEDIR directory /var/lib/amavis/virusmails not writable at /usr/sbin/amavisd-new line 10926.

So I just chown -R amavis: /var/lib/amavis/virusmails   and restarted my server (thanks to ZhangHuangBin). It works great now! Below, a summary of the whole iRedMail stack:

The iRedMail stack

Details of iRedMail installation with Conf files, logs, RC-start scripts…etc

SSL cert keys (size: 2048):
– /etc/ssl/certs/iRedMail_CA.pem
– /etc/ssl/private/iRedMail.key

Mail Storage:
– Root directory: /var/vmail
– Mailboxes: /var/vmail/vmail1
– Backup scripts and copies: /var/vmail/backup

PHP:
* Configuration file: /etc/php5/apache2/php.ini
* Disabled functions: show_source,system,shell_exec,passthru,exec,phpinfo,proc_open

OpenLDAP:
* Configuration files:
– /etc/ldap
– /etc/ldap/slapd.conf
– /etc/ldap/ldap.conf
– /etc/ldap/schema/iredmail.schema
* Log file related:
– /etc/rsyslog.d/iredmail.conf
– /var/log/openldap.log
– /etc/logrotate.d/openldap
* Data dir and files:
– /var/lib/ldap
– /var/lib/ldap/vbonhomme.fr
– /var/lib/ldap/vbonhomme.fr/DB_CONFIG
* RC script:
– /etc/init.d/slapd
* See also:
– /root/iRedMail-0.8.6/conf/ldap_init.ldif

Postfix (basic):
* Configuration files:
– /etc/postfix
– /etc/postfix/aliases
– /etc/postfix/main.cf
– /etc/postfix/master.cf

Postfix (LDAP):
* Configuration files:
– /etc/postfix/ldap/virtual_mailbox_domains.cf
– /etc/postfix/ldap/relay_domains.cf
– /etc/postfix/ldap/transport_maps_domain.cf
– /etc/postfix/ldap/transport_maps_user.cf
– /etc/postfix/ldap/virtual_mailbox_maps.cf
– /etc/postfix/ldap/sender_login_maps.cf
– /etc/postfix/ldap/virtual_alias_maps.cf
– /etc/postfix/ldap/virtual_group_maps.cf
– /etc/postfix/ldap/virtual_group_members_maps.cf
– /etc/postfix/ldap/catchall_maps.cf
– /etc/postfix/ldap/recipient_bcc_maps_domain.cf
– /etc/postfix/ldap/recipient_bcc_maps_user.cf
– /etc/postfix/ldap/sender_bcc_maps_domain.cf
– /etc/postfix/ldap/sender_bcc_maps_user.cf

Policyd (cluebringer):
* Web UI:
– URL: httpS://xxxxxxxxxxx/cluebringer/
– Username: xxxxxXXXXX
– Password: xxxxxXXXXX
* Configuration files:
– /etc/cluebringer/cluebringer.conf
– /etc/cluebringer/cluebringer-webui.conf
* RC script:
– /etc/init.d/postfix-cluebringer
* Database:
– Database name: cluebringer
– Database user: cluebringer
– Database password: xxxxxxXXXXXXXX

* Log file:
– /etc/rsyslog.d/iredmail.conf

Dovecot:
* Configuration files:
– /etc/dovecot/dovecot.conf
– /etc/dovecot/dovecot-ldap.conf (For OpenLDAP backend)
– /etc/dovecot/dovecot-mysql.conf (For MySQL backend)
– /etc/dovecot/dovecot-pgsql.conf (For PostgreSQL backend)
– /etc/dovecot/dovecot-used-quota.conf (For real-time quota usage)
– /etc/dovecot/dovecot-share-folder.conf (For IMAP sharing folder)
* RC script: /etc/init.d/dovecot
* Log files:
– /var/log/dovecot.log
– /var/log/sieve.log
* See also:
– /var/vmail/sieve/dovecot.sieve
– Logrotate config file: /etc/logrotate.d/dovecot

ClamAV:
* Configuration files:
– /etc/clamav/clamd.conf
– /etc/clamav/freshclam.conf
– /etc/logrotate.d/clamav
* RC scripts:
+ /etc/init.d/clamav-daemon
+ /etc/init.d/clamav-freshclam
* Log files:
– /var/log/clamav/clamd.log
– /var/log/clamav/freshclam.log

Amavisd-new:
* Configuration files:
– /etc/amavis/conf.d/50-user
– /etc/postfix/master.cf
– /etc/postfix/main.cf
* RC script:
– /etc/init.d/amavis
* MySQL Database:
– Database name: amavisd
– Database user: amavisd
– Database password: xxxxxxXXXXXX

SpamAssassin:
* Configuration files and rules:
– /etc/mail/spamassassin
– /etc/mail/spamassassin/local.cf

iRedAPD – Postfix Policy Daemon:
* Version: 1.4.2
* Listen address: 127.0.0.1, port: 7777
* Related files:
– /opt/iRedAPD-1.4.2/
– /opt/iredapd/
– /opt/iredapd/etc/settings.py

iRedAdmin – official web-based admin panel:
* Version: 0.3
* Configuration files:
– /usr/share/apache2/iRedAdmin-0.3/
– /usr/share/apache2/iRedAdmin-0.3/settings.py*
* URL:
– https://xxxxxxxxxxx/iredadmin/
* Login account:
– Username: xxxxxxxxxxx, password: xxxxxxxxxxxx
* SQL database account:
– Database name: iredadmin
– Username: iredadmin
– Password: xxxxxxxxxxxxxxxxxxx
* Settings:
– /usr/share/apache2/iRedAdmin-0.3/settings.py
* See also:
– /etc/apache2/conf.d/iredadmin.conf

Roundcube webmail:
* Configuration files:
– /usr/share/apache2/roundcubemail-0.9.5/
– /usr/share/apache2/roundcubemail-0.9.5/config/
* URL:
– http://xxxxxxxxxxxxx/mail/
– https://xxxxxxxxxxxx/mail/ (Over SSL/TLS)
– http://xxxxxxxxxxxxx/webmail/
– https://xxxxxxxxxxxxx/webmail/ (Over SSL/TLS)
* See also:
– /etc/apache2/conf.d/roundcubemail.conf

phpLDAPadmin:
* Configuration files:
– /usr/share/phpldapadmin/config/config.php
* See also:
– /etc/apache2/conf.d/phpldapadmin.conf

 

Hope it will be helpful to you.