# Bugs #2623: doesn't modify the email account settings for an user

**URL:** <http://discourse.egroupware.org/t/bugs-2623-doesnt-modify-the-email-account-settings-for-an-user/39358>\
**Category:** eGW-tracker\
**Created:** [June 8, 2010, 11:02am UTC](http://discourse.egroupware.org/t/bugs-2623-doesnt-modify-the-email-account-settings-for-an-user/39358 "2010-06-08T11:02:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracker-3](http://discourse.egroupware.org/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@tracker-3](http://discourse.egroupware.org/u/tracker-3)\
**Post date:** [June 8, 2010, 11:02am UTC](http://discourse.egroupware.org/t/bugs-2623-doesnt-modify-the-email-account-settings-for-an-user/39358/1 "2010-06-08T11:02:21Z")

</div>

Ticket modified by Klaus Leithoff at 2010/06/08 13:02  
Tracking System: Bugs  
Category: EmailAdmin  
Version: Trunk  
Status: Open  
Resolution: None  
Completed: 90%  
Priority: 5 - medium  
Created By: camel camel  
Assigned to: Klaus Leithoff  
Summary: #2623 - doesn’t modify the email account settings for an user.  
doesn’t modify the email account settings for an user.  
(tried it in last trunk + ldap + postgresql + cyrus + postfix(dbmail)

if i go to user admin -\> then email account, and tried to remove an ALIAS , then i click SAVE. and in webservers log i found:

May 26 12:51:59 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: PHP Warning: ldap\_mod\_replace() [function.ldap-mod-replace]: Modify: Undefined attribute type in /var/www/egroupware\_TRUNK/htdocs/egroupware/emailadmin/inc/class.emailadmin\_smtp\_ldap.inc.php on line 352

the same thread is under #feature request# #2622  
Comment by Klaus Leithoff at 2010/06/08 13:02:  
try the defaultimap attached, for more debug  
Comment by camel camel at 2010/06/08 12:11:  
any idea, how to implement a DEBUG line, so that i can see what it was sending to apache in detail, so that we can check whats wrong ?  
\>May 27 22:28:21 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: \>defaultimap::getQuotaByUserNO, Invalid mailbox name  
Comment by camel camel at 2010/06/02 13:32:  
\>no news about the quota, as it works for me.  
\>Your log tells you:  
\>May 27 22:28:21 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: \>defaultimap::getQuotaByUserNO, Invalid mailbox name  
\>so check $mailboxName in class.defaultimap.inc.php  
\>there is a quoted error\_log just in front of the call of \>getStorageQuota  
\>the function to look in is: getQuotaByUser  
well, can’t find, that anything is wrong …  
i have no idea, what i can implement to see more details in log …maybe you know what i can insert there to get more detail ?

\>Together with:  
\>May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: \>defaultimap::openConnectionNo username \>supplied.defaultimap-\>openConnection:503 / \>defaultimap-\>getUserData:457 / emailadmin\_bo-\>getUserData:601 / \>uiuserdata-\>editUserData:80  
\>May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: \>defaultimap::getQuotaByUserBAD, Please login first  
\>I seems you have no (admin) connection. -\> No username supplied  
\>thus login fails (BAD, Please login first) , thus everything \>else fails.  
well, if this would be true, how is it possible that i get all settings for this user (i can see the value of quota, forward email, aliases, etc…) ?  
is it not true, if the user wouldn’t exist, that i wouldn’t get any data (so the reading the settings is working) ?

\>As 22:28 is 9 minutes past 22:19 you seem to be a bit further \>down the line; at least you have a connection at 22:28. The \>mailboxName construnction as done in getUserMailboxString is \>depending on the IMAP Login type; as you had Problems with \>postgres and updating-\> check the values for IMAP login type.  
where can i check the postgres values for the related values ? which tables ?

Comment by Klaus Leithoff at 2010/06/02 11:25:  
no news about the quota, as it works for me.  
Your log tells you:  
May 27 22:28:21 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::getQuotaByUserNO, Invalid mailbox name  
so check $mailboxName in class.defaultimap.inc.php  
there is a quoted error\_log just in front of the call of getStorageQuota  
the function to look in is: getQuotaByUser

Together with:  
May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::openConnectionNo username supplied.defaultimap-\>openConnection:503 / defaultimap-\>getUserData:457 / emailadmin\_bo-\>getUserData:601 / uiuserdata-\>editUserData:80  
May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::getQuotaByUserBAD, Please login first

I seems you have no (admin) connection. -\> No username supplied  
thus login fails (BAD, Please login first) , thus everything else fails.

As 22:28 is 9 minutes past 22:19 you seem to be a bit further down the line; at least you have a connection at 22:28. The mailboxName construnction as done in getUserMailboxString is depending on the IMAP Login type; as you had Problems with postgres and updating-\> check the values for IMAP login type.  
Comment by camel camel at 2010/06/02 01:15:  
any news about the quota problem ?  
Comment by camel camel at 2010/05/28 09:58:  
additional info:  
i created (~1month ago) an account inclusive quota -\> set this user to 100MB, and if i go to this user, i can see the quota of 100MB (so reading the info is OK), BUT - can’T change the quota …

Comment by camel camel at 2010/05/28 09:42:  
well, i’m using cyrus imap server + postfix(dbmail).  
and it WAS WORKING on older trunk (~1month ago)

and no it doesn’t work anymore …  
(and i haven’T changed anything on mailserver system or ldap.

any idea where the problem could be ?  
Comment by Klaus Leithoff at 2010/05/28 09:20:  
setting the quota is done via IMAP. You need to login as ldapadmin to set the quota.  
the logindata to do that are stored with the imap part of the emailadmin profile and  
are only available for the cyrus imap server (as far as I know).  
so the files to look in are class.cyrusimap.inc.php and class.defaultimap.inc.php  
(function setUserData in cyrusimap)

But I think this is related to the (your) configuration, as we use that in a multidomain enviroment too, and it is working for us/our enviroment (cyrus + postfix (qmail)).  
So either you have lost the setting for the defaultdomain (your comment from 2010/05/27 22:29) or you lost the credentials for imap (your comment from 2010/05/27 22:23)  
or both.  
Comment by camel camel at 2010/05/27 22:29:  
another test on another domain(i have multiple domains in header…)

show me:

==\> /var/log/NOT\_SORTED\_DEVLOG/notice.log \<==  
May 27 22:28:21 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::getQuotaByUserNO, Invalid mailbox name

so, something with the quota seems to be also changed …  
Comment by camel camel at 2010/05/27 22:23:  
for the QUOTA stuff … found another thing in the log.  
if i go to: admin -\> user -\> select an user -\> click on "E-Mail Account"  
and look to log in apache2 …

May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::openConnectionNo username supplied.defaultimap-\>openConnection:503 / defaultimap-\>getUserData:457 / emailadmin\_bo-\>getUserData:601 / uiuserdata-\>editUserData:80  
May 27 22:19:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: defaultimap::getQuotaByUserBAD, Please login first

maybe this helps to find the quota issue …  
Comment by camel camel at 2010/05/27 18:34:  
small issue…  
rights …

very funny is, that all files are rights 644 - and only 2 files in emailadmin are having right 755 ??

\*class.dbmailqmailuser.inc.php 5371¦Mai 27 13:07  
\*class.postfixdbmailuser.inc.php 2408¦Mai 27 18:28

Comment by camel camel at 2010/05/27 18:31:  
with trunk 30413 it is working again 🙂  
tried all options - all options are working aina - excluded the quota …

thanks now 95% is solved

so, what’s about the quota - any idea why this is not working ?  
(it was working - tested + used in last trunk ~2month ago …  
Comment by Klaus Leithoff at 2010/05/27 18:21:  
please try with my commit in trunk.  
it is slightly different, but should do the same.  
i am not quite sure if we should use  
const MAILBOX\_ATTR=‘dbmailuid’;  
instead of false.  
It seems to be the location which is used to set the identifier for the mailbox  
(e.g.: plesk and qmail are using mailmessagestore here)

Comment by camel camel at 2010/05/27 17:42:  
is working with your files (well the quota seems to be not working, but no error any more …)

so if you can add this to trunk in anykind it would be better 🙂

then the quota is the last part, which is not working …  
(but also not working with my last version)  
maybe there is another bug ?

but all other modifications are seems to be working AGAIN 🙂  
Comment by Klaus Leithoff at 2010/05/27 17:28:  
try the files with the zip archive  
Comment by camel camel at 2010/05/27 16:43:  
if you can edit your ideas to thespecific file and attach it, then i can try this mod …  
Comment by Klaus Leithoff at 2010/05/27 16:29:  
actually:  
there is the reading of the data where we attempt to read deliveryprogrammpath  
(around line 250 in emailadmin\_smtp\_ldap)  
When the data that are read and those to be written are merged that could be causing the issue.  
Comment by camel camel at 2010/05/27 16:04:  
any ideas ?  
maybe we can add extra log line to php code, so that we can see what exact will be send via ldap\_mod\_replace() … ?  
Comment by camel camel at 2010/05/27 16:03:  
any ideas ?  
maybe we can add extra log line to php code, so thA  
Comment by Klaus Leithoff at 2010/05/27 15:22:  
quite sure it should be  
const MAILBOX\_ATTR = false;

but this does not explain, why the deliveryprogrampath is that persistent  
Comment by camel camel at 2010/05/27 14:13:  
tried it with restart …

set in file:  
class.postfixdbmailuser.inc.php [----] 0 L:[41+19 60/ 86] \*(1636/2328b) 0009 0x009

- Attribute for mailbox, to which mail gets delivered OR false if not supported  
\*/  
const MAILBOX\_ATTR = ‘false’; ##################################  
the same …this parameter is not deactivated only with false …  
then log from ldap + apache2

May 27 14:07:09 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: PHP Warning: ldap\_mod\_replace() [\<a href="function.ldap-mod-replace"\>function.ldap-mod-replace\</a\>]: Modify: Undefined attribute type in /var/www/egroupware\_TRUNK/htdocs/egroupware/emailadmin/inc/class.emailadmin\_smtp\_ldap.inc.php on line 352

slapd[14898]: \<= acl\_mask: [1] applying write(=wrscxd) (stop)  
slapd[14898]: \<= acl\_mask: [1] mask: write(=wrscxd)  
slapd[14898]: =\> slap\_access\_allowed: read access granted by write(=wrscxd)  
slapd[14898]: =\> access\_allowed: read access granted by write(=wrscxd)  
slapd[14898]: conn=128663 op=1 ENTRY dn="uid=ets\_mobil,ou=accounts,[ou=mydomain.com](http://ou=mydomain.com),dc=mydomain,dc=com"  
slapd[14898]: \<= send\_search\_entry: conn 128663 exit.  
slapd[14898]: send\_ldap\_result: conn=128663 op=1 p=3  
slapd[14898]: send\_ldap\_result: err=0 matched="" text=""  
slapd[14898]: send\_ldap\_response: msgid=2 tag=101 err=0  
slapd[14898]: conn=128663 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=  
slapd[14898]: daemon: activity on 1 descriptor  
slapd[14898]: daemon: activity on:  
slapd[14898]: 35r  
slapd[14898]:  
slapd[14898]: daemon: read active on 35  
slapd[14898]: connection\_get(35)  
slapd[14898]: connection\_get(35): got connid=128663  
slapd[14898]: connection\_read(35): checking for input on id=128663  
slapd[14898]: daemon: epoll: listen=7 active\_threads=0 tvp=zero  
slapd[14898]: daemon: epoll: listen=8 active\_threads=0 tvp=zero  
slapd[14898]: daemon: epoll: listen=9 active\_threads=0 tvp=zero  
slapd[14898]: do\_modify  
slapd[14898]: do\_modify: dn (uid=ets\_mobil,ou=accounts,[ou=mydomain.com](http://ou=mydomain.com),dc=mydomain,dc=com)  
slapd[14898]: \>\>\> dnPrettyNormal:  
slapd[14898]: \<\<\< dnPrettyNormal: ,  
slapd[14898]: send\_ldap\_result: conn=128663 op=2 p=3  
slapd[14898]: send\_ldap\_result: err=17 matched="" text="deliveryprogrampath: attribute type undefined"  
slapd[14898]: send\_ldap\_response: msgid=3 tag=103 err=17  
slapd[14898]: conn=128663 op=2 RESULT tag=103 err=17 text=deliveryprogrampath: attribute type undefined  
slapd[14898]: daemon: activity on 1 descriptor  
slapd[14898]: daemon: activity on:  
slapd[14898]: 35r  
slapd[14898]:

Comment by camel camel at 2010/05/27 14:05:  
sure …

i will try to restart the server also and test again.

any idea, that we can include a log part, so that we can see the whole ldap command which is sending ?  
Comment by Klaus Leithoff at 2010/05/27 14:02:  
its defentitely an issue with  
const MAILBOX\_ATTR = ‘deliveryprogrampath’;  
setting this MAILBOX\_ATTR to false, should disable that.

Since you have tried that … hmmm.

did you clear cleared cache and cookies ?

Comment by camel camel at 2010/05/27 13:45:  
i tried it again with the old file from 15.04.2010, with the old file it was working and in ldap log there is no undefined attribute.

so, maybe it have something to do with this:  
const MAILBOX\_ATTR = ‘deliveryprogrampath’;

which i haven’T found in old version.

attached the old: class.postfixdbmailuser.inc.php

maybe it helps …

Comment by camel camel at 2010/05/27 13:34:  
and i also checked the ldap:

May 27 13:30:46 [s\_devlog@db1.rocam.com](mailto:s_devlog@db1.rocam.com) slapd[14898]: send\_ldap\_result: err=17 matched="" text="deliveryprogrampath: attribute type undefined"  
May 27 13:30:46 [s\_devlog@db1.rocam.com](mailto:s_devlog@db1.rocam.com) slapd[14898]: send\_ldap\_response: msgid=3 tag=103 err=17  
May 27 13:30:46 [s\_devlog@db1.rocam.com](mailto:s_devlog@db1.rocam.com) slapd[14898]: conn=128537 op=2 RESULT tag=103 err=17 text=deliveryprogrampath: attribute type undefined  
May 27 13:30:46 [s\_devlog@db1.rocam.com](mailto:s_devlog@db1.rocam.com) slapd[14898]: daemon: activity on 1 descriptor  
May 27 13:30:46 [s\_devlog@db1.rocam.com](mailto:s_devlog@db1.rocam.com) slapd[14898]: daemon: activity on:

so the message is still here …  
Comment by camel camel at 2010/05/27 13:19:  
i downloaded again a complete fresh trunk 30401.

tried both ideas…

not working, getting always:  
==\> /var/log/NOT\_SORTED\_DEVLOG/notice.log \<==  
May 27 13:17:03 [s\_devlog@web1.xxx.com](mailto:s_devlog@web1.xxx.com) apache2: PHP Warning: ldap\_mod\_replace() [\<a href="function.ldap-mod-replace"\>function.ldap-mod-replace\</a\>]: Modify: Undefined attribute type in /var/www/egroupware\_TRUNK/htdocs/egroupware/emailadmin/inc/class.emailadmin\_smtp\_ldap.inc.php on line 352

not sure, if there is the problem, because get always the same error.  
Comment by Klaus Leithoff at 2010/05/27 11:24:  
first step:  
try using dbmailuser instead of deliveryprogrammpath  
replace  
const MAILBOX\_ATTR = ‘deliveryprogrampath’;  
with  
const MAILBOX\_ATTR = ‘dbmailuser’;

in the NEW class.postfixdbmailuser.inc.php

If this does not work  
replace  
const MAILBOX\_ATTR = ‘dbmailuser’;  
with  
const MAILBOX\_ATTR = ‘false’;

please report if it is working (and if, which version) .  
Comment by Klaus Leithoff at 2010/05/27 10:54:  
slapd[14898]: send\_ldap\_result: err=17 matched="" text="deliveryprogrampath: attribute type undefined"  
slapd[14898]: send\_ldap\_response: msgid=3 tag=103 err=17  
slapd[14898]: conn=33 op=2 RESULT tag=103 err=17 text=deliveryprogrampath: attribute type undefined  
slapd[14898]: daemon: activity on 1 descriptor

So the deliveryprogrampath is not the attribute that is valid.

Comment by camel camel at 2010/05/26 17:11:  
is it correct the last TRUNK version from this file was on:  
│\*class.postfixdbmailuser.inc.php │ 2342│Apr 23 08:53

Comment by camel camel at 2010/05/26 17:08:  
ok, added…

- tried to use the old file from:  
class.postfixdbmailuser.inc.php│ 7077│Apr 15 2009  
(don’t know the trunk numerb of this file.

then it is working for EDITING the ALIASES.  
(only the quota doesn’T work with this old version …)

web1 inc # cat class.postfixdbmailuser.inc.php  
\<?php  
/  
_**\* EGroupWare - EMailAdmin \*  
\* [http://www.egroupware.org](http://www.egroupware.org) \*  
\* Written by : Lars Kneschke [lkneschke@linux-at-work.de] \*  
\* ------------------------------------------------- \*  
\* This program is free software; you can redistribute it and/or modify it \*  
\* under the terms of the GNU General Public License as published by the \*  
\* Free Software Foundation; either version 2 of the License, or (at your \*  
\* option) any later version. \*  
\***/  
/_ $Id: class.postfixldap.inc.php 22439 2006-09-16 09:19:43Z ralfbecker $ \*/

```
    include_once(EGW_SERVER_ROOT.&quot;/emailadmin/inc/class.defaultsmtp.inc.php&quot;);

    class postfixdbmailuser extends defaultsmtp
    {
            function addAccount($_hookValues)
            {
                    $mailLocalAddress = $_hookValues['account_email'] ? $_hookValues['account_email'] :
                            $GLOBALS['egw']-&gt;common-&gt;email_address($_hookValues['account_firstname'],
                                    $_hookValues['account_lastname'],$_hookValues['account_lid'],$this-&gt;defaultDomain);

                    $ds = $GLOBALS['egw']-&gt;common-&gt;ldapConnect();

                    $filter = &quot;uid=&quot;.$_hookValues['account_lid'];

                    $sri = @ldap_search($ds,$GLOBALS['egw_info']['server']['ldap_context'],$filter);
                    if ($sri)
                    {
                            $allValues = ldap_get_entries($ds, $sri);
                            $accountDN = $allValues[0]['dn'];
                            $objectClasses = $allValues[0]['objectclass'];

                            unset($objectClasses['count']);
                    }
                    else
                    {
                            return false;
                    }

                    if(!in_array('dbmailUser',$objectClasses) &amp;amp;&amp;amp;
                            !in_array('dbmailuser',$objectClasses))
                    {
                            $objectClasses[] = 'dbmailuser';
                    }

                    // the new code for postfix+cyrus+ldap
                    $newData = array
                    (
                            'mail' =&gt; $mailLocalAddress,
                            'accountStatus' =&gt; 'active',
                            'objectclass' =&gt; $objectClasses
                    );

                    ldap_mod_replace ($ds, $accountDN, $newData);
                    #print ldap_error($ds);
            }

            function getAccountEmailAddress($_accountName)
            {
                    $emailAddresses = array();
                    $ds = $GLOBALS['egw']-&gt;common-&gt;ldapConnect();
                    $filter = sprintf(&quot;(&amp;amp;(uid=%s)(objectclass=posixAccount))&quot;,$_accountName);
                    $attributes = array('dn','mail','mailAlternateAddress');
                    $sri = @ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $attributes);

                    if ($sri)
                    {
                            $realName = trim($GLOBALS['egw_info']['user']['firstname'] . (!empty($GLOBALS['egw_info']['user']['firstname']) ? ' ' : '') . $GLOBALS['egw_info']['user']['lastname']);
                            $allValues = ldap_get_entries($ds, $sri);
                            if(isset($allValues[0]['mail'][0]))
                            {
                                    $emailAddresses[] = array
                                    (
                                            'name' =&gt; $realName,
                                            'address' =&gt; $allValues[0]['mail'][0],
                                            'type' =&gt; 'default'
                                    );
                            }
                            if($allValues[0]['mailalternateaddress']['count'] &gt; 0)
                            {
                                    $count = $allValues[0]['mailalternateaddress']['count'];
                                    for($i=0; $i &lt; $count; $i++)
                                    {
                                            $emailAddresses[] = array
                                            (
                                                    'name' =&gt; $realName,
                                                    'address' =&gt; $allValues[0]['mailalternateaddress'][$i],
                                                    'type' =&gt; 'alternate'
                                            );
                                    }
                            }
                    }

                    return $emailAddresses;
            }

            function getUserData($_uidnumber) {
                    $userData = array();

                    $ldap = $GLOBALS['egw']-&gt;common-&gt;ldapConnect();

                    if (($sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],&quot;(uidnumber=$_uidnumber)&quot;)))
                    {
                            $allValues = ldap_get_entries($ldap, $sri);
                            if ($allValues['count'] &gt; 0)
                            {
                                    #print &quot;found something&lt;br /&gt;&quot;;
                                    $userData[&quot;mailLocalAddress&quot;] = $allValues[0][&quot;mail&quot;][0];
                                    $userData[&quot;mailAlternateAddress&quot;] = $allValues[0][&quot;mailalternateaddress&quot;];
                                    $userData[&quot;accountStatus&quot;] = $allValues[0][&quot;accountstatus&quot;][0];
                                    $userData[&quot;mailForwardingAddress&quot;] = $allValues[0][&quot;mailforwardingaddress&quot;];
                                    $userData[&quot;deliveryProgramPath&quot;] = $allValues[0][&quot;deliveryprogrampath&quot;][0];
                                    $userData[&quot;deliveryMode&quot;] = $allValues[0][&quot;deliverymode&quot;][0];

                                    unset($userData[&quot;mailAlternateAddress&quot;][&quot;count&quot;]);
                                    unset($userData[&quot;mailForwardingAddress&quot;][&quot;count&quot;]);

                                    return $userData;
                            }
                    }

                    return $userData;
            }

            function setUserData($_uidnumber, $_mailAlternateAddress, $_mailForwardingAddress, $_deliveryMode, $_accountStatus, $_mailLocalAddress) {
                    $filter = &quot;uidnumber=$_uidnumber&quot;;

                    $ldap = $GLOBALS['egw']-&gt;common-&gt;ldapConnect();

                    $sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],$filter);
                    if ($sri) {
                            $allValues = ldap_get_entries($ldap, $sri);

                            $accountDN = $allValues[0]['dn'];
                            $uid = $allValues[0]['uid'][0];
                            $objectClasses = $allValues[0]['objectclass'];

                            unset($objectClasses['count']);

                            if(!in_array('dbmailUser',$objectClasses) &amp;amp;&amp;amp;
                                    !in_array('dbmailuser',$objectClasses))
                            {
                                    $objectClasses[] = 'dbmailuser';
                                    sort($objectClasses);
                                    $newData['objectclass'] = $objectClasses;
                            }

                            sort($_mailAlternateAddress);
                            sort($_mailForwardingAddress);

                            $newData['mailalternateaddress'] = (array)$_mailAlternateAddress;
                            $newData['mailforwardingaddress'] = (array)$_mailForwardingAddress;
                            $newData['deliverymode'] = $_deliveryMode ? 'forwardOnly' : array();
                            $newData['accountstatus'] = $_accountStatus ? 'active' : array();
                            $newData['mail'] = $_mailLocalAddress;

                            ldap_mod_replace($ldap, $accountDN, $newData);
                    }
                    else
                    {
                            return false;
                    }

            }

            function saveSMTPForwarding($_accountID, $_forwardingAddress, $_keepLocalCopy)
            {
                    $ds = $GLOBALS['egw']-&gt;common-&gt;ldapConnect();
                    $filter = sprintf(&quot;(&amp;amp;(uidnumber=%s)(objectclass=posixAccount))&quot;,$_accountID);
                    $attributes = array('dn','mailforwardingaddress','deliverymode','objectclass');
                    $sri = ldap_search($ds, $GLOBALS['egw_info']['server']['ldap_context'], $filter, $attributes);

                    if ($sri)
                    {
                            $newData = array();
                            $allValues = ldap_get_entries($ds, $sri);

                            $newData['objectclass'] = $allValues[0]['objectclass'];

                            unset($newData['objectclass']['count']);

                            if(!in_array('dbmailUser',$newData['objectclass']) &amp;amp;&amp;amp;
                                    !in_array('dbmailuser',$newData['objectclass']))
                            {
                                    $newData['objectclass'][] = 'dbmailuser';
                            }

                            if(!empty($_forwardingAddress))
                            {
                                    if(is_array($allValues[0]['mailforwardingaddress']))
                                    {
                                            $newData['mailforwardingaddress'] = $allValues[0]['mailforwardingaddress'];
                                            unset($newData['mailforwardingaddress']['count']);
                                            $newData['mailforwardingaddress'][0] = $_forwardingAddress;
                                    }
                                    else
                                    {
                                            $newData['mailforwardingaddress'][0] = $_forwardingAddress;
                                    }
                                    $newData['deliverymode'] = ($_keepLocalCopy == 'yes'? array() : 'forwardOnly');
                            }
                            else
                            {
                                    $newData['mailforwardingaddress'] = array();
                                    $newData['deliverymode'] = array();
                            }

                            ldap_modify ($ds, $allValues[0]['dn'], $newData);
                            #print ldap_error($ds);
                    }
            }
    }

```

?\>  
web1 inc #

Comment by Klaus Leithoff at 2010/05/26 17:04:  
no file attached.  
Comment by camel camel at 2010/05/26 17:00:  
attached the full log(maybe a littel bit too much detail…)  
my domain name i replaced with: _mydomain_ -\> only the part when i click SAVE (and had removed an ALIASvfrom user: _ets\_mobil_  
Comment by Klaus Leithoff at 2010/05/26 17:00:  
and try to switch on the debug in class.postfixdbmailuser.inc.php

you may as well try to switch back to the old class.postfixdbmailuser.inc.php  
(which is not extending the class.emailadmin\_smtp\_ldap.inc.php)

the object class should include dbmailuser  
the fields set should be  
$newData[‘mailalternateaddress’] = (array)$\_mailAlternateAddress;  
$newData[‘mailforwardingaddress’] = (array)$\_mailForwardingAddress;  
$newData[‘deliverymode’] = $\_deliveryMode ? ‘forwardOnly’ : array();  
$newData[‘accountstatus’] = $\_accountStatus ? ‘active’ : array();  
$newData[‘mail’] = $\_mailLocalAddress;

Comment by Klaus Leithoff at 2010/05/26 16:39:  
try to raise the loglevel in open ldap to find out which attribute is crashing  
Comment by camel camel at 2010/05/26 16:25:  
wau, that sounds not good, because i’m testing on my life system, and can’t switch very easy back to old db …  
hopefully this can be fixed very quick ☹  
Comment by Klaus Leithoff at 2010/05/26 15:37:  
no, the schemas did not change but the keys which are stored in egw\_emailadmin with ea\_smtp\_type and ea\_imap\_type.  
The keys are no longer numeric but are equal to the smtp/imap classname of the  
SMTPServerTypes / IMAPServerTypes arrays in emailadmin\_bo.

Since we use a cyrus with ldap integration and a postfix(qmail) scheme, and we are able to  
change aliasses and quota and such.

Hmmm new Bug-\> possible  
The new class uses just inetOrgPerson schema to store primary mail address and aliases

I will introduce Ralf to the ticket.  
Comment by camel camel at 2010/05/26 15:18:  
any idea ?  
or can i raise a log level ?

also i verified /emailadmin/inc/class.postfixdbmailuser.inc.php  
but not sure, how it works in older trunk version …  
Comment by camel camel at 2010/05/26 14:22:  
now i also tried all other options there.  
and it does only show the correct old values on email accounts, if i use the:  
1.) IMAP -\> Cyrus IMAP Server + admin username + password  
2.) SMTP -\> POSTFIX (schema dbmail)

only editing doesn’t work.  
Comment by camel camel at 2010/05/26 14:18:  
no, it is exact the same as before

SMTP: postfix dbmail schema, so it was always set …

in theory - i can got back to an old TRUNK version and must restore old data and i can try it there …but with this configutration it was always working.

or are the schema files changes in new TRUNK ?

the file /var/www/egroupware\_TRUNK/htdocs/egroupware/emailadmin/inc/class.emailadmin\_smtp\_ldap.inc.php  
is new - and it wasn’t exist in old TRUNK (23.03.2010)  
maybe a new bug ?  
Comment by Klaus Leithoff at 2010/05/26 14:08:  
can you verify that the settings for the emailadminprofile in question are correct?  
It seems that it is using the wrong scheme for ldap

Linked entries:  
[http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker\_ui.edit&tr\_id=2623&no\_popup=1](http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2623&no_popup=1)
