+
Client Configuration Guide
+
Select your email client or operating system below to view a step-by-step guide to setting up your email account.
+
+
+
+
+ - Download and open Mailcow.mobileconfig.
+ - Enter the unlock code (iPhone) or computer password (Mac).
+ - Enter your email password three times when prompted.
+
+
On iOS, Exchange is also supported as an alternative to the procedure above. It has the advantage of supporting push email (i.e. you are immediately notified of incoming messages), but has some limitations, e.g. it does not support more than three email addresses per contact in your address book. Follow the steps below if you decide to use Exchange instead.
+
+ - Open the Settings app, tap Mail, tap Accounts, tap Add Acccount, select Exchange.
+ - Enter your email address (
) and tap Next.
+ - Enter your password, tap Next again.
+ - Finally, tap Save.
+
+
+
+
+
+ - Open the Email app.
+ - If this is your first email account, tap Add Account; if not, tap More and Settings and then Add account.
+ - Select Microsoft Exchange ActiveSync.
+ - Enter your email address (
) and password.
+ - Tap Sign in.
+
+
+
+
+ - Launch eM Client.
+ - If this is the first time you launched eM Client, it asks you to set up your account. Proceed to step 4.
+ - Go to Menu at the top, select Tools and Accounts.
+ - Enter your email address (
) and click Start Now.
+ - Enter your password and click Continue.
+ - Enter your name (
) and click Next.
+ - Click Finish.
+
+
+
+
+
+ - Launch Kontact.
+ - If this is the first time you launched Kontact or KMail, it asks you to set up your account. Proceed to step 4.
+ - Go to Mail in the sidebar. Go to the Tools menu and select Account Wizard.
+ - Enter your name (
), email address (
) and your password. Click Next.
+ - Click Create Account. If prompted, re-enter your password and click OK.
+ - Close the window by clicking Finish.
+ - Go to Calendar in the sidebar.
+ - Go to the Settings menu and select Configure KOrganizer.
+ - Go to the Calendars tab and click the Add button.
+ - Choose DAV groupware resource and click OK.
+ - Enter your email address (
) and your password. Click Next.
+ - Select ScalableOGo from the dropdown menu and click Next.
+ - Enter
= $autodiscover_config['caldav']['server']; ?>
into the Host field and click Next.
+ - Click Test Connection and then Finish. Finally, click OK twice.
+
+
Once you have set up Kontact, you can also use KMail, KOrganizer and KAddressBook individually.
+
+
+
+
+
+
Outlook 2013 or higher on Windows
+
+ - Launch Outlook.
+ - If this is the first time you launched Outlook, it asks you to set up your account. Proceed to step 4.
+ - Go to the File menu and click Add Account.
+ - Enter your name (
), email address (
) and your password. Click Next.
+ - When prompted, enter your password again, check Remember my credentials and click OK.
+ - Click the Allow button.
+ - Click Finish.
+
+
Outlook 2007 or 2010 on Windows
+
+
Outlook 2007 or higher on Windows
+
+
+ - Download and install Outlook CalDav Synchronizer.
+ - Launch Outlook.
+ - If this is the first time you launched Outlook, it asks you to set up your account. Proceed to step 5.
+ - Go to the File menu and click Add Account.
+ - Enter your name (
), email address (
) and your password. Click Next.
+ - Click Finish.
+ - Go to the CalDav Synchronizer ribbon, click Synchronization Profiles.
+ - Click the second button at top (Add multiple profiles), select Sogo, click Ok.
+ - Click the Get IMAP/POP3 account settings button.
+ - Click Discover resources and assign to Outlook folders.
+ - In the Select Resource window that pops up, select your main calendar (usually Personal Calendar), click the ... button, assign it to Calendar, and click OK. Go to the Address Books and Tasks tabs and repeat repeat the process accordingly. Do not assign multiple calendars, address books or task lists!
+ - Close all windows with the OK buttons.
+
+
Outlook 2011 or higher on macOS
+
The Mac version of Outlook does not synchronize calendars and contacts and therefore is not supported.
+
+
+
+
+
+ - Launch Thunderbird.
+ - If this is the first time you launched Thunderbird, it asks you whether you would like a new email address. Click Skip this and use my existing email and proceed to step 4.
+ - Go to the Tools menu and select Account Settings.
+ - Click the Account Actions dropdown menu at the bottom left and select Add Mail Account.
+ - Enter your name (
), email address (
) and your password. Make sure the Remember password checkbox is selected and click Continue.
+ - Once the configuration has been automatically detected, click Done.
+ - If you already had other accounts configured in Thunderbird, select the new one () on the left, click the Account Actions dropdown and select Set as Default.
+ - Close the account settings window with the OK button.
+ - In your web browser, download SOGo Integrator.
+ - Back in Thunderbird, go to the Tools menu and select Add-ons.
+ - Click Extensions on the left, click the little gear icon at the top and select Install Add-on From File. Select the file you downloaded in step 9, click Open and, after waiting for a few seconds, Install Now.
+ - Click the Restart Now button at the top that appears.
+ - Thunderbird briefly shows a message that it is updating extensions, then restarts automatically once more.
+ - When you are prompted to authenticate for = $autodiscover_config['caldav']['server']; ?>, enter your email address and password, check Use Password Manager and click OK.
+
+
+
+
+
+
+ - Open the Mail app.
+ - If you have not previously used Mail, you can click Add Account in the main window. Proceed to step 4.
+ - Click Accounts in the sidebar on the left, then click Add Account on the far right.
+ - Select Exchange.
+ - Enter your email address (
) and click Next.
+ - Enter your password and click Log in.
+
+
Once you have set up the Mail app, you can also use the People and Calendar apps.
+
+
+
+
+ - Open the Settings app. Select email + accounts and tap add an account.
+ - Tap Exchange.
+ - Enter your email address (
) and your password. Tap Sign in.
+ - Tap done.
+
+
+
+
diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php
index 8e7b7cfd..ffca2bea 100644
--- a/data/web/inc/functions.inc.php
+++ b/data/web/inc/functions.inc.php
@@ -62,17 +62,17 @@ function hasMailboxObjectAccess($username, $role, $object) {
}
return false;
}
+function pem_to_der($pem_key) {
+ // Need to remove BEGIN/END PUBLIC KEY
+ $lines = explode("\n", trim($pem_key));
+ unset($lines[count($lines)-1]);
+ unset($lines[0]);
+ return base64_decode(implode('', $lines));
+}
function generate_tlsa_digest($hostname, $port, $starttls = null) {
if (!is_valid_domain_name($hostname)) {
return "Not a valid hostname";
}
- function pem_to_der($pem_key) {
- // Need to remove BEGIN/END PUBLIC KEY
- $lines = explode("\n", trim($pem_key));
- unset($lines[count($lines)-1]);
- unset($lines[0]);
- return base64_decode(implode('', $lines));
- }
if (empty($starttls)) {
$context = stream_context_create(array("ssl" => array("capture_peer_cert" => true, 'verify_peer' => false, 'allow_self_signed' => true)));
@@ -88,20 +88,24 @@ function generate_tlsa_digest($hostname, $port, $starttls = null) {
return $error_nr . ': ' . $error_msg;
}
$banner = fread($stream, 512 );
- if (preg_match("/^220/i", $banner)) {
+ if (preg_match("/^220/i", $banner)) { // SMTP
fwrite($stream,"HELO tlsa.generator.local\r\n");
fread($stream, 512);
fwrite($stream,"STARTTLS\r\n");
fread($stream, 512);
}
- elseif (preg_match("/imap.+starttls/i", $banner)) {
+ elseif (preg_match("/imap.+starttls/i", $banner)) { // IMAP
fwrite($stream,"A1 STARTTLS\r\n");
fread($stream, 512);
}
- elseif (preg_match("/^\+OK/", $banner)) {
+ elseif (preg_match("/^\+OK/", $banner)) { // POP3
fwrite($stream,"STLS\r\n");
fread($stream, 512);
}
+ elseif (preg_match("/^OK/m", $banner)) { // Sieve
+ fwrite($stream,"STARTTLS\r\n");
+ fread($stream, 512);
+ }
else {
return 'Unknown banner: "' . htmlspecialchars(trim($banner)) . '"';
}
diff --git a/data/web/inc/vars.inc.php b/data/web/inc/vars.inc.php
index a52442db..05ef25dd 100644
--- a/data/web/inc/vars.inc.php
+++ b/data/web/inc/vars.inc.php
@@ -18,31 +18,48 @@ $database_name = getenv('DBNAME');
$mailcow_hostname = getenv('MAILCOW_HOSTNAME');
// Autodiscover settings
+$https_port = strpos($_SERVER['HTTP_HOST'], ':');
+if ($https_port === FALSE) {
+ $https_port = 443;
+} else {
+ $https_port = substr($_SERVER['HTTP_HOST'], $https_port+1);
+}
$autodiscover_config = array(
// Enable the autodiscover service for Outlook desktop clients
'useEASforOutlook' => 'yes',
// General autodiscover service type: "activesync" or "imap"
'autodiscoverType' => 'activesync',
- // Please don't use STARTTLS-enabled service ports here.
+ // Please don't use STARTTLS-enabled service ports in the "port" variable.
// The autodiscover service will always point to SMTPS and IMAPS (TLS-wrapped services).
+ // The autoconfig service will additionally announce the STARTTLS-enabled ports, specified in the "tlsport" variable.
'imap' => array(
'server' => $mailcow_hostname,
'port' => getenv('IMAPS_PORT'),
+ 'tlsport' => getenv('IMAP_PORT'),
+ ),
+ 'pop3' => array(
+ 'server' => $mailcow_hostname,
+ 'port' => getenv('POPS_PORT'),
+ 'tlsport' => getenv('POP_PORT'),
),
'smtp' => array(
'server' => $mailcow_hostname,
'port' => getenv('SMTPS_PORT'),
+ 'tlsport' => getenv('SUBMISSION_PORT'),
),
'activesync' => array(
- 'url' => 'https://'.$mailcow_hostname.'/Microsoft-Server-ActiveSync'
+ 'url' => 'https://'.$mailcow_hostname.($https_port == 443 ? '' : ':'.$https_port).'/Microsoft-Server-ActiveSync',
),
'caldav' => array(
- 'url' => 'https://'.$mailcow_hostname
+ 'server' => $mailcow_hostname,
+ 'port' => $https_port,
),
'carddav' => array(
- 'url' => 'https://'.$mailcow_hostname
- )
+ 'server' => $mailcow_hostname,
+ 'port' => $https_port,
+ ),
);
+unset($https_port);
// Where to go after adding and editing objects
// Can be "form" or "previous"
diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php
index eef13b3f..8706e4ba 100644
--- a/data/web/lang/lang.de.php
+++ b/data/web/lang/lang.de.php
@@ -108,6 +108,7 @@ $lang['user']['user_settings'] = 'Benutzereinstellungen';
$lang['user']['mailbox_settings'] = 'Mailbox-Einstellungen';
$lang['user']['mailbox_details'] = 'Mailbox-Details';
$lang['user']['change_password'] = 'Passwort ändern';
+$lang['user']['client_configuration'] = 'Konfigurationsanleitungen für E-Mail-Programme und Smartphones anzeigen';
$lang['user']['new_password'] = 'Neues Passwort';
$lang['user']['save_changes'] = 'Änderungen speichern';
$lang['user']['password_now'] = 'Aktuelles Passwort (Änderungen bestätigen)';
diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php
index 3be72fec..fceef80f 100644
--- a/data/web/lang/lang.en.php
+++ b/data/web/lang/lang.en.php
@@ -110,6 +110,7 @@ $lang['user']['user_settings'] = 'User settings';
$lang['user']['mailbox_settings'] = 'Mailbox settings';
$lang['user']['mailbox_details'] = 'Mailbox details';
$lang['user']['change_password'] = 'Change password';
+$lang['user']['client_configuration'] = 'Show configuration guides for email clients and smartphones';
$lang['user']['new_password'] = 'New password';
$lang['user']['save_changes'] = 'Save changes';
$lang['user']['password_now'] = 'Current password (confirm changes)';
diff --git a/data/web/mobileconfig.php b/data/web/mobileconfig.php
new file mode 100644
index 00000000..198fa4d7
--- /dev/null
+++ b/data/web/mobileconfig.php
@@ -0,0 +1,167 @@
+prepare("SELECT `name` FROM `mailbox` WHERE `username`= :username");
+ $stmt->execute(array(':username' => $email));
+ $MailboxData = $stmt->fetch(PDO::FETCH_ASSOC);
+}
+catch(PDOException $e) {
+ die("Failed to determine name from SQL");
+}
+if (!empty($MailboxData['name'])) {
+ $displayname = utf8_encode($MailboxData['name']);
+}
+else {
+ $displayname = $email;
+}
+
+echo '' . "\n";
+?>
+
+