diff --git a/conf/ios-profile.xml b/conf/ios-profile.xml new file mode 100644 index 0000000..4fcec81 --- /dev/null +++ b/conf/ios-profile.xml @@ -0,0 +1,128 @@ + + + + + + PayloadContent + + + CalDAVAccountDescription + PRIMARY_HOSTNAME calendar + CalDAVHostName + PRIMARY_HOSTNAME + CalDAVPort + 443 + CalDAVPrincipalURL + /cloud/remote.php/caldav/calendars/ + CalDAVUseSSL + + PayloadDescription + PRIMARY_HOSTNAME (Mail-in-a-Box) + PayloadDisplayName + PRIMARY_HOSTNAME calendar + PayloadIdentifier + email.mailinabox.mobileconfig.PRIMARY_HOSTNAME.CalDAV + PayloadOrganization + + PayloadType + com.apple.caldav.account + PayloadUUID + UUID1 + PayloadVersion + 1 + + + EmailAccountDescription + PRIMARY_HOSTNAME mail + EmailAccountType + EmailTypeIMAP + IncomingMailServerAuthentication + EmailAuthPassword + IncomingMailServerHostName + PRIMARY_HOSTNAME + IncomingMailServerPortNumber + 993 + IncomingMailServerUseSSL + + OutgoingMailServerAuthentication + EmailAuthPassword + OutgoingMailServerHostName + PRIMARY_HOSTNAME + OutgoingMailServerPortNumber + 587 + OutgoingMailServerUseSSL + + OutgoingPasswordSameAsIncomingPassword + + PayloadDescription + PRIMARY_HOSTNAME (Mail-in-a-Box) + PayloadDisplayName + PRIMARY_HOSTNAME mail + PayloadIdentifier + email.mailinabox.mobileconfig.PRIMARY_HOSTNAME.E-Mail + PayloadOrganization + + PayloadType + com.apple.mail.managed + PayloadUUID + UUID2 + PayloadVersion + 1 + PreventAppSheet + + PreventMove + + SMIMEEnabled + + + + CardDAVAccountDescription + PRIMARY_HOSTNAME contacts + CardDAVHostName + PRIMARY_HOSTNAME + CardDAVPort + 443 + CardDAVPrincipalURL + /cloud/remote.php/carddav/addressbooks/ + CardDAVUseSSL + + PayloadDescription + PRIMARY_HOSTNAME (Mail-in-a-Box) + PayloadDisplayName + PRIMARY_HOSTNAME contacts + PayloadIdentifier + email.mailinabox.mobileconfig.PRIMARY_HOSTNAME.carddav + PayloadOrganization + + PayloadType + com.apple.carddav.account + PayloadUUID + UUID3 + PayloadVersion + 1 + + + PayloadDescription + PRIMARY_HOSTNAME (Mail-in-a-Box) + PayloadDisplayName + PRIMARY_HOSTNAME + PayloadIdentifier + email.mailinabox.mobileconfig.PRIMARY_HOSTNAME + PayloadOrganization + + PayloadRemovalDisallowed + + PayloadType + Configuration + PayloadUUID + UUID4 + PayloadVersion + 1 + + diff --git a/conf/nginx.conf b/conf/nginx.conf index b8751bd..241bceb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -34,6 +34,10 @@ server { access_log off; } + location = /mailinabox.mobileconfig { + alias /var/lib/mailinabox/mobileconfig.xml; + } + # Roundcube Webmail configuration. rewrite ^/mail$ /mail/ redirect; rewrite ^/mail/$ /mail/index.php; @@ -80,4 +84,3 @@ server { # ADDITIONAL DIRECTIVES HERE } - diff --git a/management/templates/mail-guide.html b/management/templates/mail-guide.html index 3d0cec9..05b123c 100644 --- a/management/templates/mail-guide.html +++ b/management/templates/mail-guide.html @@ -59,6 +59,23 @@

Your device should also provide a contacts list and calendar that syncs to this box when you use this method.

+ +
+

iOS Mobileconfig

+ +

Open the following configuration on your iOS device.

+ +

https://{{hostname}}/mailinabox.mobileconfig

+ +

Use these settings when prompted:

+ + + + +
Username: Your whole email address.
Password: Your mail password.
+ +

Your device should also provide a contacts list and calendar that syncs to this box when you use this method.

+
diff --git a/setup/start.sh b/setup/start.sh index d84669b..22759c6 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -160,4 +160,3 @@ openssl x509 -in $STORAGE_ROOT/ssl/ssl_certificate.pem -noout -fingerprint \ echo echo Then you can confirm the security exception and continue. echo - diff --git a/setup/web.sh b/setup/web.sh index d8d4644..fd0b557 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -40,6 +40,19 @@ tools/editconf.py /etc/php5/fpm/pool.d/www.conf -c ';' \ # since it depends on what domains we're serving, which we don't know # until mail accounts have been created. +# Create the iOS Mobile Configuration file which is exposed via the +# nginx configuration at /mailinabox-mobileconfig. +mkdir -p /var/lib/mailinabox +chmod a+rx /var/lib/mailinabox +cat conf/ios-profile.xml \ + | sed "s/PRIMARY_HOSTNAME/$PRIMARY_HOSTNAME/" \ + | sed "s/UUID1/$(cat /proc/sys/kernel/random/uuid)/" \ + | sed "s/UUID2/$(cat /proc/sys/kernel/random/uuid)/" \ + | sed "s/UUID3/$(cat /proc/sys/kernel/random/uuid)/" \ + | sed "s/UUID4/$(cat /proc/sys/kernel/random/uuid)/" \ + > /var/lib/mailinabox/mobileconfig.xml +chmod a+r /var/lib/mailinabox/mobileconfig.xml + # make a default homepage if [ -d $STORAGE_ROOT/www/static ]; then mv $STORAGE_ROOT/www/static $STORAGE_ROOT/www/default; fi # migration #NODOC mkdir -p $STORAGE_ROOT/www/default