Dennis Rahmen
New Pleskian
Hello everyone,
I got active-sync working with the SOGo extension.
Currently not using it in production but the first tests with calendar, contacts, notes and mail are looking good.
What I did:
@AYamshanov anything holding this back being implemented by plesk directly?
Client setup
Work in progress
I got active-sync working with the SOGo extension.
Currently not using it in production but the first tests with calendar, contacts, notes and mail are looking good.
What I did:
- Install SOGo extension
- Install active-sync package
Bash:sudo apt install sogo-activesync
- Update the SOGo config to enable active-sync in SOGo
- Copy the template plesk uses, for the sogo.conf file, to the custom template location
Bash:cp -a /usr/local/psa/var/modules/sogo/templates/sogo.template.twig /usr/local/psa/var/modules/sogo/custom_templates/
- Edit the template file in the custom_templates directory
Bash:nano /usr/local/psa/var/modules/sogo/custom_templates/sogo.template.twig
- Add the following lines somewhere inside the brackets and save
Bash:SOGoEnableEAS = YES; SOGoEASDisableUI = NO;
- Copy the template plesk uses, for the sogo.conf file, to the custom template location
- Update the nginx config file to proxy active-sync request to SOGo
- Copy the template plesk uses, for the nginx config, to the custom template location
Bash:cp -a /usr/local/psa/var/modules/sogo/templates/nginx.template.twig /usr/local/psa/var/modules/sogo/custom_templates/
- Edit the template file in the custom_templates directory
Bash:nano /usr/local/psa/var/modules/sogo/custom_templates/nginx.template.twig
- Add the following lines inside the brackets and save
NGINX:location /Microsoft-Server-ActiveSync { access_log /var/log/nginx/activesync.log; # deny anonymous; deny other http methods if ( $remote_user = "" ) { return 444; break; } if ( $request_method !~* ^(POST|OPTIONS)$ ) { return 444; break; } # extract domain and user-id if ( $remote_user ~* ^(.+)\x5C(.+)$ ) { set $domain $1; set $userid $2; } if ( $remote_user !~* ^(.+)\x5C(.+)$ ) { return 444; break; } # replace underscores in username if ( $userid ~* ^(.+)_(.+)$ ) { set $userdn $1x$2; } if ( $userid !~* ^(.+)_(.+)$ ) { set $userdn $userid; } # extract device-type and version if ( $http_user_agent ~* ^MSFT-(.+)/(.+)\.(.+)\.(.+)$ ) { set $device MSFT$1; set $versio $2x$3x$4; } if ( $http_user_agent ~* ^Apple-iPhone(.*)/(.+)\.(.+)$ ) { set $device iPhone; set $versio $1x$2x$3; } if ( $http_user_agent ~* ^Apple-iPad(.+)/(.+)\.(.+)$ ) { set $device iPad; set $versio $1x$2x$3; } if ( $http_user_agent ~* ^Apple-iPod(.+)/(.+)\.(.+)$ ) { set $device iPod; set $versio $1x$2x$3; } if ( $http_user_agent ~* ^Android-(.+)/(.+)\.(.+)$ ) { set $device Android; set $versio $1x$2x$3; } # always allow initial requests without arguments set $initia $request_method:$args; if ( $initia ~* ^OPTIONS:$ ) { set $target $domain-exchange; set $versio ok; } if ( $versio = "" ) { return 444; break; } # set target, if usernames match if ( $userid = $arg_User ) { set $target $domain-$userdn-$arg_DeviceId-$device-$versio; } # forward request proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync; }
- Copy the template plesk uses, for the nginx config, to the custom template location
- Now you need to reconfigure plesk web-server as well as SOGo
Bash:plesk sbin httpdmng --reconfigure-all plesk ext sogo configure
@AYamshanov anything holding this back being implemented by plesk directly?
Client setup
- Apple Mail on iPhone (Tested)
- Select "Microsoft Exchange"
- Enter email
- Select Manual setup
- For server and domain enter your webmail domain
- Enter password
Work in progress
- Since the templates are only for the extension and therefore only apply to the webmail the active-sync is configured on the webmail subdomain not on the main domain, as you can see in the client setup
- If thats a problem you can manually add the nginx directive from step 4.3. to you domain.
Just go to your domain in plesk select "Hosting & DNS", and click on "Apache & nginx". There all the way at the bottom add the additional nginx directive.
- If thats a problem you can manually add the nginx directive from step 4.3. to you domain.
- I did some testing with emails but noticed there are some default folders missing, investigating that currently
- I found the package for active-sync in a documentation of iredmail: Exchange ActiveSync: Setup Outlook 2013 for Windows
- How the templates of the config files work you can read in this file
Bash:cat /usr/local/psa/var/modules/sogo/templates/README.md
- I would appreciate if anyone has more insight of the config variables, I just got the mentioned two from plesk support
- For the nginx config I found documentation by iredmail with a short version here: Install SOGo groupware on CentOS 6 with iRedMail (MySQL backend)
- In the end I decided to go with a config from nginx documentation here: SSL-Offloader | NGINX