Giter Club home page Giter Club logo

Comments (3)

glime-ai avatar glime-ai commented on June 8, 2024 1

Please note that this response was created using generative AI, leveraging previously available information from the repository. This information may be helpful. However, it is our strong recommendation that you carefully consider the information before blindly applying it.


To integrate PostgreSQL or any other database for mailbox account management with Docker Mailserver (DMS), you would need to develop a custom solution outside of DMS. DMS itself does not support direct integration with databases for managing mail accounts as it relies solely on configuration files and the filesystem for its operation. This design choice is highlighted in the FAQ section of the DMS documentation, stating that no database is required and the filesystem acts as the database.

For your requirement, you could develop an external application or script that interacts with PostgreSQL for account management purposes. This application could then modify the relevant DMS configuration files (such as postfix-accounts.cf for user accounts) based on the data in your PostgreSQL database. However, you would need to ensure that any changes made to the configuration files are properly applied to the running DMS instance. This might involve reloading or restarting the DMS container to apply the changes.

Remember, direct modification of DMS configuration files by external processes requires careful handling to avoid conflicts and ensure that the mail server configuration remains consistent and valid. Additionally, you would need to manage the synchronization between the database state and the filesystem state to keep them in sync.

For more advanced user management, considering LDAP might be an alternative. DMS supports LDAP for authentication and account management, which could potentially fulfill your requirements without needing to directly integrate a SQL database.

In summary, while DMS does not natively support SQL databases for account management, you can develop an external mechanism to manage accounts in a PostgreSQL database and reflect those changes in DMS's configuration files. Careful consideration and testing are advised to ensure the stability and security of your mail server setup.

This comment was generated by Glime.

from docker-mailserver.

polarathene avatar polarathene commented on June 8, 2024

For your requirement, you could develop an external application or script that interacts with PostgreSQL for account management purposes. This application could then modify the relevant DMS configuration files (such as postfix-accounts.cf for user accounts) based on the data in your PostgreSQL database.

While that is a technically valid approach, going to that effort it may be easier to just read the Postfix docs for configuring for a DB.

That said, I don't think DMS will smoothly support such as the startup scripts assume an account provisioner we know of is configured. That'd probably need an opt-out option to not conflict with a third-party provisioner. Thus the advice from Glime here to bridge the external DB via our setup ... commands or their associated configs directly is more appropriate 👍


what should I do if I need to use PostgreSQL database?
Because now I need to connect the database in my application for mailbox account management.

We do not have support for that, you'd have to figure that out yourself and maintain it. You could potentially upstream changes that would make that easier to support, we've accepted similar before from a contributor that needed Lua in Dovecot for account management.

You may have better luck with an alternative to DMS which does embrace databases for account management.

from docker-mailserver.

georglauterbach avatar georglauterbach commented on June 8, 2024

In short: you don't. DMS is built on the premise that everything is stored in files. Other projects are more suited towards using databases.

from docker-mailserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.