iredmail-doc/integrations/sogo-centos-6-mysql.md

218 lines
6.0 KiB
Markdown
Raw Normal View History

2014-10-07 04:07:05 -05:00
# SOGo: install SOGo on CentOS 6 with iRedMail (MySQL backend)
2014-09-20 18:19:12 -05:00
[TOC]
## Requirements
2014-09-20 05:42:28 -05:00
* A working iRedMail server (MySQL backend) on CentOS 6.
## Install SOGo
* Make sure you have EPEL repo enabled, if not, please follow [this wiki
tutorial](https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F)
to enable it.
```
# yum repolist | grep -i 'epel'
epel Extra Packages for Enterprise Linux 6 - x86_64 11,109
```
* Add yum repo file `/etc/yum.repos.d/sogo.repo`:
```
[SOGo]
name=Inverse SOGo Repository
baseurl=http://inverse.ca/downloads/SOGo/RHEL6/$basearch
gpgcheck=0
```
* Install SOGo and dependences:
```
2014-09-20 05:42:28 -05:00
# yum install sogo sope49-gdl1-mysql sogo-activesync libwbxml
```
## Create SQL database to store SOGo data
```
$ mysql -u root -p
mysql> CREATE DATABASE sogo CHARSET='UTF8';
mysql> GRANT ALL ON sogo.* TO sogo@localhost IDENTIFIED BY 'password';
mysql> GRANT SELECT ON vmail.mailbox TO sogo@localhost;
2014-10-30 07:22:36 -06:00
mysql> CREATE VIEW sogo.users (c_uid, c_name, c_password, c_cn, mail, home) AS SELECT username, username, password, name, username, maildir FROM vmail.mailbox;
```
## Configure SOGo
Default SOGo config file is `/etc/sogo/sogo.conf`:
```
2014-10-12 05:03:59 -05:00
{
2014-09-20 18:19:12 -05:00
WOPort = 127.0.0.1:20000;
2014-10-30 07:22:36 -06:00
SOGoProfileURL = "mysql://sogo:password@localhost:3306/sogo/user_profiles";
OCSFolderInfoURL = "mysql://sogo:password@localhost:3306/sogo/folders";
OCSSessionsFolderURL = "mysql://sogo:password@localhost:3306/sogo/sessions";
2014-10-12 05:03:59 -05:00
// Enable email-based alarms on events and tasks.
SOGoEnableEMailAlarms = YES;
2014-10-30 07:22:36 -06:00
OCSEMailAlarmsFolderURL = "mysql://sogo:password@localhost:3306/sogo/alarms";
2014-10-12 05:03:59 -05:00
// Use TLS
2014-10-30 07:22:36 -06:00
//SOGoIMAPServer = "imaps://127.0.0.1:143/?tls=YES";
// Local connection is considered as secure by Dovecot.
SOGoIMAPServer = "imap://127.0.0.1:143/";
SOGoMailingMechanism = smtp;
SOGoSMTPServer = 127.0.0.1;
// Enable managesieve service
2014-10-30 07:22:36 -06:00
//
// WARNING: Sieve scripts generated by SOGo is not compatible with Roundcube
// webmail, don't use sieve service in both webmails, otherwise
// it will be messy.
//
//SOGoSieveServer = sieve://PH_MANAGESIEVE_BIND_HOST:PH_MANAGESIEVE_PORT;
//SOGoSieveScriptsEnabled = YES;
//SOGoVacationEnabled = YES;
//SOGoForwardEnabled = YES;
2014-09-20 18:19:12 -05:00
SOGoMemcachedHost = 127.0.0.1;
SOGoTimeZone = "Europe/Berlin";
2014-09-20 17:42:51 -05:00
SOGoFirstDayOfWeek = 1;
SOGoMailMessageCheck = every_5_minutes;
SOGoForceExternalLoginWithEmail = YES;
SOGoAppointmentSendEMailNotifications = YES;
2014-09-20 18:19:12 -05:00
SOGoFoldersSendEMailNotifications = YES;
SOGoACLsSendEMailNotifications = YES;
SOGoPasswordChangeEnabled = YES;
2014-10-30 07:22:36 -06:00
// User authentication
2014-09-20 05:42:28 -05:00
SOGoUserSources =
(
2014-09-20 05:42:28 -05:00
{
type = sql;
id = directory;
2014-10-30 07:22:36 -06:00
viewURL = "mysql://sogo:password@127.0.0.1:3306/sogo/users";
2014-09-20 05:42:28 -05:00
canAuthenticate = YES;
userPasswordAlgorithm = md5;
prependPasswordScheme = YES;
2014-10-30 07:22:36 -06:00
// SOGo can use SQL database as address book, but it's able to
// query ALL mail accounts. Enable it on your own.
isAddressBook = NO;
2014-09-20 05:42:28 -05:00
}
);
2014-10-12 05:03:59 -05:00
}
```
2014-10-30 07:22:36 -06:00
__NOTE__: SOGo will create required SQL tables automatically (`user_profiles`,
`folder`, `sessions`, ...), we don't need to create them manually.
2014-10-12 05:03:59 -05:00
## Enable ActiveSync support
### Apache web server
SOGo installs config file `/etc/httpd/conf.d/SOGo.conf` by default, please
open it and find below lines:
```
#ProxyPass /Microsoft-Server-ActiveSync \
# http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
# retry=60 connectiontimeout=5 timeout=360
```
Remove `#` at the beginning to enable ActiveSync support:
```
ProxyPass /Microsoft-Server-ActiveSync \
http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
retry=60 connectiontimeout=5 timeout=360
```
### Nginx web server
If you're running Nginx web server, please open file
`/etc/nginx/conf.d/default.conf`, add some lines in `server {}` block which
is configured for HTTPS:
```
server {
listen 443;
...
# Add below lines for SOGo
# SOGo
location ^~ /SOGo {
proxy_pass http://127.0.0.1:20000;
#proxy_redirect http://127.0.0.1:20000/SOGo/ /SOGo;
# forward user's IP address
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header Host $host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
#proxy_set_header x-webobjects-remote-host 127.0.0.1;
#proxy_set_header x-webobjects-server-name $server_name;
#proxy_set_header x-webobjects-server-url $scheme://$host;
}
location ^~ /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
proxy_redirect http://127.0.0.1:20000/Microsoft-Server-ActiveSync /;
}
location ^~ /SOGo/Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;
proxy_redirect http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync /;
}
location /SOGo.woa/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
}
location /SOGo/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
}
location ^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$ {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
}
}
```
__Important note__: You should replace directory `/usr/lib/GNUstep/SOGo` the
the real directory which contains SOGo files:
* on RHEL/CentOS: it's `/usr/lib/GNUstep/SOGo` on x86 platform,
`/usr/lib64/GNUstep/SOGo` on x86_64 platform.
* on Debian/Ubuntu, it's `/usr/lib/GNUstep/SOGo`.
* on OpenBSD, it's `/
2014-09-20 05:42:28 -05:00
## Start SOGo and dependent services
```
service sogod start
service httpd restart
service memcached start
```
2014-10-12 05:03:59 -05:00
## Access SOGo
Open your favourite web browser, access URL: `https://[your_server]/SOGo`.
## How to configure client applications
2014-09-20 05:42:28 -05:00
### Apple Devices
2014-09-20 05:42:28 -05:00
URL for calendar service: `http://[host]/SOGo/dav/[user]/`
## TODO
2014-09-20 18:19:12 -05:00
## References