1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-21 03:02:09 +00:00

Automatic account creation in Nextcloud Mail

If the app Nextcloud Mail app is installed the user mail account should be added automatically to this app.
This is already possible via the config.php.

So the emails can be reached directly in nextcloud, like already the contacts and the calendar.

see
* https://github.com/nextcloud/mail
* https://github.com/nextcloud/mail/blob/master/doc/admin.md#automatic-account-creation
This commit is contained in:
Pascal Garber 2018-08-22 20:15:33 +02:00 committed by GitHub
parent cb162da5fe
commit 426a652ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,6 +329,7 @@ fi
# * We need to set the logdateformat to something that will work correctly with fail2ban
# * mail_domain' needs to be set every time we run the setup. Making sure we are setting
# the correct domain name if the domain is being change from the previous setup.
# * Automatically add e-mail accounts in nextcloud mail
# Use PHP to read the settings file, modify it, and write out the new settings array.
TIMEZONE=$(cat /etc/timezone)
CONFIG_TEMP=$(/bin/mktemp)
@ -347,6 +348,18 @@ include("$STORAGE_ROOT/owncloud/config.php");
\$CONFIG['mail_domain'] = '$PRIMARY_HOSTNAME';
\$CONFIG['app.mail.accounts.default'] = array(
'email' => '%EMAIL%',
'imapHost' => '$PRIMARY_HOSTNAME',
'imapPort' => 993,
'imapUser' => '%EMAIL%',
'imapSslMode' => 'ssl',
'smtpHost' => '$PRIMARY_HOSTNAME',
'smtpPort' => 587,
'smtpUser' => '%EMAIL%',
'smtpSslMode' => 'tls',
);
echo "<?php\n\\\$CONFIG = ";
var_export(\$CONFIG);
echo ";";