• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Important New Plesk webmail / SOGo Webmail extension

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:
  1. Install SOGo extension
  2. Install active-sync package
    Bash:
    sudo apt install sogo-activesync
  3. Update the SOGo config to enable active-sync in SOGo
    1. 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/
    2. Edit the template file in the custom_templates directory
      Bash:
      nano /usr/local/psa/var/modules/sogo/custom_templates/sogo.template.twig
    3. Add the following lines somewhere inside the brackets and save
      Bash:
      SOGoEnableEAS = YES;
      SOGoEASDisableUI = NO;
  4. Update the nginx config file to proxy active-sync request to SOGo
    1. 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/
    2. Edit the template file in the custom_templates directory
      Bash:
      nano /usr/local/psa/var/modules/sogo/custom_templates/nginx.template.twig
    3. 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;
      }
  5. Now you need to reconfigure plesk web-server as well as SOGo
    Bash:
    plesk sbin httpdmng --reconfigure-all
    plesk ext sogo configure
Happy mailing :cool:
@AYamshanov anything holding this back being implemented by plesk directly?

Client setup
  • Apple Mail on iPhone (Tested)
    1. Select "Microsoft Exchange"
    2. Enter email
    3. Select Manual setup
    4. For server and domain enter your webmail domain
    5. 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.
  • I did some testing with emails but noticed there are some default folders missing, investigating that currently
References
 
Hi @Dennis Rahmen!

Thank you for the guide how to configure SOGo Webmail with ActiveSync!

Currently, we prefer to have the SOGo Webmail extension as a flexible solution that could be adapted for each individual needs instead of complicated solution "all-in-one" because the "all-in-one" solution will require additional development resources (as for programming as for testing, maintenance, supporting).

And I happy to see that the idea of customizations and templates works well!
 
I installed SOGo Stable, but I can't log in. Removed and trying to install Nightly SOGo but I get an error message:

The task "ext-sogo-pleskext\sogo\longtasks\install" has failed.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY '<password string removed from original post>'' at line 1

Ubuntu 22.04.2 LTS
Plesk Obsidian 18.0.53

[Instead of <pasword string ...> there used to be a real password. It was removed for security reasons from this post. --PD]
 
Last edited by a moderator:
I installed SOGo Stable, but I can't log in. Removed and trying to install Nightly SOGo but I get an error message:

Sounds like two different issues. Let's try to investigate them one by one.

1. Could you please provide any additional details about why you could not log in into SOGo Webmail from stable repository? Have you used email and a password created especially for that email? Any additional warnings or errors?

1689683782776.png


2. And just to better understand steps to reproduce the second issue, could you also add some details about how you have removed the stable version before start installing nightly version?
 
Sounds like two different issues. Let's try to investigate them one by one.

1. Could you please provide any additional details about why you could not log in into SOGo Webmail from stable repository? Have you used email and a password created especially for that email? Any additional warnings or errors?

View attachment 23825


2. And just to better understand steps to reproduce the second issue, could you also add some details about how you have removed the stable version before start installing nightly version?
1. I was able to login to email with Roundcube and Thunderbird, then I installed the SOGo Webmail extension and selected SOGo Stable. When logging in from webmail, an error message was displayed that the password was incorrect. I can't show you the exact error messages anymore, since it fails to reinstall SOGo Stable, the same error message I showed appears when I try to install SOGo Nightly.

2. I uninstalled the SOGo Webmail extension and then ran apt autoremove
 
I installed SOGo Stable, but I can't log in. Removed and trying to install Nightly SOGo but I get an error message:

The task "ext-sogo-pleskext\sogo\longtasks\install" has failed.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY '<password string removed from original post>'' at line 1

Ubuntu 22.04.2 LTS
Plesk Obsidian 18.0.53

[Instead of <password string ...> there used to be a real password. It was removed for security reasons from this post. --PD]

The new version of the SOGo Webmail extension has been released.
Code:
Changes
1.1.1 (21 Jul 2023)
[-] Installation of SOGo Webmail no longer fails in Plesk on Ubuntu 22 with a MariaDB database server. (EXTPLESK-4847)

Lauris87, now it should work correctly, let me know if you have any feedback about how it works on you server :)
 
The new version of the SOGo Webmail extension has been released.
Code:
Changes
1.1.1 (21 Jul 2023)
[-] Installation of SOGo Webmail no longer fails in Plesk on Ubuntu 22 with a MariaDB database server. (EXTPLESK-4847)

Lauris87, now it should work correctly, let me know if you have any feedback about how it works on you server :)

I'm trying to install SOGo Nightly, but I get the following error message:

The task "ext-sogo-pleskext\sogo\longtasks\install" has failed.
pm_LongTask_Task::eek:nError(): Argument #1 ($e) must be of type Exception, TypeError given, called in /opt/psa/admin/plib/modules/sogo/library/Transaction/ReportAdapter.php on line 50

It is possible to open SOGo, partially in the installer, and webmail from the browser, but not when logging in. This is what the configuration file looks like (sogo.conf):

Code:
{
  /* *********************  Main SOGo configuration file  **********************
   *                                                                           *
   * Since the content of this file is a dictionary in OpenStep plist format,  *
   * the curly braces enclosing the body of the configuration are mandatory.   *
   * See the Installation Guide for details on the format.                     *
   *                                                                           *
   * C and C++ style comments are supported.                                   *
   *                                                                           *
   * This example configuration contains only a subset of all available        *
   * configuration parameters. Please see the installation guide more details. *
   *                                                                           *
   * ~sogo/GNUstep/Defaults/.GNUstepDefaults has precedence over this file,    *
   * make sure to move it away to avoid unwanted parameter overrides.          *
   *                                                                           *
   * **************************************************************************/

  /* Database configuration (mysql://, postgresql:// or oracle://) */
  //SOGoProfileURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_user_profile";
  //OCSFolderInfoURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_folder_info";
  //OCSSessionsFolderURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_sessions_folder";

  /* Mail */
  //SOGoDraftsFolderName = Drafts;
  //SOGoSentFolderName = Sent;
  //SOGoTrashFolderName = Trash;
  //SOGoJunkFolderName = Junk;
  //SOGoIMAPServer = "localhost";
  //SOGoSieveServer = "sieve://127.0.0.1:4190";
  //SOGoSMTPServer = "smtp://127.0.0.1";
  //SOGoMailDomain = acme.com;
  //SOGoMailingMechanism = smtp;
  //SOGoForceExternalLoginWithEmail = NO;
  //SOGoMailSpoolPath = /var/spool/sogo;
  //NGImap4AuthMechanism = "plain";
  //NGImap4ConnectionStringSeparator = "/";

  /* Notifications */
  //SOGoAppointmentSendEMailNotifications = NO;
  //SOGoACLsSendEMailNotifications = NO;
  //SOGoFoldersSendEMailNotifications = NO;

  /* Authentication */
  //SOGoPasswordChangeEnabled = YES;
 
 /* LDAP authentication example */
  //SOGoUserSources = (
  //  {
  //    type = ldap;
  //    CNFieldName = cn;
  //    UIDFieldName = uid;
  //    IDFieldName = uid; // first field of the DN for direct binds
  //    bindFields = (uid, mail); // array of fields to use for indirect binds
  //    baseDN = "ou=users,dc=acme,dc=com";
  //    bindDN = "uid=sogo,ou=users,dc=acme,dc=com";
  //    bindPassword = qwerty;
  //    canAuthenticate = YES;
  //    displayName = "Shared Addresses";
  //    hostname = "ldap://127.0.0.1:389";
  //    id = public;
  //    isAddressBook = YES;
  //  }
  //);

  /* LDAP AD/Samba4 example */
  //SOGoUserSources = (
  //  {
  //    type = ldap;
  //    CNFieldName = cn;
  //    UIDFieldName = sAMAccountName;
  //    baseDN = "CN=users,dc=domain,dc=tld";
  //    bindDN = "CN=sogo,CN=users,DC=domain,DC=tld";
  //    bindFields = (sAMAccountName, mail);
  //    bindPassword = password;
  //    canAuthenticate = YES;
  //    displayName = "Public";
  //    hostname = "ldap://127.0.0.1:389";
  //    filter = "mail = '*'";
  //    id = directory;
  //    isAddressBook = YES;
  //  }
  //);


  /* SQL authentication example */
  /*  These database columns MUST be present in the view/table:
   *    c_uid - will be used for authentication -  it's the username or [email protected])
   *    c_name - which can be identical to c_uid -  will be used to uniquely identify entries
   *    c_password - password of the user, plain-text, md5 or sha encoded for now
   *    c_cn - the user's common name - such as "John Doe"
   *    mail - the user's mail address
   *  See the installation guide for more details
   */
  //SOGoUserSources =
  //  (
  //    {
  //      type = sql;
  //      id = directory;
  //      viewURL = "postgresql://sogo:[email protected]:5432/sogo/sogo_view";
  //      canAuthenticate = YES;
  //      isAddressBook = YES;
  //      userPasswordAlgorithm = md5;
  //    }
  //  );


  /* Web Interface */
  //SOGoPageTitle = SOGo;
  //SOGoVacationEnabled = YES;
  //SOGoForwardEnabled = YES;
  //SOGoSieveScriptsEnabled = YES;
  //SOGoMailAuxiliaryUserAccountsEnabled = YES;
  //SOGoTrustProxyAuthentication = NO;
  //SOGoXSRFValidationEnabled = NO;

  /* General - SOGoTimeZone *MUST* be defined */
  //SOGoLanguage = English;
  //SOGoTimeZone = America/Montreal;
  //SOGoCalendarDefaultRoles = (
  //  PublicDAndTViewer,
  //  ConfidentialDAndTViewer
  //);
  //SOGoSuperUsernames = (sogo1, sogo2); // This is an array - keep the parens!
  //SxVMemLimit = 384;
  //WOPidFile = "/var/run/sogo/sogo.pid";
  //SOGoMemcachedHost = "/var/run/memcached.sock";

  /* Debug */
  //SOGoDebugRequests = YES;
  //SoDebugBaseURL = YES;
  //ImapDebugEnabled = YES;
  //LDAPDebugEnabled = YES;
  //PGDebugEnabled = YES;
  //MySQL4DebugEnabled = YES;
  //SOGoUIxDebugEnabled = YES;
  //WODontZipResponse = YES;
  //WOLogFile = /var/log/sogo/sogo.log;
}
 
Hello everybody,

I'll try to explain my request in English and hope that I can be understood!
I would like to make the inbox in SOGo available to my brother as a "share".
So I go to "Share" and can specify a user there, but I can't find one?
How does this work?

Using Plesk Obsidian Web Host Edition
Version 18.0.53 Update No. 2
and SOGo Version 5.8.4

Thanks for your help.

Greetings,
Thomas


_______________________________________________________________________________________
Hallo zusammen,

ich versuche mein Anliegen auf Englisch zu erklären und hoffe das man mich versteht!?
Ich möchte gerne den Posteingang bei SOGo als "Freigabe" mein Bruder zu Verfügung stellen.
Gehe also auf "Freigabe" und kann dort einen Benutzer angeben, doch finde keinen?
Wie funktioniert dieses?

Nutze Plesk Obsidian Web Host Edition
Version 18.0.53 Update Nr. 2
und SOGo Version 5.8.4

Danke für Eure Hilfe.

Gruß,
Thomas
 
Hi,

Here is my experience.

Platform is:

Plesk​

Product version: Plesk Obsidian 18.0.54.1
OS version: CentOS 7.9.2009 x86_64
Build date: 2023/07/25 10:00
Revision: 57b62fc510c24ebd99a489d3c76038df6439b417

SOGo Webmail extenstion​

Version: 1.1.1-137

RPMs:​

sogo-tool-5.8.4.20230731-1.el7.x86_64
sogo-5.8.4.20230731-1.el7.x86_64


I believe I have the nightly build enabled.

On installation I had no problems.

The first email address I created and on which I enabled SOGo webmail, everything went smoothly. This was a new domain that I added to Plesk.

The second email address that I created was on an existing domain on the Plesk installation. Although the email address is created and fully functional, I can not use it to log into the SOGo webmail interface. Upon quite a bit of investigating, I finally figured out that the user was not being added to the sogo_users_view table in the sogo_xxxxxxxx database. If I manually add the missing entry, I can login via the SOGo webmail interface and everything seems functional. My conclusion is, that for some or other reason, the user is not added to the database. I assume this is due to an error on my side and not due to design.

I also had errors in the sogo.log file, which I later determined was because memcached was not running. After starting memcached the errors disappeared.

I did not previously have memcached installed so I assume it was installed as part of the SOGo webmail extension.

memcached was not setup to start on boot. I would ensure that systemctl enable memcached is being run and perhaps add Wants = memcached.service to the sogod.service file. Perhaps even require it.

I also set memcached to only listen on 127.0.0.1 by making sure the OPTIONS="-l 127.0.0.1" entry is in the /etc/sysconfig/memcached file. We do not want memcached accidentally open to the world.

Thank you for the work so far.

--
Kind regards,
-Carl
 
Upon quite a bit of investigating, I finally figured out that the user was not being added to the sogo_users_view table in the sogo_xxxxxxxx database. If I manually add the missing entry, I can login via the SOGo webmail interface and everything seems functional. My conclusion is, that for some or other reason, the user is not added to the database. I assume this is due to an error on my side and not due to design.
It seems like there are issues with the mailname_create and mailname_update events in Plesk Obsidian 18.0.54.0 and above. SOGo extension relies heavily on these events to keep authorization table up-to-date. I've created an item for internal investigation and I hope that it gets a well-deserved hotfix, but I cannot guarantee it for now.
 
It seems like there are issues with the mailname_create and mailname_update events in Plesk Obsidian 18.0.54.0 and above. SOGo extension relies heavily on these events to keep authorization table up-to-date. I've created an item for internal investigation and I hope that it gets a well-deserved hotfix, but I cannot guarantee it for now.
Thank you for that.
 
I am using an Ionos-Plesk vServer and installed the SOGo extension. Everythink look fine, but the Users can not log in.

I read something about the password-encryption should be "sym". Where can I check or change that in Plesk?
 
I am using an Ionos-Plesk vServer and installed the SOGo extension. Everythink look fine, but the Users can not log in.

I read something about the password-encryption should be "sym". Where can I check or change that in Plesk?
I found out the new created mail-users were not created in the sogo database. Is thereany way to manually create the ssha512-hash?
 
[...] I hope that it gets a well-deserved hotfix, but I cannot guarantee it for now.
An update regarding plans: a fix has been planned to be delivered with the next Plesk hotfix release.


I found out the new created mail-users were not created in the sogo database. Is thereany way to manually create the ssha512-hash?
I would recommend to avoid changing anything manually in the database. There are two different ways to add missing users into SOGo Webmail in more simple ways:
  • the extension contains CLI interface, one of the commands check and repair the database and configuration,
Code:
# plesk ext sogo repair
   0/100 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
 [INFO] Step: Installing packages on the server.

  20/100 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20%
 [INFO] Step: Creating a database for contacts.

  70/100 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░]  70%
 [INFO] Step: Syncing Plesk mail users with SOGo.
 [INFO] Step: Generating configuration for SOGo.

 100/100 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 [OK] Successfully repaired configuration
  • another way is to reinstall the extension. During the installation, the extension also creates database with necessary data about existing users.
 
An update regarding plans: a fix has been planned to be delivered with the next Plesk hotfix release.



I would recommend to avoid changing anything manually in the database. There are two different ways to add missing users into SOGo Webmail in more simple ways:
  • the extension contains CLI interface, one of the commands check and repair the database and configuration,
Code:
# plesk ext sogo repair
   0/100 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
 [INFO] Step: Installing packages on the server.

  20/100 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20%
 [INFO] Step: Creating a database for contacts.

  70/100 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░]  70%
 [INFO] Step: Syncing Plesk mail users with SOGo.
 [INFO] Step: Generating configuration for SOGo.

 100/100 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
 [OK] Successfully repaired configuration
  • another way is to reinstall the extension. During the installation, the extension also creates database with necessary data about existing users.
After executing the repair, SOGo and the login worked just fine.
 
Timestamp of Mails are 2hrs away from my timezone, which is Berlin/Europe.
This should be a setting which is transfered from Plesk to SOGo.

If someone can tell me, where I switch this for SOGo, it would be great.
 
Timestamp of Mails are 2hrs away from my timezone, which is Berlin/Europe.
This should be a setting which is transfered from Plesk to SOGo.
Currently, it is possible to do only via the sogo.conf file directly, an example exists in post #919520 of this topic.


It seems like, after creating a new mailadresse, I always have to execute the repair-tool.
Yes, it is quick and simple workaround till Plesk Obsidian 18.0.54 Update 3 be released. With the update #3, the issue with mailname_create and mailname_update events should be fixed and the extension start working in correct manner again.
 
Great. I am looking forward to the new upgrade.
I made a cronjob for plesk ext sogo repair, which should solve the problem in the meantime.

Currently I have an issue with the sharing of Mailfolders with other users. The app gives me the feedback "Funktion not implemented".
Is this a known issue? Is there a solution?
 
Back
Top