View Issue Details

IDProjectCategoryView StatusLast Update
0004763SOGoActiveSyncpublic2019-07-10 09:46
Reporterbuggy09 Assigned Toludovic  
PriorityurgentSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Platform[Server] LinuxOSUbuntu ServerOS Version18.04 LTS
Product Version4.0.7 
Target VersionFixed in Version 
Summary0004763: After upgrade "Could not get a valid IMAP connection"
Description

Last nightly build from 07.06.2019 caused SOGO to have issues to connect clients to IMAP. Our clients are mostly Exchange ActiveSync (Outlook).

In /etc/log/sogo/sogo.log:

[code]
Jun 07 12:32:04 sogod [4416]: [ERROR] <0x55a66605cc30[SOGoMailFolder]:folderINBOX> Could not get a valid IMAP connection
Jun 07 12:32:04 sogod [4416]: [WARN] <0x55a665cc68a0[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...
[/code]

This log fills up very fast, and CPU is close to 100% all the time.

/var/log/dovecot/imap.log:

[code]
Jun 7 12:35:39 mx dovecot: imap-login: Login: user=<john.doe@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=23891, secured, session=<DbpHZLmKEtJ/AAAB>
Jun 7 12:35:39 mx dovecot: imap(john.doe@example.com): Connection closed (status finished 0.003 secs ago) in=63 out=865
[/code]

Steps To Reproduce

For me, it was upgrade to the newest sogo/sogoactivesync

Additional Information

Sogo is installed as part of iRedMail script, and was working fine for months.

TagsNo tags attached.

Activities

ludovic

ludovic

2019-06-07 08:13

administrator   ~0013621

Show your sogo.conf file.

buggy09

buggy09

2019-06-07 12:49

reporter   ~0013622

Here is my sogo.conf:

{
//
// - Official SOGo document: http://sogo.nu/support/index.html#/documentation
// - Mailing list: http://sogo.nu/support/index.html#/community
//

// Daemon address and port
WOPort = 127.0.0.1:20000;

// PID file
//WOPidFile = /var/run/sogo/sogo.pid;

// Log file
//WOLogFile = /var/log/sogo/sogo.log;

// Enable verbose logging. Reference:
// http://www.sogo.nu/nc/support/faq/article/how-to-enable-more-verbose-logging-in-sogo.html
//SOGoDebugRequests = YES;
//SOGoEASDebugEnabled = YES;
//ImapDebugEnabled = YES;
//LDAPDebugEnabled = YES;
//MySQL4DebugEnabled = YES;
//PGDebugEnabled = YES;

// Define the URL to online help for SOGo. When set, an additional icon
// will appear near the logout button in SOGo's web interface. The URL
// will always be open in a blank target.
//SOGoHelpURL = '';

// set the maximum allowed size for content being sent to SOGo, this can
// also limit the file attachment size being uploaded to SOGo when
// composing a mail.
// The value is in kilobyte. Default is 0 or disabled (unlimit).
WOMaxUploadSize = 52428800;

// Parameter used to set the maximum allowed email message size when
// composing a mail.
// The value is in kilobytes. By default, the value is 0, or disabled so
// no limit will be set.
SOGoMaximumMessageSizeLimit = 52428800;

// Performance Tuning
//
// The amount of instances of SOGo that will be spawned to handle multiple
// requests simultaneously. When started from the init script, that amount
// is overriden by the `PREFORK=` setting in /etc/sysconfig/sogo or
// /etc/default/sogo. A value of 3 is a reasonable default for low usage.
// The maximum value depends on the CPU and IO power provided by your
// machine: a value set too high will actually decrease performances under
// high load.
//
// You should have at least one child per EAS device configured to use
// &quot;push&quot;. You must also have more children than you have EAS devices
// configured to use &quot;push&quot; - in order to handle normal SOGo requests to
// its Web or DAV interfaces.
//
// Defaults to 1 when unset, increase it if you see below error message in
// sogo log file: 'No child available to handle incoming request'
//
// WARNING:
//      - on RHEL/CentOS, this setting is controlled by parameter
//        'PREFORK=' defined in /etc/sysconfig/sogo.
//      - on Debian/Ubuntu, this setting is controlled by parameter
//        'PREFORK=' defined in /etc/default/sogo.
WOWorkersCount = 60;

// Parameter used to set the maximum amount of time, in seconds, SOGo will
// wait before replying to a Ping command.
// If not set, it defaults to 10 seconds.
SOGoMaximumPingInterval = 3540;

// Parameter used to set the maximum amount of time, in seconds, SOGo will
// wait before replying to a Sync command.
// If not set, it defaults to 30 seconds.
SOGoMaximumSyncInterval = 3540;

// Parameter used to set the maximum amount of time, in seconds, SOGo will
// wait before doing an internal check for data changes (add, delete, and
// update). This parameter must be lower than SOGoMaximumSyncInterval and
// SOGoMaximumPingInterval.
// If not set, it defaults to 10 seconds.
SOGoInternalSyncInterval = 60;

// Specifies the number of minutes after which a busy child process will be
// killed by the parent process.
// Defaults to 10 (minutes).
WOWatchDogRequestTimeout = 61;

// Overwrite the maximum number of items returned during a Sync operation.
// Defaults to 0, which means no overwrite is performed.
// Setting this parameter to a value greater than 512 will have unexpected
// behaviour with various ActiveSync clients.
//SOGoMaximumSyncWindowSize = 100;

// Overwrite the maximum response size during a Sync operation.
// The value is in kilobytes. Setting this to 512 means the response size
// will be of 524288 bytes or less (or a bit greater if needed for syncing
// one item). Note that if you set the value too low and a mail message
// (or any other object like calendar events, tasks and contacts) surpasses
// it, it will still be synced but only this item will be.
// Defaults to 0, which means no overwrite is performed.
//
// Say you have these five mails and you set the limit to 512KB:
//  1.  250 KB
//  2.  250 KB
//  3.   25 KB
//  4.  750 KB
//  5.   10 KB
// Sync iteration no. 1 will pick message 1, 2 and 3.
// Sync iteration no. 2 will pick message 4.
// Sync iteration no. 3 will pick message 5.
SOGoMaximumSyncResponseSize = 2048;

// The maximum amount of memory (in megabytes) that a child can use.
// Reaching that value will force children processes to restart, in order
// to preserve system memory.
//
// Error message when it reaches the value:
// &quot;terminating app, vMem size limit (xxx MB) has been reached (currently xxx MB)&quot;
//
// Defaults to 384.
SxVMemLimit = 500;

// Enable XSRF (also known as CSRF) protection.
SOGoXSRFValidationEnabled = YES;

// IMAP connection pool.
// Your performance will slightly increase, as you won't open a new
// connection for every access to your IMAP server.
// But you will get a lot of simultaneous open connections to your IMAP
// server, so make sure he can handle them.
// For debugging it is reasonable to turn pooling off.
//NGImap4DisableIMAP4Pooling = NO;

SOGoProfileURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_user_profile&quot;;
OCSFolderInfoURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_folder_info&quot;;
OCSSessionsFolderURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_sessions_folder&quot;;
OCSEMailAlarmsFolderURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_alarms_folder&quot;;

// With 3 parameters below, SOGo requires only 9 SQL tables in total
// instead of creating 4 SQL tables for each user.
OCSCacheFolderURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_cache_folder&quot;;
OCSStoreURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_store&quot;;
OCSAclURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/sogo_acl&quot;;

// Default language in the web interface
SOGoLanguage = English;

// Specify which module to show after login: Calendar, Mail, Contacts.
SOGoLoginModule = Mail;

// Must login with full email address
SOGoForceExternalLoginWithEmail = YES;

// Allow user to change full name and email address.
SOGoMailCustomFromEnabled = NO;

// IMAP server
// Local connection is considered as secure by Dovecot, so 'imap://' is fine.
// With remote IMAP server, use 'imaps://127.0.0.1:143/?tls=YES' instead;
SOGoIMAPServer = &quot;imap://127.0.0.1:143/&quot;;

// Allow user to add other IMAP accounts that will be visible from the SOGo
// Webmail interface.
// Default is NO.
//SOGoMailAuxiliaryUserAccountsEnabled = YES;

// SMTP server
SOGoSMTPServer = 127.0.0.1;
SOGoMailingMechanism = smtp;
//SOGoSMTPAuthenticationType = PLAIN;

// Enable managesieve service
//
// 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.
//          FYI: https://docs.iredmail.org/why.no.sieve.support.in.sogo.html
//
//SOGoSieveServer = &quot;sieve://127.0.0.1:4190/?tls=YES&quot;;
//SOGoSieveScriptsEnabled = YES;
//SOGoVacationEnabled = YES;
//SOGoForwardEnabled = YES;
SOGoSieveFolderEncoding = UTF-8;

// Memcached
SOGoMemcachedHost = 127.0.0.1;

// Parameter used to set which usernames require administrative privileges
// over all the users tables. For example, this could be used to post
// events in the users calendar without requiring the user to configure
// his/her ACLs. In this case you will need to specify those superuser's
// usernames like this :
// SOGoSuperUsernames = (&lt;username1>[,&lt;username2>, ...]);
//SOGoSuperUsernames = ();

SOGoTimeZone = &quot;Europe/Zagreb&quot;;

SOGoFirstDayOfWeek = 1;

SOGoRefreshViewCheck = every_5_minutes;
SOGoMailReplyPlacement = below;

// Disable gravatar
SOGoExternalAvatarsEnabled = NO;
SOGoGravatarEnabled = NO;

//
// Notifications
//
// Enable email-based alarms on events and tasks.
SOGoEnableEMailAlarms = YES;

// Notify meeting participants
SOGoAppointmentSendEMailNotifications = YES;

// Notify if a calendar or an address book has been created.
SOGoFoldersSendEMailNotifications = YES;

// Notify involved users of a calendar or address book√Ęs ACLs.
SOGoACLsSendEMailNotifications = YES;

// Notify when a modification is being done to his/her own calendar by someone else.
SOGoNotifyOnExternalModifications = YES;

// NOTE: PostgreSQL cannot update view in iRedMail
SOGoPasswordChangeEnabled = YES;

// Authentication using SQL

SOGoUserSources = (
    {
        type = sql;
        id = users;
        viewURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/users&quot;;
        canAuthenticate = YES;

        // The algorithm used for password encryption when changing
        // passwords without Password Policies enabled.
        // Possible values are: plain, crypt, md5-crypt, ssha, ssha512.
        userPasswordAlgorithm = ssha512;
        prependPasswordScheme = YES;

        // Use `vmail.mailbox` as per-domain address book.
        isAddressBook = YES;
        displayName = &quot;Domain Address Book&quot;;
        SOGoEnableDomainBasedUID = YES;
        DomainFieldName = &quot;domain&quot;;
    },

    //{
    //    //
    //    // WARNING: all mail users can see/search ALL accounts.
    //    //
    //    displayName = &quot;Global Address Book&quot;;
    //    type = sql;
    //    id = global_address_book;
    //    viewURL = &quot;mysql://sogo:BlSERWJ3QPKOBEaVFFTcAg763ZBPuV@127.0.0.1:3306/sogo/users&quot;;
    //    canAuthenticate = NO;
    //    isAddressBook = YES;
    //}
);

// Authentication using LDAP
/* LDAP backend
SOGoUserSources = (
    {
        // Used for user authentication
        type = ldap;
        id = users;
        canAuthenticate = YES;
        isAddressBook = NO;
        displayName = &quot;LDAP Authentication&quot;;

        hostname = &quot;PH_LDAP_URI&quot;;
        baseDN = &quot;PH_LDAP_BASEDN&quot;;
        bindDN = &quot;PH_LDAP_BINDDN&quot;;
        bindPassword = &quot;PH_LDAP_BINDPW&quot;;
        filter = &quot;objectClass=mailUser AND accountStatus=active AND enabledService=mail AND enabledService=sogo&quot;;
        scope = SUB;

        // always keep binding to the LDAP server using the DN of the
        // currently authenticated user. bindDN and bindPassword are still
        // required to find DN of the user.
        // Note: with default LDAP acl configured by iRedMail, user doesn't
        //       have privilege to query PH_LDAP_BASEDN.
        //       so this doesn't work.
        //bindAsCurrentUser = YES;

        // The algorithm used for password encryption when changing
        // passwords without Password Policies enabled.
        // Possible values are: plain, crypt, md5-crypt, ssha, ssha512.
        userPasswordAlgorithm = ssha512;

        CNFieldName = cn;
        IDFieldName = mail;
        // value of UIDFieldName must be unique on entire server
        UIDFieldName = mail;
        IMAPLoginFieldName = mail;
        MailFieldNames = (mail);
        bindFields = (mail);
    },
    {
        // Used for global address book
        type = ldap;
        id = global_addressbook;
        canAuthenticate = NO;
        isAddressBook = YES;
        displayName = &quot;Global Address Book&quot;;
        bindAsCurrentUser = YES;

        // Listing of this LDAP source is only possible when performing a
        // search (respecting the SOGoSearchMinimumWordLength parameter)
        // or when explicitely typing a single dot.
        // Defaults to YES when unset.
        //
        // WARNING: if you have many accounts in this address book, it may
        //          reach server-side query size limit, or cause
        //          performance issue.
        listRequiresDot = NO;

        hostname = &quot;PH_LDAP_URI&quot;;
        baseDN = &quot;PH_LDAP_BASEDN&quot;;
        bindDN = &quot;PH_LDAP_BINDDN&quot;;
        bindPassword = &quot;PH_LDAP_BINDPW&quot;;
        filter = &quot;((enabledService=mail AND accountStatus=active AND enabledService=displayedInGlobalAddressBook) AND ((objectClass=mailUser AND enabledService=sogo) OR (objectClass=mailList) OR (objectClass=mailAlias)))&quot;;
        scope = SUB;

        IDFieldName = mail;
        bindFields = (mail);
        // value of UID field must be unique on whole server.
        UIDFieldName = mail;
        IMAPLoginFieldName = mail;

        CNFieldName = cn;
        SearchFieldNames = (cn, sn, displayName, telephoneNumber, mail, shadowAddress, departmentNumber);
    }
);
LDAP backend */

}

buggy09

buggy09

2019-06-07 13:48

reporter   ~0013623

I tried again with the restored server. Before upgrade, everything works perfectly. After upgrade, same errors. These are packages available for upgrade. Sogo.conf was not touched during upgrade:

The following packages will be upgraded:
apt apt-utils libapt-inst2.0 libapt-pkg5.0 libdb5.3 libsbjson2.3 libsope-appserver4.9 libsope-core4.9 libsope-gdl1-4.9 libsope-ldap4.9 libsope-mime4.9 libsope-xml4.9 linux-libc-dev php7.2-cli php7.2-common php7.2-curl php7.2-fpm
php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml python-jinja2 sogo sogo-activesync sope4.9-gdl1-mysql sope4.9-libxmlsaxdriver update-notifier-common

And again same errors:

Jun 07 19:45:08 sogod [17330]: [ERROR] <0x557cafe8f860[SOGoMailAccount]:0> Could not get a valid IMAP connection
Jun 07 19:45:08 sogod [17330]: [WARN] <0x557cafe8f860[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...
Jun 07 19:45:08 sogod [17329]: [WARN] <0x557caf5866c0[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...
Jun 07 19:45:08 sogod [17329]: [ERROR] <0x557caf5866c0[SOGoMailAccount]:0> Could not get a valid IMAP connection
Jun 07 19:45:08 sogod [17329]: <0x0x557caf345e10[NGImap4Client]> ERROR(-[NGImap4Client _processUnknownCommandParserException:]): catched non-IMAP4 parsing exception NGSocketException: NGActiveSocket is not open
Jun 07 19:45:08 sogod [17330]: [ERROR] <0x557cafe8f860[SOGoMailAccount]:0> Could not get a valid IMAP connection

erich_k4

erich_k4

2019-06-07 15:44

reporter   ~0013625

might be same issue as here 0004757

ludovic

ludovic

2019-07-10 09:46

administrator   ~0013665

Fixed in SOPE a few days ago.

Issue History

Date Modified Username Field Change
2019-06-07 07:19 buggy09 New Issue
2019-06-07 08:13 ludovic Note Added: 0013621
2019-06-07 12:49 buggy09 Note Added: 0013622
2019-06-07 13:48 buggy09 Note Added: 0013623
2019-06-07 15:44 erich_k4 Note Added: 0013625
2019-07-10 09:46 ludovic Note Added: 0013665
2019-07-10 09:46 ludovic Status new => closed
2019-07-10 09:46 ludovic Assigned To => ludovic
2019-07-10 09:46 ludovic Resolution open => fixed