Now that sogo is part of Debian, this should be updated. http://packages.qa.debian.org/s/sogo.html

I would like to write here something about the installation of SOGo on Debian Squeeze. I do it here with MySQL (or PostgreSQL), both for authentication and data. The idea comes from an article in Linux Journal: http://www.linuxjournal.com/article/10894

Please copy the text (from "# become root") into an editor, and replace the password "secret" with another password. Further, replace the hostname "sogo.example.com" with your own hostname, or with e.g. "localhost" and the maildomain "example.com" with your maildomain.

Read it, and make some other changes, you will want other test-users with other passwords then I have. You will want e.g. another timezone, language and maildomain. After that, you can copy/paste it in lines or parts to your terminal.

When you use PostgreSQL you can use the text for postgresql too, I expect. Do a replace from "mysql" to "postgresql" and I think you only need to change the text between "start mysql" and "end mysql" a bit. I have only tested with MySQL, please tell me about your postgresql experiences.

I am using Sogo with Icedove 3.1.16 from http://backports.debian.org now, with Sogo connector and Mozilla Lightning Sogo edition from the Sogo site: http://www.sogo.nu/downloads/frontends.html , I don't use the integrator. I've also users who use Icedove 3.0.11 and iceowl-extension from Debian stable. this is usueble too. You can also use the Sogo connector with Icedove 3.0.11, but I have not so much experience with that.

A point is that the password for the mail must be the same as the password for SOGo.

A last advice: when you have strange problems with the webinterface, clear the cache of your browser. And sometimes things work after some time waiting.

I have no experience with Funambol at the moment. But I saw a site with interesting information: http://andries.filmer.nl/kb/Funambol/13

# become root
su

# this manual assumes you allready have apache2 running
# if not please install it first.

# change sources.list
echo '# sogo:' >> /etc/apt/sources.list
echo 'deb http://inverse.ca/debian squeeze squeeze' >> /etc/apt/sources.list
apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4
apt-get update

# install programs
apt-get install sogo sope4.9-gdl1-mysql memcached rpl
# you will get an error about the key of the repostitory, there is no key.
# in some cases mysql is stopped, therefore I restart mysql:
/etc/init.d/mysql restart
# you will get an security message from tmpreaper, no problem.
# you will get an error when sogo starts, no problem.


# to read more about the security-issues of tmpreader
zless /usr/share/doc/tmpreaper/README.security.gz
# to remove the warning of tmpreaper
rpl 'SHOWWARNING=true' 'SHOWWARNING=false' /etc/tmpreaper.conf

# memcached
# this is because of IPv6 errors
rpl '127.0.0.1' localhost /etc/memcached.conf
/etc/init.d/memcached restart

# create a database and add some test-users
mysql  # start mysql client, maybe you will need the -p option

------start mysql------
CREATE DATABASE sogo CHARSET='UTF8';
CREATE USER 'sogo'@'localhost' IDENTIFIED BY 'secret';
GRANT ALL PRIVILEGES ON sogo.* TO 'sogo'@'localhost';
USE sogo;
CREATE TABLE sogo_users (c_uid VARCHAR(10) PRIMARY KEY, c_name VARCHAR(10), c_password VARCHAR(32), c_cn VARCHAR(128), mail VARCHAR(128));
INSERT INTO sogo_users VALUES ('paul', 'paul', MD5('zxc'), 'Paul Example', 'paul@example.com');
INSERT INTO sogo_users VALUES ('piet', 'piet', MD5('zxc'), 'Piet Jansen', 'piet@example.com');
INSERT INTO sogo_users VALUES ('klaas', 'klaas', MD5('zxc'), 'Klaas van der Zee', 'klaas@example.com');
flush privileges;
exit
----end mysql--------

# add some apache modules
a2enmod proxy
a2enmod proxy_http
a2enmod headers
a2enmod rewrite
# restart apache
/etc/init.d/apache2 restart

# sogo configuration, as user "sogo"
su sogo
defaults write sogod SOGoTimeZone "Europe/Amsterdam"
defaults write sogod SOGoMailDomain "example.com"
defaults write sogod SOGoLanguage "Dutch"
# say "isAddressBook = NO" for a shared hosting situation
# this is a very long line:
defaults write sogod SOGoUserSources '({canAuthenticate = YES; displayName = "SOGo Users"; id = users; isAddressBook = YES; type = sql; userPasswordAlgorithm = md5; viewURL ="mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_users";})'
defaults write sogod SOGoProfileURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_user_profile'
defaults write sogod OCSFolderInfoURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_folder_info'
defaults write sogod OCSSessionsFolderURL 'mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_sessions_folder'
defaults write sogod SOGoAppointmentSendEMailNotifications YES
defaults write sogod SOGoLoginModule Calendar
defaults write sogod SOGoSieveScriptsEnabled YES
# sometimes Sieve is running on port 2000, port 4190 is relative new:
defaults write sogod SOGoSieveServer sieve://localhost:4190
defaults write sogod SOGoVacationEnabled YES
defaults write sogod SOGoMailMessageCheck every_5_minutes
defaults write sogod SOGoFirstDayOfWeek 1
defaults write sogod SOGoSuperUsernames '( "admin" )'
# I am using Cyrus IMAP 2.2 in the default settings, I needed this 4 lines 
# for mailbox setting. I don't think you need them with other IMAP servers:
defaults write sogod SOGoDraftsFolderName "INBOX.Drafts"
defaults write sogod SOGoSentFolderName "INBOX.Sent"
defaults write sogod SOGoTrashFolderName "INBOX.Trash"
defaults write sogod NGImap4ConnectionStringSeparator "."
exit
/etc/init.d/sogo restart

# the default apache configuration adds an /SOGo/ to every site you run.
# if you don't like that, like me, you can use my apache-config.

# backup and remove default apache sogo configuration
mv /etc/apache2/conf.d/SOGo.conf /root/SOGo.conf-backup
echo "# disabled" >> /etc/apache2/conf.d/SOGo.conf
# copy the virtualhost apache configuration and restart apache
pico /etc/apache2/sites-available/sogo.example.com

---begin apache config-------
<VirtualHost *:80>
   Servername sogo.example.com
   DocumentRoot /usr/lib/GNUstep/SOGo/WebServerResources/
   ErrorLog /var/log/apache2/error.log
   Customlog /var/log/apache2/access.log combined
   ServerSignature Off

   Alias /SOGo.woa/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
   Alias /SOGo/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
   AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2

   <Directory /usr/lib/GNUstep/SOGo/>
      AllowOverride None
      Order deny,allow
      Allow from all
   </Directory>

   <LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*\.(jpg|png|gif|css|js)">
     SetHandler default-handler
   </LocationMatch>

   ProxyRequests Off
   SetEnv proxy-nokeepalive 1
   ProxyPreserveHost On
   ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0

   <Proxy http://127.0.0.1:20000/SOGo>
     RequestHeader set "x-webobjects-server-port" "80"
     RequestHeader set "x-webobjects-server-name" "sogo.example.com"
     RequestHeader set "x-webobjects-server-url" "http://sogo.example.com"
     RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
     RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST
     AddDefaultCharset UTF-8
     Order allow,deny
     Allow from all
   </Proxy>
   ## We use mod_rewrite to pass remote address to the SOGo proxy.
   # The remote address will appear in SOGo's log files and in the X-Forward
   # header of emails.
   RewriteEngine On
   RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]

   Redirect permanent /index.html http://sogo.example.com/SOGo

</virtualhost>

<VirtualHost *:8800>
  # this virtualhost is only for carddav on Mac and not tested very well
  RewriteEngine Off
  ProxyRequests Off
  SetEnv proxy-nokeepalive 1
  ProxyPreserveHost On
  ProxyPassInterpolateEnv On
  ProxyPass /principals http://127.0.0.1:20000/SOGo/dav/ interpolate
  ProxyPass /SOGo http://127.0.0.1:20000/SOGo interpolate
  ProxyPass / http://127.0.0.1:20000/SOGo/dav/ interpolate
  <Location />
    Order allow,deny
    Allow from all
  </Location>
  <Proxy http://127.0.0.1:20000>
    RequestHeader set "x-webobjects-server-port" "8800"
    RequestHeader set "x-webobjects-server-name" "sogo.example.com:8800"
    RequestHeader set "x-webobjects-server-url" "https://sogo.example.com:8800"
    RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
    RequestHeader set "x-webobjects-remote-host" "127.0.0.1"
    AddDefaultCharset UTF-8
  </Proxy>
  ErrorLog /var/log/apache2/error.log
  Customlog /var/log/apache2/access.log combined
</VirtualHost>

----end apache config---------

a2ensite sogo.example.com
/etc/init.d/apache2 reload

# Now you can access SOGo on http://sogo.example.com/SOGo

# Url's for Thunderbird:
# adressbook: http://sogo.example.com/SOGo/dav/paul/Contacts/personal/ 
# calendar:   http://sogo.example.com/SOGo/dav/paul/Calendar/personal/ 

# If everything works well, you can make it https, with something like this:
pico /etc/apache2/sites-available/sogo.example.com

------begin apache config ssl---------
<VirtualHost *:80>
   Servername sogo.example.com
   RedirectMatch permanent ^/ https://sogo.example.com/SOGo
   RedirectMatch permanent ^/SOGo https://sogo.example.com/SOGo
</VirtualHost>

<VirtualHost *:443>
   Servername sogo.example.com
   SSLEngine On
   SSLCertificateFile /etc/apache2/ssl/sogo.example.com.pem
   SSLCertificateChainFile /etc/apache2/ssl/sogo.example.com.pem
   DocumentRoot /usr/lib/GNUstep/SOGo/WebServerResources/
   ErrorLog /var/log/apache2/error.log
   Customlog /var/log/apache2/access.log combined
   ServerSignature Off
   <IfModule mpm_itk_module>
       AssignUserId sogo-a sogo-a
  </IfModule>

   Alias /SOGo.woa/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
   Alias /SOGo/WebServerResources/ /usr/lib/GNUstep/SOGo/WebServerResources/
   AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2

   <Directory /usr/lib/GNUstep/SOGo/>
      AllowOverride None
      Order deny,allow
      Allow from all
   </Directory>

   <LocationMatch "^/SOGo/so/ControlPanel/Products/.*UI/Resources/.*\.(jpg|png|gif|css|js)">
     SetHandler default-handler
   </LocationMatch>

   ProxyRequests Off
   SetEnv proxy-nokeepalive 1
   ProxyPreserveHost On
   ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0

   <Proxy http://127.0.0.1:20000/SOGo>
     RequestHeader set "x-webobjects-server-port" "443"
     RequestHeader set "x-webobjects-server-name" "sogo.example.com"
     RequestHeader set "x-webobjects-server-url" "https://sogo.example.com"
     RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
     RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST
     AddDefaultCharset UTF-8
     Order allow,deny
     Allow from all
   </Proxy>
   ## We use mod_rewrite to pass remote address to the SOGo proxy.
   # The remote address will appear in SOGo's log files and in the X-Forward
   # header of emails.
   RewriteEngine On
   RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]
   
   Redirect permanent /index.html https://sogo.example.com/SOGo
   
</virtualhost>
------end apache config ssl-----------------

# next line only needed for carddav on Mac:
echo "Listen 8800" >> /etc/apache2/ports.conf

a2ensite sogo.example.com
/etc/init.d/apache2 reload

# if you want to use carddav on a Mac, you need to open port 8800 tcp in your firewal

# Now you can access the webinterface on https://sogo.example.com/SOGo

# Url's for Thunderbird:
# adressbook: https://sogo.example.com/SOGo/dav/paul/Contacts/personal/ 
# calendar:   https://sogo.example.com/SOGo/dav/paul/Calendar/personal/

# A script for mysql to add a user, use the same password as you imap has.
----------
#!/bin/bash
# this script adds a user to sogo
read -p "Username: " username
read -p "Password: " password
read -p "Full naam: " name
read -p "E-mail: " email
# create user in mysql:
output=`mysql -uroot <<EOD
use sogo;
INSERT INTO sogo_users VALUES ('$username', '$username', MD5('$password'), '$name', '$email');
EOD`
-------------

# A script to remove a user from Sogo:
-------------
#!/bin/bash
# this script removes a user to sogo
# you need this script executeable as "sogodel":
# http://www.mail-archive.com/users@sogo.nu/msg05670.html
read -p "Username: " username
output=`mysql -uroot <<EOD
use sogo;
DELETE FROM sogo_users WHERE c_uid="$username";
EOD`
echo $output
sogodel <<EOD
user delete $username
exit
EOD
-------------

# please write me if you have an idea to make this manual better:
# Paul van der Vlis paul@vandervlis.nl
# please don't change the setup of this page without contact.
# the setup for carddav for Mac is not well tested
# I also like something like this:
echo "Your SOGo manual helped me" | mail -s Thanks paul@vandervlis.nl