Here's a simple (untested) CGI-script for publishing a configuration
profile to an iOS device. Put the attached CGI-script in
$WEBROOT/ios/SOGo.mobileconfig and add this to the apache config:

        <Location /ios>
                Options +ExecCGI
                AddHandler cgi-script .mobileconfig
        </location>

then open http://website/ios/SOGo.mobileconfig?email@address in the
browser, and hopefully a configuration profile should appear.

A few hostnames needs to be customized, but hopefully this should work :-)


HTH


  -jf
-- 
users@sogo.nu
https://inverse.ca/sogo/lists
#! /bin/bash -
#
# Simple CGI-script for creating configuration profile for SOGo
# services on iOS.
#
# Jan-Frode Myklebust <janfr...@tanso.net>

## Wash input
EMPTY=$(echo -n "${1}" | tr -d '[:alnum:]' | tr -d '[:punct:]')
if test -n "$EMPTY"
then
        echo Content-Type: text/plain
        echo
        echo Bad characters in input. Aborting.
        echo $1
        echo $EMPTY
        exit 1
fi

EMAIL=$1
DOMAIN=${EMAIL##*@}
REVERSE=$(echo $EMAIL | sed -e 's/@/\./g' | awk -F. '{ for (i=NF; i > 0; i--) 
printf "." $i }'|sed 's/^.//' )

# No idea if these needs to be different:
UUIDprofile=$(uuidgen)
UUIDcarddav=$(uuidgen)
UUIDcaldav=$(uuidgen)
UUIDmail=$(uuidgen)

# Create signed profile:
#cat << EOF | openssl smime -sign -signer server.crt -inkey server.key 
-certfile cert-chain.crt -outform der -nodetach

# Create unsigned profile:
cat << EOF 
Content-Type: application/x-apple-aspen-config; charset=utf-8
Content-Disposition: attachment; filename="SOGo.mobileconfig

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>PayloadContent</key>
        <array>
                <dict>
                        <key>CalDAVAccountDescription</key>
                        <string>Altibox Calendar</string>
                        <key>CalDAVHostName</key>
                        <string>mail.altibox.no</string>
                        <key>CalDAVPort</key>
                        <real>443</real>
                        <key>CalDAVPrincipalURL</key>
                        <string>/SOGo/dav/${EMAIL}/</string>
                        <key>CalDAVUseSSL</key>
                        <true/>
                        <key>CalDAVUsername</key>
                        <string>${EMAIL}</string>
                        <key>PayloadDescription</key>
                        <string>${EMAIL} calendar</string>
                        <key>PayloadDisplayName</key>
                        <string>${EMAIL} calendar</string>
                        <key>PayloadIdentifier</key>
                        
<string>net.altibox.sogo.profile.caldav.${REVERSE}</string>
                        <key>PayloadOrganization</key>
                        <string>${DOMAIN}</string>
                        <key>PayloadType</key>
                        <string>com.apple.caldav.account</string>
                        <key>PayloadUUID</key>
                        <string>${UUIDcaldav}</string>
                        <key>PayloadVersion</key>
                        <integer>1</integer>
                </dict>
                <dict>
                        <key>CardDAVAccountDescription</key>
                        <string>Altibox Contacts</string>
                        <key>CardDAVHostName</key>
                        <string>mail.altibox.no</string>
                        <key>CardDAVPort</key>
                        <integer>443</integer>
                        <key>CardDAVPrincipalURL</key>
                        
<string>https://mail.altibox.no/SOGo/dav/${EMAIL}/</string>
                        <key>CardDAVUseSSL</key>
                        <true/>
                        <key>CardDAVUsername</key>
                        <string>${EMAIL}</string>
                        <key>PayloadDescription</key>
                        <string>${EMAIL} contacts</string>
                        <key>PayloadDisplayName</key>
                        <string>${EMAIL} contacts</string>
                        <key>PayloadIdentifier</key>
                        
<string>net.altibox.sogo.profile.carddav.${REVERSE}</string>
                        <key>PayloadOrganization</key>
                        <string>${DOMAIN}</string>
                        <key>PayloadType</key>
                        <string>com.apple.carddav.account</string>
                        <key>PayloadUUID</key>
                        <string>${UUIDcarddav}</string>
                        <key>PayloadVersion</key>
                        <integer>1</integer>
                </dict>
                <dict>
                        <key>EmailAccountDescription</key>
                        <string>Altibox Mail</string>
                        <key>EmailAccountType</key>
                        <string>EmailTypeIMAP</string>
                        <key>EmailAddress</key>
                        <string>${EMAIL}</string>
                        <key>IncomingMailServerAuthentication</key>
                        <string>EmailAuthPassword</string>
                        <key>IncomingMailServerHostName</key>
                        <string>pop.altibox.no</string>
                        <key>IncomingMailServerPortNumber</key>
                        <integer>993</integer>
                        <key>IncomingMailServerUseSSL</key>
                        <true/>
                        <key>IncomingMailServerUsername</key>
                        <string>${EMAIL}</string>
                        <key>OutgoingMailServerAuthentication</key>
                        <string>EmailAuthPassword</string>
                        <key>OutgoingMailServerHostName</key>
                        <string>smtp.altibox.no</string>
                        <key>OutgoingMailServerPortNumber</key>
                        <integer>587</integer>
                        <key>OutgoingMailServerUseSSL</key>
                        <true/>
                        <key>OutgoingMailServerUsername</key>
                        <string>${EMAIL}</string>
                        <key>OutgoingPasswordSameAsIncomingPassword</key>
                        <true/>
                        <key>PayloadDescription</key>
                        <string>${EMAIL} mail</string>
                        <key>PayloadDisplayName</key>
                        <string>Altibox mail</string>
                        <key>PayloadIdentifier</key>
                        
<string>net.altibox.sogo.profile.mail.${REVERSE}</string>
                        <key>PayloadOrganization</key>
                        <string>Altibox.net</string>
                        <key>PayloadType</key>
                        <string>com.apple.mail.managed</string>
                        <key>PayloadUUID</key>
                        <string>${UUIDmail}</string>
                        <key>PayloadVersion</key>
                        <integer>1</integer>
                        <key>PreventAppSheet</key>
                        <false/>
                        <key>PreventMove</key>
                        <false/>
                        <key>SMIMEEnabled</key>
                        <false/>
                </dict>
        </array>
        <key>PayloadDescription</key>
        <string>Altibox Mail configuration by http://www.altibox.no/</string>
        <key>PayloadDisplayName</key>
        <string>Altibox Mail configuration</string>
        <key>PayloadIdentifier</key>
        <string>net.altibox.sogo.profile.${REVERSE}</string>
        <key>PayloadOrganization</key>
        <string>altibox.net</string>
        <key>PayloadRemovalDisallowed</key>
        <false/>
        <key>PayloadType</key>
        <string>Configuration</string>
        <key>PayloadUUID</key>
        <string>${UUIDprofile}</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
</dict>
</plist>
EOF

Reply via email to