Mailuser interface

Discussion in 'Plugins/Modules/Addons' started by Horfic, Aug 23, 2009.

?

Would you like to see a mailuser interface for Roundcube & Squirrelmail?

  1. Yes

    210 vote(s)
    98.6%
  2. No

    3 vote(s)
    1.4%
  1. NeeChee

    NeeChee New Member

    I've been investigating the matter of the spamfilter/priority settings, but I couldn't find anything... Perhaps Horfic, falko or Till (Right users?) can shed some light on this matter...
     
  2. jariasca

    jariasca Member

    Soap Error: DTD are not supported by SOAP

    Hi I'm trying to get my spamfilter to work but I still getting error msg

    I replace

    Original:

    $update = $client->mail_spamfilter_user_update($session_id, $id, $mail_user[0]['sys_userid'], $params);

    Replacement:

    $clientid = 0;
    $update = $client->mail_spamfilter_user_update($session_id, $clientid, $mail_user[0]['mailuser_id'], $params);


    and I get:

    Soap Error: DTD are not supported by SOAP

    Can you help me?
    regrads,
    Jorge


     
  3. Horfic

    Horfic Member

    So, sorry for the long waiting! I'm stuffed full with work.:)

    I uploaded all new translations to the svn. Add to that, I also uploaded the promised mail user filter plugin.

    Check it out now^^.
    PS: Don't forget to update the remote user functions list.
    PPS: The function list:
    Code:
    ,mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete
     
  4. jariasca

    jariasca Member

    Spanish translation for the mail filter

    Thanks works perfect.. The only thing we are missing is to make a copy or forwarding to another account.

    great job
    regards

    -Jorge



     

    Attached Files:

  5. Horfic

    Horfic Member

    The frontend of the forwarding plugin is existing already for a long time, the prob is the following. The forwarding of ISPConfig isn't working like you general know. You can't have a forward and the same email at the same time. You have to use the cc "!.... to do that. Unfortunately the entry to change that isn't available yet in ISPConfig 3.0.1.6.

    But it is available in ISPConfig 3.0.2. SO just wait. I also will update then the autoreply for the date field.

    PS: Translation is already in the svn
     
  6. NeeChee

    NeeChee New Member

    I've updated the instructions and translated the mail filter plugin to Dutch.
     

    Attached Files:

  7. Horfic

    Horfic Member

    @NeeChee
    You forgot to add the filter plugin in the $rcmail_config['plugins'] array:)
     
  8. NeeChee

    NeeChee New Member

    Completely right! It should be ok now!
     
  9. moglia

    moglia New Member

    SVN Version Works to check functions.

    Can create remote user with svn version and check the boxes necessary to all remote functions you need.
     
  10. Horfic

    Horfic Member

    After intensive investigation on the "No client with ID $client_id found" problem. I came to an conclusion.

    Problem:
    The error happens because ISPConfig is looking for the associated client associated with the sysuser of the email and when just the sysuser exists, than the error appears.

    When a "CP User" (sysuser) gets created, it doesn't has a associated client, and when the sysuser created the email mailbox the error appears.


    Solution:
    When a client gets created, the sysuser get automatically added to the system.
    So this sysuser has now a associated client and the error won't appear.

    1.)So the best way, would be to just create the missing client for the sysuser.
    2.)Whereever the error appears, go in the appropriate ispconfig3_xxxx.php file, located in the plugin folder of the roundcube plugin folder, search for update and then search for sysuser_id.

    Should be something like that
    $update = $client->mail_spamfilter_user_update($session_id, $id, $mail_user[0]['sys_userid'], $params);

    and replace it with a 0,
    $update = $client->mail_spamfilter_user_update($session_id, $id, 0, $params);

    PS: French translation is in the svn.
     
  11. SpeedyB

    SpeedyB HowtoForge Supporter

    Dear Horfic,

    THis is not the case in my situation.

    I have several clients, and all clients have 2 sysusers (Why only have one admin for an environment??)
    When I have 5 clients I have 10 sys users....

    The piece of code you run:
    Code:
    $client->mail_spamfilter_user_update($session_id, $id, $mail_user[0]['sys_userid'], $params);
    
    requires the following entries:
    Sessionid,
    MailboxID
    ClientID,
    Parameters

    Since the code requests an clientid and you use the sys_userid this is where the problem starts. I haven't searched if one of the mailbox poperties is the clientid, but otherwise it might be possible to get the clientid form the sysuser properties?

    regards,

    Bas Steelooper
     
  12. NeeChee

    NeeChee New Member

    Yes I noticed, if you check the language section of my instructions, you'll see I've inventorized all languages and which parts of them are still missing or incomplete.
     
  13. Horfic

    Horfic Member

    @SpeedyB
    You are totaly right with that, but the mail_user table only has the sysuser_id field, no client field, so there is no other way for the moment (except the second solution with the 0 I posted, so everything gets created by admin).

    I would have to change a little bit in the remoting_lib.inc.php from ISPConfig 3. ATM you have to send the client_id, he is looking up if that client exists and then he looks for the appropriate sysuser and is using the fields of it (sys_username, sys_userid, sys_default_group, sys_groups).

    It would be better if he is just looks up if the sysuser exists and is then using the fields, so that we skip the client lookup.

    The modified loadUserProfile function in the /interface/lib/classes/remoting_lib.inc.php would be this.
    PHP:
    function loadUserProfile($client_id 0) {
        global 
    $app,$conf;
                
        
    $client_id intval($client_id);
                
        if(
    $client_id == 0) {
            
    $this->sys_username         'admin';
            
    $this->sys_userid            1;
            
    $this->sys_default_group     1;
            
    $this->sys_groups            1;
        } else {
            
    //* load system user
            
    $user $app->db->queryOneRecord("SELECT * FROM sys_user WHERE sysuser_id = $client_id");
            if(empty(
    $user["userid"])) {
                
    $this->errorMessage .= 'No sysuser with the ID $client_id found.';
                return 
    false;
            }
            
    $this->sys_username         $user['username'];
            
    $this->sys_userid            $user['userid'];
            
    $this->sys_default_group     $user['default_group'];
            
    $this->sys_groups             $user['groups'];
        }
                
        return 
    true;
                
    }
    I don't know how much it would effect the other scripts which are using the remote framework, but I know that pretty much only the sysuser_id and not the client_id is in the tables.

    So probably it helps the others too.

    UPDATE: I updated the remote_lib.inc.php file in the ISPConfig 3 svn, so with the new version it will be fine^^
     
    Last edited: Feb 22, 2010
  14. NeeChee

    NeeChee New Member

    Did you get SVN access? Pretty awesome :cool:
     
  15. moglia

    moglia New Member

    No sysuser with the ID $client_id found

    Im just upgraded to SVN version and now any modifications on autoresponse and other says: "No sysuser with the ID $client_id found"
     
  16. NeeChee

    NeeChee New Member

    See post #133
     
  17. moglia

    moglia New Member

    Im using latest version from SVN.
     
  18. moglia

    moglia New Member

    Some info about it.

    I maked a debug info at console the remote script pass ID 2 to remote lib.
    try make some SQL to investigate the situation:

    Code:
    mysql> select distinct(sys_userid) from mail_user;
    +------------+
    | sys_userid   | 
    +------------+
    |          2      |
    +------------+
    
    mysql> select sys_userid, client_id,contact_name,company_name from client;
    +------------+-----------+------------------------+----------------------
    | sys_userid   | client_id   | contact_name              | company_name         |
    +------------+-----------+------------------------+----------------------
    |          1      |         1     | Rodrigo Moglia              | INTERARIA IT           |
    |          1      |         2     | Pierre                         | Pierre                      |
    --------------------------------------------------------------------------
    
    mysql> select userid, sys_userid, username from sys_user;
    +--------+------------+--------------+
    | userid | sys_userid | username          |
    +--------+------------+--------------+
    |      1    |          1      | admin           |
    |      2    |          1      | interatius       |
    |      3    |          1      | pierre        |
    ---------------------------------------
    
     
  19. NeeChee

    NeeChee New Member

    Yes, but the patch was done in the ISPconfig3 SVN and not the plugin SVN since the patch had to be done in the ISPconfig3 Remote Framework. If you can't update your ISPconfig3 installation through SVN, try editing the file as described in post #133.
     
    Last edited: Feb 23, 2010
  20. moglia

    moglia New Member

    Hi

    My translator of brazilian portuguese and use latest version SVN head on my prodution server.
    No sysuser with the ID $client_id found persists i created another account as reseller or client
    and the same results displayed.
     
    Last edited: Feb 23, 2010

Share This Page