1 (edited by CrashXRU 2019-12-12 13:45:02)

Topic: how to connect to SOGo sieve service from outside ?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail offline
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP -> Active Directory
- Web server: Nginx
- Manage mail accounts with iRedAdmin-Pro? NONE
====

Since it uses storage in the database, a direct connection to dovecot does not solve the problem of importing rules
because the next time you log in to the web interface, the file will be updated from the database

the question

is how to connect to the service SOGo sieve?



I use a Thunderbird 60.9.1 and a plugin Sieve 0.3.1

direct connection with dovecot port 2000 - OK
I expect a connection with SoGo port 4190

[12:34:22.550 ] Channel Added: cid=0 [cid=0]
[12:34:22.550 ] Connecting to mail.domain.local:4190 ...
[12:34:22.550 ] Using Proxy: Direct
[12:34:22.552 ] Server -> Client
[12:34:23.563 ] Connected to mail.domain.local:4190 ...
[12:34:23.563 ] Stop request received ...
[12:34:23.563 ] Disconnecting mail.domain.local:4190...
[12:34:23.563 ] Disconnected ...
[12:34:23.563 ] On Server Disconnect:  [cid=0]
[12:34:23.563 ] Invoking Listeners for onDisconnect
[12:34:23.564 ] Channel Closed: cid=0 []
[12:34:23.564 ] No Listener for onChannelClosed
[12:34:23.564 ] Disconnecting mail.domain.local:4190...

nftables.conf add rule

        # sieve
        tcp dport 2000 accept
        tcp dport 4190 accept

dovecot.conf

service managesieve-login {
    inet_listener sieve {
        # Listen on localhost (ipv4)
        #address = 127.0.0.1
        port = 2000
    }

sogo.conf

//    SOGoSieveServer = "sieve://127.0.0.1:4190/?tls=YES";
    SOGoSieveServer = "sieve://mail.domain.local:2000/?tls=YES"; // WORK ON WEB SOGo
    SOGoSieveScriptsEnabled = YES;
    SOGoVacationEnabled = YES;
    SOGoForwardEnabled = YES;
    SOGoSieveFolderEncoding = UTF-8;

***
more
***
    // Authentication using Active Directory
    SOGoUserSources = (
        {
            // Used for user authentication
            type = ldap;
            id = directory;
            canAuthenticate = YES;
            isAddressBook = NO;
            displayName = "Active Directory";

//            SieveHostFieldName = "sieve://mail.domain.local:2000/?tls=YES"; //NOT WORK
//            SieveHostFieldName = "sieve://mail.domain.local:2000";  //NOT WORK
//            SieveHostFieldName = "sieve://mail.domain.local:4190";  //NOT WORK
            SieveHostFieldName = "sieve://mail.domain.local:4190/?tls=YES";  //NOT WORK

            hostname = "ldap://dc2.domain.local";
            port = 389;
            baseDN = "DC=domain,DC=local";
            bindDN = "CN=iredmail,DC=domain,DC=local";
            bindFields = (sAMAccountName, userPrincipalName);
            bindPassword = "P@S$W0RD";
            filter = "(  ((mail=\'*@*\') AND (sn=\'*\') AND (objectCategory=person) AND (objectClass=user) AND ( NOT (userAccountControl:1.2.840.113556.1.4.803:=2)))
                      OR ((mail=\'*@*\') AND (objectCategory=group) AND (objectClass=group))
                      OR ((mail=\'*@*\') AND (objectCategory=person) AND (objectClass=contact)))";
            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.
            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 = plain;

            CNFieldName = cn;
            IDFieldName = cn;
            // value of UIDFieldName must be unique on entire server
            UIDFieldName = userPrincipalName;
        }

maybe you know a way?
thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: how to connect to SOGo sieve service from outside ?

temporarily solved the problem with the transfer of sorting rules
but did not solve the main problem



NOTE:
I connected the cube file as a user script, through dovecot it became possible to edit, but it is better to have one file and the ability to use it through the web interface, since not everyone can write the rules correctly

dovecot.conf

    # Pigeonhole managesieve service.
    # Reference: http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
    # Per-user sieve settings.
    sieve_dir = ~/sieve
    sieve = ~/.dovecot.sieve

    # Global sieve settings.
    sieve_global_dir = /var/vmail/sieve
    # Note: if user has personal sieve script, global sieve rules defined in
    #       sieve_default will be ignored. Please use sieve_before or
    #       sieve_after instead.
    #sieve_default =

    sieve_before = /var/vmail/sieve/dovecot.sieve
    # User-specific scripts executed before the user's personal script.
    #   E.g. a vacation script managed through a non-ManageSieve GUI.
    # run rules form RoundCude + 
    sieve_before2 = ~/sieve/managesieve.sieve

https://clip2net.com/clip/m133812/9d265-clip-14kb.png

3

Re: how to connect to SOGo sieve service from outside ?

- SOGo stores sieve rules in SQL database, then dump it to server via the managesieve service. It does NOT edit the sieve file via managesieve service directly. This causes some problem, for example, it cannot maintain same sieve files together with other MUA or webmails, e.g. Roundcube webmail.
- If you want to use Thunderbird to manage sieve rules, try to disable sieve support in SOGo and connect (Thunderbird) to the managesieve service directly. You can also manage sieve rules with Roundcube.

4

Re: how to connect to SOGo sieve service from outside ?

yes i know SOGo is using a database
but hoped to gain access for import and export

at the installation stage, I refused roundcube and do not want to have 2 web interfaces, it is a pity that there is no import and export of sieve rules in  Web SOGo