From: <tr...@eg...> - 2010-05-28 07:20:43
|
Ticket modified by Klaus Leithoff at 2010/05/28 09:20 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_d...@we... 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/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_d...@we... 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_d...@we... apache2: defaultimap::openConnectionNo username supplied.defaultimap->openConnection:503 / defaultimap->getUserData:457 / emailadmin_bo->getUserData:601 / uiuserdata->editUserData:80 May 27 22:19:09 s_d...@we... 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_d...@we... 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,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,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_d...@db... slapd[14898]: send_ldap_result: err=17 matched="" text="deliveryprogrampath: attribute type undefined" May 27 13:30:46 s_d...@db... slapd[14898]: send_ldap_response: msgid=3 tag=103 err=17 May 27 13:30:46 s_d...@db... slapd[14898]: conn=128537 op=2 RESULT tag=103 err=17 text=deliveryprogrampath: attribute type undefined May 27 13:30:46 s_d...@db... slapd[14898]: daemon: activity on 1 descriptor May 27 13:30:46 s_d...@db... 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_d...@we... 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 * * Written by : Lars Kneschke [lkn...@li...] * * ------------------------------------------------- * * 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."/emailadmin/inc/class.defaultsmtp.inc.php"); class postfixdbmailuser extends defaultsmtp { function addAccount($_hookValues) { $mailLocalAddress = $_hookValues['account_email'] ? $_hookValues['account_email'] : $GLOBALS['egw']->common->email_address($_hookValues['account_firstname'], $_hookValues['account_lastname'],$_hookValues['account_lid'],$this->defaultDomain); $ds = $GLOBALS['egw']->common->ldapConnect(); $filter = "uid=".$_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; !in_array('dbmailuser',$objectClasses)) { $objectClasses[] = 'dbmailuser'; } // the new code for postfix+cyrus+ldap $newData = array ( 'mail' => $mailLocalAddress, 'accountStatus' => 'active', 'objectclass' => $objectClasses ); ldap_mod_replace ($ds, $accountDN, $newData); #print ldap_error($ds); } function getAccountEmailAddress($_accountName) { $emailAddresses = array(); $ds = $GLOBALS['egw']->common->ldapConnect(); $filter = sprintf("(&amp;(uid=%s)(objectclass=posixAccount))",$_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' => $realName, 'address' => $allValues[0]['mail'][0], 'type' => 'default' ); } if($allValues[0]['mailalternateaddress']['count'] > 0) { $count = $allValues[0]['mailalternateaddress']['count']; for($i=0; $i < $count; $i++) { $emailAddresses[] = array ( 'name' => $realName, 'address' => $allValues[0]['mailalternateaddress'][$i], 'type' => 'alternate' ); } } } return $emailAddresses; } function getUserData($_uidnumber) { $userData = array(); $ldap = $GLOBALS['egw']->common->ldapConnect(); if (($sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],"(uidnumber=$_uidnumber)"))) { $allValues = ldap_get_entries($ldap, $sri); if ($allValues['count'] > 0) { #print "found something<br />"; $userData["mailLocalAddress"] = $allValues[0]["mail"][0]; $userData["mailAlternateAddress"] = $allValues[0]["mailalternateaddress"]; $userData["accountStatus"] = $allValues[0]["accountstatus"][0]; $userData["mailForwardingAddress"] = $allValues[0]["mailforwardingaddress"]; $userData["deliveryProgramPath"] = $allValues[0]["deliveryprogrampath"][0]; $userData["deliveryMode"] = $allValues[0]["deliverymode"][0]; unset($userData["mailAlternateAddress"]["count"]); unset($userData["mailForwardingAddress"]["count"]); return $userData; } } return $userData; } function setUserData($_uidnumber, $_mailAlternateAddress, $_mailForwardingAddress, $_deliveryMode, $_accountStatus, $_mailLocalAddress) { $filter = "uidnumber=$_uidnumber"; $ldap = $GLOBALS['egw']->common->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; !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']->common->ldapConnect(); $filter = sprintf("(&amp;(uidnumber=%s)(objectclass=posixAccount))",$_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; !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 |