mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
apps: add mailbox/IMAP support for apps that declared a system user with mail enabled (#1745)
* Add missing account registration for apps in postfix * Also set email on dovecot DB * fix undefined var * Fix missing username format config in dovecot
This commit is contained in:
parent
4284cd5d10
commit
a729c78379
3 changed files with 7 additions and 6 deletions
|
@ -57,7 +57,7 @@ userdb {
|
||||||
|
|
||||||
userdb {
|
userdb {
|
||||||
driver = passwd-file
|
driver = passwd-file
|
||||||
args = /etc/dovecot/app-senders-passwd
|
args = username_format=%n /etc/dovecot/app-senders-passwd
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol imap {
|
protocol imap {
|
||||||
|
|
|
@ -100,7 +100,7 @@ message_size_limit = 35914708
|
||||||
|
|
||||||
# Virtual Domains Control
|
# Virtual Domains Control
|
||||||
virtual_mailbox_domains = ldap:/etc/postfix/ldap-domains.cf
|
virtual_mailbox_domains = ldap:/etc/postfix/ldap-domains.cf
|
||||||
virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
|
virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf,hash:/etc/postfix/app_senders_login_maps
|
||||||
virtual_mailbox_base =
|
virtual_mailbox_base =
|
||||||
virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-groups.cf
|
virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-groups.cf
|
||||||
virtual_alias_domains =
|
virtual_alias_domains =
|
||||||
|
|
|
@ -3267,14 +3267,15 @@ def regen_mail_app_user_config_for_dovecot_and_postfix(only=None):
|
||||||
if "domain" not in settings or "mail_pwd" not in settings:
|
if "domain" not in settings or "mail_pwd" not in settings:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
mail_user = settings.get("mail_user", app)
|
||||||
|
mail_domain = settings.get("mail_domain", settings["domain"])
|
||||||
|
|
||||||
if dovecot:
|
if dovecot:
|
||||||
hashed_password = _hash_user_password(settings["mail_pwd"])
|
hashed_password = _hash_user_password(settings["mail_pwd"])
|
||||||
dovecot_passwd.append(
|
dovecot_passwd.append(
|
||||||
f"{app}:{hashed_password}::::::allow_nets=::1,127.0.0.1/24,local"
|
f"{app}:{hashed_password}::::::allow_nets=::1,127.0.0.1/24,local,mail={mail_user}@{mail_domain}"
|
||||||
)
|
)
|
||||||
if postfix:
|
if postfix:
|
||||||
mail_user = settings.get("mail_user", app)
|
|
||||||
mail_domain = settings.get("mail_domain", settings["domain"])
|
|
||||||
postfix_map.append(f"{mail_user}@{mail_domain} {app}")
|
postfix_map.append(f"{mail_user}@{mail_domain} {app}")
|
||||||
|
|
||||||
if dovecot:
|
if dovecot:
|
||||||
|
|
Loading…
Add table
Reference in a new issue