Comments (3)
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.
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.
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)
- bug report: `SSL_TYPE=none` should not disable STARTTLS for outbound SMTP connections HOT 8
- Sender dependent relay should NOT require RELAY_HOST env HOT 6
- question: Why does `SMTP_ONLY=1` still allow to receive mail locally? HOT 5
- bug report: [Windows] No difference after call to 'sed' in 'sedfile' HOT 3
- feature request: Support per-user SASL authentication when used as a relay HOT 3
- Question: How to merge 2 servers into 1? HOT 3
- other: Question lost connection after BDAT / DATA in postfix HOT 3
- How to send email by java-smpt/pop3,how to get auth-code HOT 3
- Userdb alias dummy accounts use wrong home directory HOT 2
- Feature request: Replace Redis HOT 4
- question: Why does LetsEncrypt certificate from `nginxproxy/acme-companion` fail to send mail with TLS? HOT 4
- Rspamd rejects `asciinema` e-mails HOT 45
- bug report: I copied volumes to another system to migrate DMS but it fails to start properly HOT 8
- bug report: bad hostname or network address: 127.0.0.1:10025 HOT 17
- bug report: setup script alway fail with "setup email list" related on the user name HOT 18
- bug report: getmail not set up HOT 3
- [BUG]: RSPAMD needs a password for the web interface HOT 16
- [BUG]: Solr image is oudated and does not support arm64 HOT 17
- bug report: docker-mailserver unable to send mails to other domains once LDAP is configured. HOT 5
- Helm Chart Admin Access HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-mailserver.