Index: /sandbox/2.5.1-evolucao/news_admin/inc/class.uinews.inc.php
===================================================================
--- /sandbox/2.5.1-evolucao/news_admin/inc/class.uinews.inc.php	(revision 5329)
+++ /sandbox/2.5.1-evolucao/news_admin/inc/class.uinews.inc.php	(revision 8265)
@@ -443,5 +443,5 @@
 			<script type="text/javascript"> CKEDITOR.replace( \'news[content]\',{
 			removePlugins : \'elementspath\',
-			skin : \'office2003\',
+			skin : \'moono_blue\',
 			toolbar : [["Source","Preview","-","Cut","Copy","Paste","-","Print",
 			"Undo","Redo","-","Find","Replace","-","SelectAll" ],
Index: /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/master.cf
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/master.cf	(revision 5797)
+++ /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/master.cf	(revision 8265)
@@ -75,2 +75,6 @@
   ${nexthop} ${user}
 
+# Script para controle de envio nas listas de discussÃ£o
+scl  unix    -       n       n       -       0       spawn
+        user=nobody argv=/usr/bin/perl /etc/postfix/scl.pl
+
Index: /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/main.cf
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/main.cf	(revision 8137)
+++ /sandbox/2.5.1-evolucao/INSTALL/debian/squeeze/etc/postfix/main.cf	(revision 8265)
@@ -108,5 +108,5 @@
 cra_maillists_chase_referral = 0
 cra_maillists_search_base = $ldapbase
-cra_maillists_query_filter = (&(mail=%s)(phpgwAccountType=l)(accountRestrictive=mailListRestriction))
+cra_maillists_query_filter = (&(|(mail=%s)(mailAlternateAddress=%s))(phpgwAccountType=l)(accountRestrictive=mailListRestriction))
 cra_maillists_result_attribute = accountRestrictive
 cra_maillists_domain = hash:/etc/postfix/expresso-dominios
@@ -166,6 +166,4 @@
 #SCL - Sender Control List - Restricoes para envio nas listas
 smtpd_restriction_classes = mailListRestriction
-mailListRestriction = check_sender_access ldap:csa_maillists,
-			reject
+mailListRestriction = check_policy_service unix:private/scl
 
-
Index: /sandbox/2.5.1-evolucao/INSTALL/arquivos/expresso-cron
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/arquivos/expresso-cron	(revision 8137)
+++ /sandbox/2.5.1-evolucao/INSTALL/arquivos/expresso-cron	(revision 8265)
@@ -5,23 +5,26 @@
 
 # Utilizado para verificar se ha algum alarme, por e-mail, do modulo ExpressoCalendar
-#CENTOS*/1 * 	* * *	apache	 php	EXPRESSO_DIR/prototype/modules/calendar/alarms.php 1>& /dev/null
-#DEBIAN*/1 * 	* * *	www-data php5	EXPRESSO_DIR/prototype/modules/calendar/alarms.php 1>& /dev/null
+#CENTOS*/1 * 	* * *	apache      php	 EXPRESSO_DIR/prototype/modules/calendar/alarms.php 1>& /dev/null
+#DEBIAN*/1 * 	* * *	www-data    php5 EXPRESSO_DIR/prototype/modules/calendar/alarms.php 1>& /dev/null
 
 # Utilizado para limpar a tabela, temporaria, que contem os e-mails (rascunhos) antes de
 #  serem salvos no IMAP.
-#CENTOS00 02 	* * *	apache		php	EXPRESSO_DIR/prototype/modules/mail/cleanMailAttachments.php 
-#DEBIAN00 02 	* * *	www-data	php5	EXPRESSO_DIR/prototype/modules/mail/cleanMailAttachments.php 
+#CENTOS00 02 	* * *	apache		php	 EXPRESSO_DIR/prototype/modules/mail/cleanMailAttachments.php 
+#DEBIAN00 02 	* * *	www-data	php5 EXPRESSO_DIR/prototype/modules/mail/cleanMailAttachments.php 
 
 # Utilizado para limpar a tabela de registros de acesso, sessoes, do Expresso (phpgw_access_log)
-#CENTOS00 22 	* * *	apache		php	EXPRESSO_DIR/phpgwapi/cron/clean_phpgw_tables.php
-#DEBIAN00 22 	* * *	www-data	php5	EXPRESSO_DIR/phpgwapi/cron/clean_phpgw_tables.php
+#CENTOS00 22 	* * *	apache		php	 EXPRESSO_DIR/phpgwapi/cron/clean_phpgw_tables.php
+#DEBIAN00 22 	* * *	www-data	php5 EXPRESSO_DIR/phpgwapi/cron/clean_phpgw_tables.php
 
 # Utilizado para limpar os arquivos de sessao do PHP
-#*/31 *  * * *   root                    find /dev/shm -type f -name "sess_*" -cmin 240 -print0 | xargs -n 200 -r -0 rm
-*/31 *  * * *   root                    find /dev/shm -type f -name "sess_*" -cmin +240 -delete
+#*/31 *         * * *   root        find /dev/shm -type f -name "sess_*" -cmin 240 -print0 | xargs -n 200 -r -0 rm
+*/31 *          * * *   root        find /dev/shm -type f -name "sess_*" -cmin +240 -delete
 
 # Utilizado para limpar os arquivos, eml, criados ao exportar mensagens
-#13 */4 * * * root			find /tmp/ -iname "*.eml" -amin +60 -exec rm -f '{}' \;
-13 */4 	* * * root			find /tmp/ -iname "*.eml" -cmin +60 -delete
+#13 */4         * * *   root		find /tmp/ -iname "*.eml" -amin +60 -exec rm -f '{}' \;
+13 */4 	        * * *   root		find /tmp/ -iname "*.eml" -cmin +60 -delete
+
+# Para o DSPAM
+#*/15 *         * * *   root        pidof dspam 1&> /dev/null ; [ $? -ne 0 ] && service dspam restart
 
 #
Index: /sandbox/2.5.1-evolucao/INSTALL/arquivos/scripts/smtp.sh
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/arquivos/scripts/smtp.sh	(revision 7503)
+++ /sandbox/2.5.1-evolucao/INSTALL/arquivos/scripts/smtp.sh	(revision 8265)
@@ -11,4 +11,6 @@
 	sed -e "s/DOMAIN/$DOMAIN/g" $DIR_POSTFIX/transport > /etc/postfix/transport
 	cp $DIR_POSTFIX/master.cf /etc/postfix/
+	sed -e "s/LDAP_DN/$LDAP_DN/g" $ARQS/scl.pl > /etc/postfix/scl.pl
+    chmod a+x /etc/postfix/scl.pl
 
 	postmap /etc/postfix/expresso-dominios
@@ -20,5 +22,5 @@
 smtp_rhel ()
 {
-	yum -y install postfix
+	yum -y install postfix perl-LDAP
 
 	smtp $1 
@@ -36,5 +38,5 @@
 smtp_debian ()
 {
-	apt-get -y install postfix postfix-ldap
+	apt-get -y install postfix postfix-ldap libnet-ldap-perl
 
 	smtp $1
Index: /sandbox/2.5.1-evolucao/INSTALL/arquivos/scl.pl
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/arquivos/scl.pl	(revision 8265)
+++ /sandbox/2.5.1-evolucao/INSTALL/arquivos/scl.pl	(revision 8265)
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# Versao 5, ldapS
+
+#use strict;
+use warnings;
+use Fcntl;
+#use Net::LDAP qw(:all);
+use Net::LDAP;
+use Sys::Syslog qw(:DEFAULT setlogsock);
+
+my $ldap_host = "127.0.0.1";
+my $base_dn = "LDAP_DN";
+
+#my $ldap_host = "ldaps://LDAP_SERVER:636";
+#my $base_dn = "BASE_DN";
+
+my $syslog_socktype = 'unix'; # inet, unix, stream, console
+my $syslog_facility="mail";
+my $syslog_options="pid";
+my $syslog_priority="info";
+
+setlogsock $syslog_socktype;
+openlog $0, $syslog_options, $syslog_facility;
+
+select((select(STDOUT), $| = 1)[0]);
+
+sub fatal_exit {
+    my($first) = shift(@_);
+    syslog "err", "fatal: $first", @_;
+    exit 1;
+}
+
+#
+# Receive a bunch of attributes, evaluate the policy, send the result.
+#
+while (<STDIN>) {
+
+	if (/([^=]+)=(.*)\n/) {
+		$attr{substr($1, 0, 512)} = substr($2, 0, 512);
+	}
+	elsif ($_ eq "\n")
+	{
+		#for (keys %attr) {
+		#	syslog $syslog_priority, "Attribute: %s=%s", $_, $attr{$_};
+		#}
+
+		fatal_exit "unrecognized request type: '%s'", $attr{request}
+			unless $attr{"request"} eq "smtpd_access_policy";
+
+
+		my $ldap = Net::LDAP->new($ldap_host, version => 3);
+        my $mesg = $ldap->bind ;    # an anonymous bind
+		#my $mesg = $ldap->bind ( 'cn=admin,dc=expresso,dc=com,dc=br', password=>'SENHA');
+	
+		my $filter = "(|(\&(mail=$attr{recipient})(mailSenderAddress=$attr{sender})(phpgwAccountType=l))(\&(mail=$attr{recipient})(participantCanSendMail=TRUE)(mailForwardingAddress=$attr{sender})(phpgwAccountType=l)))";
+		
+		my $search = $ldap->search(filter=>"$filter",
+					   base=>"$base_dn",
+					   attrs=> ['uid'] );
+
+		if ( $search->code ) 
+		{
+			syslog $syslog_priority, "Erro na conexao com ldap.";
+			print STDOUT "action=reject\n\n";
+			exit 0;
+		}
+
+		if ($search->count)
+		{
+			syslog $syslog_priority, "Lista Restrita: DUNNO: %s->%s", $attr{sender}, $attr{recipient}, $filter;
+			print STDOUT "action=DUNNO\n\n";
+		}
+		else
+		{
+			syslog $syslog_priority, "Lista Restrita: Denied: %s->%s", $attr{sender}, $attr{recipient}, $filter;
+			print STDOUT "action=reject\n\n";
+		}
+
+		%attr = ();
+		$ldap->disconnect();
+	}
+	else
+	{
+		chop;
+		syslog $syslog_priority, "warning: ignoring garbage: %.100s", $_;
+	}
+}
Index: /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/master.cf
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/master.cf	(revision 5797)
+++ /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/master.cf	(revision 8265)
@@ -78,2 +78,7 @@
 bsmtp     unix  -       n       n       -       -       pipe
   flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
+
+# Script para controle de envio nas listas de discussÃ£o
+scl  unix    -       n       n       -       0       spawn
+        user=nobody argv=/usr/bin/perl /etc/postfix/scl.pl
+
Index: /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/main.cf
===================================================================
--- /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/main.cf	(revision 8137)
+++ /sandbox/2.5.1-evolucao/INSTALL/rhel/6/etc/postfix/main.cf	(revision 8265)
@@ -166,6 +166,5 @@
 #SCL - Sender Control List - Restricoes para envio nas listas
 smtpd_restriction_classes = mailListRestriction
-mailListRestriction = check_sender_access ldap:csa_maillists,
-			reject
+mailListRestriction = check_policy_service unix:private/scl
 
 # LOCAL PATHNAME INFORMATION
Index: /sandbox/2.5.1-evolucao/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- /sandbox/2.5.1-evolucao/filemanager/inc/class.uifilemanager.inc.php	(revision 7681)
+++ /sandbox/2.5.1-evolucao/filemanager/inc/class.uifilemanager.inc.php	(revision 8265)
@@ -975,5 +975,5 @@
 						<script type="text/javascript"> CKEDITOR.replace( \'edit_file_content\',{
 removePlugins : \'elementspath\',
-skin : \'office2003\',
+skin : \'moono_blue\',
 toolbar : [["Source","Preview","-","Cut","Copy","Paste","-","Print",
 "Undo","Redo","-","Find","Replace","-","SelectAll" ],
Index: /sandbox/2.5.1-evolucao/expressoAdmin1_2/js/jscode/maillists.js
===================================================================
--- /sandbox/2.5.1-evolucao/expressoAdmin1_2/js/jscode/maillists.js	(revision 7752)
+++ /sandbox/2.5.1-evolucao/expressoAdmin1_2/js/jscode/maillists.js	(revision 8265)
@@ -281,6 +281,7 @@
 	if (new_options != '')
 	{
-		select_usersInMaillist.innerHTML = '#' + new_options + select_usersInMaillist.innerHTML;
-		select_usersInMaillist.outerHTML = select_usersInMaillist.outerHTML;
+		usersOptionsHtml = select_usersInMaillist.innerHTML;
+		usersOptionsHtml = (($.browser.msie && $.browser.version < 9) ? '#' : '&nbsp;') + new_options + usersOptionsHtml;
+		$(select_usersInMaillist).html(usersOptionsHtml);
 	}
 }
Index: /sandbox/2.5.1-evolucao/admin/inc/class.uimainscreen.inc.php
===================================================================
--- /sandbox/2.5.1-evolucao/admin/inc/class.uimainscreen.inc.php	(revision 7109)
+++ /sandbox/2.5.1-evolucao/admin/inc/class.uimainscreen.inc.php	(revision 8265)
@@ -151,5 +151,5 @@
 						'CKEDITOR.replace( \'message\',{'.
 						'removePlugins : \'elementspath\','.
-						'skin : \'office2003\','.
+						'skin : \'moono_blue\','.
 						'toolbar : \'Full\''.
 						'}'.
Index: /sandbox/2.5.1-evolucao/admin/inc/class.uiconfig.inc.php
===================================================================
--- /sandbox/2.5.1-evolucao/admin/inc/class.uiconfig.inc.php	(revision 8231)
+++ /sandbox/2.5.1-evolucao/admin/inc/class.uiconfig.inc.php	(revision 8265)
@@ -335,5 +335,5 @@
 							<script type="text/javascript"> CKEDITOR.replace( \'newsettings[agree_term]\',{
 								removePlugins : \'elementspath\',
-								skin : \'office2003\',
+								skin : \'moono_blue\',
 								toolbar : [["Source","Preview","-","Cut","Copy","Paste","-","Print",
 								"Undo","Redo","-","Find","Replace","-","SelectAll" ],
Index: /sandbox/2.5.1-evolucao/prototype/services/iCal.php
===================================================================
--- /sandbox/2.5.1-evolucao/prototype/services/iCal.php	(revision 7959)
+++ /sandbox/2.5.1-evolucao/prototype/services/iCal.php	(revision 8265)
@@ -495,7 +495,11 @@
 	    $isResponseDelegated = false;
 	    if ((isset($pv['delegatedFrom']) && $pv['delegatedFrom'] == 0) || !isset($pv['delegatedFrom']))  {
-		if ($pv['isOrganizer'] == 1)
-		    $vevent->setProperty('organizer', $pv['user']['mail'], array('CN' => $pv['user']['name']));
-		else {
+		if ($pv['isOrganizer'] == 1){
+			if($pv['user']['id'] == Config::me('uidNumber'))
+				$pv['user']['mail'] = $pv['user']['mailSenderAddress'];
+				//$pv['user']['mail'] = str_replace('@correiolivre.caixa','@caixa.gov.br',$pv['user']['mail']);                                   
+			
+			$vevent->setProperty('organizer', $pv['user']['mail'], array('CN' => $pv['user']['name']));
+		}else {
 		    $pParams = array();
 		    $pParams['CN'] = $pv['user']['name'];
@@ -618,4 +622,5 @@
                         if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']){ //Organizador esta requisitando que você atualize o evento
 
+
                             $params['calendar'] = $params['calendar'] == 'true' ? $calendar : $params['calendar'];
                             $interation = self::_makeVEVENT($schedulable, $component, $params);
@@ -642,5 +647,5 @@
                     $interation = self::_makeVEVENT(array(), $component, $params);
 
-                    if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora
+                       if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora
 
                         /* Data de Inicio */
@@ -693,4 +698,5 @@
 
 
+
                         if ($uid = $component->getProperty('uid', false, false))
                         ;
@@ -710,4 +716,6 @@
 
 
+
+
                         if ($property = $component->getProperty('organizer', FALSE, TRUE)) {
                         $participant = array();
@@ -733,4 +741,5 @@
                         $sc['participants'][] = $participant;
                         }
+
 
 
@@ -749,4 +758,5 @@
                         $sc['participants'][] = $participant;
                         $sc['type'] = EVENT_ID;
+
 
 
@@ -801,4 +811,5 @@
                             break;
                         }
+
                         require_once ROOTPATH . '/api/parseTPL.php';
 
@@ -1228,4 +1239,5 @@
                     foreach ($schedulable['participants'] as $value){
 
+
                         if ($value['user']['id'] == $params['owner']) {
                             $isParticipant = true;
@@ -1429,4 +1441,5 @@
 
 
+
 	return $offset;
     }
@@ -1457,4 +1470,5 @@
     }
 
+
     private function _getStatusTodo($id) {
         $a = array(
@@ -1467,4 +1481,5 @@
     return isset($a[$id]) ? $a[$id] : 'NEED_ACTION';
     }
+
 
     private static function _checkParticipantByPermissions($schedulable) {
@@ -1583,4 +1598,6 @@
 
     static private function _makeVEVENT($schedulable, $component, $params) {
+
+
     	$interation = array();
     	$eventID = isset($schedulable['id']) ? $schedulable['id'] : mt_rand() . '(Formatter)';
@@ -1641,4 +1658,5 @@
 
 
+
     	$schedulable['summary'] = mb_convert_encoding($component->getProperty('summary', false, false), 'ISO-8859-1', 'UTF-8,ISO-8859-1');
 
@@ -1650,4 +1668,5 @@
     	if ($location = $component->getProperty('location', false, false))
     	    $schedulable['location'] = mb_convert_encoding($location, 'ISO-8859-1', 'UTF-8,ISO-8859-1');
+
 
 
@@ -1694,9 +1713,8 @@
     	    $participant['schedulable'] = $eventID;
 
-    	    if (isset($params['status']) && $mailUser == Config::me('mail'))
+    	    if (isset($params['status']) &&  ltrim( substr( $mailUser, 0 , strpos( $mailUser, '@' ) ), '@' )  ==  ltrim( substr( Config::me('mail'), 0, strpos( Config::me('mail'), '@' ) ), '@' ))
     		$participant['status'] = $params['status'];
     	    else
     		$participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED;
-
 
     	    $participant['isOrganizer'] = '0';
@@ -1731,4 +1749,5 @@
 
 
+
             if($participant = self::_getParticipantByMail($mailUser, $schedulable['participants'], true)){
 
@@ -1748,6 +1767,7 @@
     	    /* Verifica se este usuario é um usuario interno do ldap */
     	    $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser))));
-    	    $user = null;
-    	    if ($intUser && count($intUser) > 0) {
+
+            $user = null;
+    	    if ($intUser && count($intUser) > 0 && $intUser[0]['id']) {
                 $participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0;
                 $participant['user'] = $intUser[0]['id'];
@@ -1942,4 +1962,5 @@
 	$schedulable['summary'] = mb_convert_encoding($component->getProperty('summary', false, false), 'ISO-8859-1', 'UTF-8,ISO-8859-1');
 
+
 	/* Definindo Description */
 	if ($desc = $component->getProperty('description', false, false))
@@ -2144,4 +2165,6 @@
 	$interation['schedulable://' . $todoID] = $schedulable;
 
+
+
     return $interation;
     }
@@ -2163,4 +2186,5 @@
 		foreach ($sig2 as $val)
 		    $calendars[] = $val['calendar'];
+
 
 
Index: /sandbox/2.5.1-evolucao/prototype/config/calendarSignature.ini
===================================================================
--- /sandbox/2.5.1-evolucao/prototype/config/calendarSignature.ini	(revision 7935)
+++ /sandbox/2.5.1-evolucao/prototype/config/calendarSignature.ini	(revision 8265)
@@ -16,8 +16,8 @@
 
 [before.read]
-calendarSignatureSecurity = modules/calendar/interceptors/DBMapping.php
+;calendarSignatureSecurity = modules/calendar/interceptors/DBMapping.php
 
 [before.find]
-calendarSignatureSecurity = modules/calendar/interceptors/DBMapping.php
+;calendarSignatureSecurity = modules/calendar/interceptors/DBMapping.php
 
 [after.read]
Index: /sandbox/2.5.1-evolucao/workflow/inc/smarty/wf_plugins/function.wf_fckeditor.php
===================================================================
--- /sandbox/2.5.1-evolucao/workflow/inc/smarty/wf_plugins/function.wf_fckeditor.php	(revision 5331)
+++ /sandbox/2.5.1-evolucao/workflow/inc/smarty/wf_plugins/function.wf_fckeditor.php	(revision 8265)
@@ -84,5 +84,5 @@
 				'CKEDITOR.replace( \''.$base_arguments['InstanceName'].'\',{'.
 					'removePlugins : \'elementspath\','.
-					'skin : \'office2003\','.
+					'skin : \'moono_blue\','.
 					'toolbar : \'Full\''.
 					'}'.
Index: /sandbox/2.5.1-evolucao/expressoMail1_2/js/common_functions.js
===================================================================
--- /sandbox/2.5.1-evolucao/expressoMail1_2/js/common_functions.js	(revision 8069)
+++ /sandbox/2.5.1-evolucao/expressoMail1_2/js/common_functions.js	(revision 8265)
@@ -700,5 +700,6 @@
  function filter_from_msg (msg) { 
 	var html = DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {}); 
-	initialize_container(html); 
+	initialize_container(html);
+	outOfficeVerify(); 
 	list_container = create_filter_dialog(); 
 	render_new_rule(msg.from.email, html_entities(msg.subject)); 
Index: /sandbox/2.5.1-evolucao/expressoMail1_2/js/rich_text_editor.js
===================================================================
--- /sandbox/2.5.1-evolucao/expressoMail1_2/js/rich_text_editor.js	(revision 8192)
+++ /sandbox/2.5.1-evolucao/expressoMail1_2/js/rich_text_editor.js	(revision 8265)
@@ -367,5 +367,12 @@
 				selection.selectRanges(selectionRanges);
 			}
-			
+            if (CKEDITOR.env.ie){
+                var body = editor.document.getBody();
+                var range = new CKEDITOR.dom.range(body);
+                range.selectNodeContents(body);
+                range.collapse(true);
+                var selection = editor.getSelection();
+                selection.selectRanges([range]);
+            }			
 			if (is_webkit){
 				$('#cke_contents_body_'+id+'>iframe').scrollTo(':first');
