1

Topic: Connecting IredMail with an external Postgres database

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6
- Linux/BSD distribution name and version:  Debian Jessie
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

I want to connect iRedmail to an external PostgreSQL database. How to set the configuration files to connect directly to the external Postgres DB after iredmail setup ? If it's not possible before the setup, how to make iredmail point to that external db ?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Connecting IredMail with an external Postgres database

In iRedMail installation directory, you can find file "iRedMail.tips". e.g. iRedMail-0.9.6/iRedMail.tips. It contains locations of all config files, and SQL database names/credentials.

You can export sql databases to external pgsql server, then update config files to use IP/hostname of external pgsql as sql server address.

3

Re: Connecting IredMail with an external Postgres database

OK, thanks. What about using an existing database by just adding  iredmail tables to it ? Is that possible ?

4

Re: Connecting IredMail with an external Postgres database

mohamedmaalej.sde wrote:

OK, thanks. What about using an existing database by just adding  iredmail tables to it ? Is that possible ?

Should be fine.

5 (edited by mohamedmaalej.sde 2017-01-23 21:52:52)

Re: Connecting IredMail with an external Postgres database

OK.So, what's  the SQL file used to create the whole database during installation ? (Where it is located ?)
It said "psql: could not connect to server, no such file or directory" when I tried to launch the setup after modifying the PGSQL_SERVER_ADDRESS  in /conf/global by entering the address : 172.17.0.3 which corresponds to the IP address of the PostgreSQL Docker container. Also, how can I apply configuration changes after iredmail installation ? (For example, if I will modify the database URL, how changes can be applied upon the execution of a such change ? )

6

Re: Connecting IredMail with an external Postgres database

*) Isn't it easier to dump from the pgsql server running on iRedMail server?
*) Check files 'iRedMail-0.9.6/runtime/*.sql'.

7 (edited by mohamedmaalej.sde 2017-01-23 23:51:42)

Re: Connecting IredMail with an external Postgres database

*) For the first point : we need 2 distinct containers (the first one is for iredmail and the second one is for Postgresql). We already have an existing database for our application. Now, we need to add mailing features. That's implies that we should add iredmail tables to our existing PostgreSQL database.

*) For the second point: thanks for that information. I will check those sql files.