Add darwin to if block

Otherwise it would fall into the 'win' else block because strpos($os, 'win') does also match 'darwin' what is the `php_uname` for OS X.
Refactor MailSettings controller

- Do not store the password (fixes https://github.com/owncloud/core/issues/11385)
- Refactor to AppFramework
- Add unit tests

Conflicts:
	settings/admin/controller.php
fixing typos
Merge pull request #11565 from owncloud/fix-behaviourOnOSX

Add darwin to if block
Merge pull request #11570 from owncloud/backport-11408-master

Backport 11408 master
Refactor file sharing public link handling

fixes download issue introduced by #10755

Conflicts:
	apps/files_sharing/public.php
Rename SharingCheckMiddleware.php to sharingcheckmiddleware.php

Make autoloader happy for now…
Fix unit tests
Added download size on public sharing