Correction problème UTF8 dans la sauvegarde des messages

This commit is contained in:
David 2020-11-06 10:47:13 +01:00
parent 86c4127ae7
commit c741d57c49
4 changed files with 30 additions and 25 deletions

View file

@ -52,6 +52,7 @@ Pour le daemon, le script ini.d se trouve dans *init.d/lighten-mailbox*
## Changelog
* Futur :
* Orientation "serveur dédier" limiter a une liste de @domaine et ou un serveur
* BUG index.html si eml masque lien des archives !
* MAX usage... par IP et/ou cookies... ? (pour éviter que le service ne soit détourné)
* Estimer temps/durée (avant validation)

View file

@ -301,31 +301,31 @@ function jsonMessage($mod, $idClean, $parser, $header, $messageEML, $folder, $fo
}
$arrayTmp['senderaddress']='';
if (isset($header->senderaddress)) {
$arrayTmp['senderaddress']=$header->senderaddress;
$arrayTmp['senderaddress']=imap_utf8($header->senderaddress);
}
$arrayTmp['fromaddress']='';
if (isset($header->fromaddress)) {
$arrayTmp['fromaddress']=$header->fromaddress;
$arrayTmp['fromaddress']=imap_utf8($header->fromaddress);
}
$arrayTmp['toaddress']='';
if (isset($header->toaddress)) {
$arrayTmp['toaddress']=$header->toaddress;
$arrayTmp['toaddress']=imap_utf8($header->toaddress);
}
$arrayTmp['ccaddress']='';
if (isset($header->ccaddress)) {
$arrayTmp['ccaddress']=$header->ccaddress;
$arrayTmp['ccaddress']=imap_utf8($header->ccaddress);
}
$arrayTmp['bccaddress']='';
if (isset($header->bccaddress)) {
$arrayTmp['bccaddress']=$header->bccaddress;
$arrayTmp['bccaddress']=imap_utf8($header->bccaddress);
}
$arrayTmp['reply_toaddress']='';
if (isset($header->reply_toaddress)) {
$arrayTmp['reply_toaddress']=$header->reply_toaddress;
$arrayTmp['reply_toaddress']=imap_utf8($header->reply_toaddress);
}
$arrayTmp['return_pathaddress']='';
if (isset($header->return_pathaddress)) {
$arrayTmp['return_pathaddress']=$header->return_pathaddress;
$arrayTmp['return_pathaddress']=imap_utf8($header->return_pathaddress);
}
$arrayTmp['references']='';
if (isset($header->references)) {
@ -333,7 +333,7 @@ function jsonMessage($mod, $idClean, $parser, $header, $messageEML, $folder, $fo
}
$arrayTmp['in_reply_to']='';
if (isset($header->in_reply_to)) {
$arrayTmp['in_reply_to']=$header->in_reply_to;
$arrayTmp['in_reply_to']=imap_utf8($header->in_reply_to);
}
$arrayTmp['msgno']='';
if (isset($header->Msgno)) {
@ -422,29 +422,29 @@ function saveMessage($session_id, $idClean, $parser, $header, $messageEML, $fold
$headerHtml.='<p class="header">Date : '.$header->date.'</p>';
}
if (isset($header->senderaddress)) {
$headerTxt.='Sender : '.$header->senderaddress.'
$headerTxt.='Sender : '.imap_utf8($header->senderaddress).'
';
$headerHtml.='<p class="header">Sender : '.$header->senderaddress.'</p>';
$headerHtml.='<p class="header">Sender : '.imap_utf8($header->senderaddress).'</p>';
}
if (isset($header->fromaddress)) {
$headerTxt.='From : '.$header->fromaddress.'
$headerTxt.='From : '.imap_utf8($header->fromaddress).'
';
$headerHtml.='<p class="header">From : '.$header->fromaddress.'</p>';
$headerHtml.='<p class="header">From : '.imap_utf8($header->fromaddress).'</p>';
}
if (isset($header->toaddress)) {
$headerTxt.='To : '.$header->toaddress.'
$headerTxt.='To : '.imap_utf8($header->toaddress).'
';
$headerHtml.='<p class="header">To : '.$header->toaddress.'</p>';
$headerHtml.='<p class="header">To : '.imap_utf8($header->toaddress).'</p>';
}
if (isset($header->ccaddress)) {
$headerTxt.='Cc : '.$header->ccaddress.'
$headerTxt.='Cc : '.imap_utf8($header->ccaddress).'
';
$headerHtml.='<p class="header">Cc : '.$header->ccaddress.'</p>';
$headerHtml.='<p class="header">Cc : '.imap_utf8($header->ccaddress).'</p>';
}
if (isset($header->subject)) {
$headerTxt.='Bcc : '.imap_utf8($header->subject).'
$headerTxt.='Subject : '.imap_utf8($header->subject).'
';
$headerHtml.='<p class="header">Bcc : '.imap_utf8($header->subject).'</p>';
$headerHtml.='<p class="header">Subject : '.imap_utf8($header->subject).'</p>';
}
if (count($attachments) != 0) {
$headerTxt.='Attachments :';

View file

@ -167,6 +167,10 @@ if (isset($_GET['DeleteApproval']) && isset($_GET['session_id'])) {
<form role="form" action="" method="post" class="f1">
<h3><?= _('Lighten your mailbox') ?></h3>
<?php
if ($config['maintenance']['active'] == true && $_SERVER["REMOTE_ADDR"] == $config['maintenance']['ipForTest']) {
echo '<p style="color: red">Maintenance mode ON</p>';
}
if ($config['maintenance']['active'] == true && $_SERVER["REMOTE_ADDR"] != $config['maintenance']['ipForTest']) {
echo '<p>'.$config['maintenance']['publicMsg'].'</p>';
} elseif (isset($_GET['session_id'])) {

14
templateTab/index.html Executable file → Normal file
View file

@ -188,30 +188,30 @@
switch (value) {
case 'msgno':
case 'size':
table.addColumn({title:name, field:value, sorter:"number", align:"center", headerFilter:"number", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false);
table.addColumn({title:name, field:value, sorter:"number", align:"center", headerFilter:"number", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false);
break;
case 'udate':
table.addColumn({title:name, field:value, align:"center", formatter:"datetime", formatterParams:{
inputFormat:"X",
outputFormat:"DD/MM/YY HH:m",
invalidPlaceholder:"(invalid date)",
}, headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false);
}, headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false);
break;
case 'date':
table.addColumn({title:name, field:value, align:"center", headerFilter:dateFilterEditor, headerFilterFunc:dateFilterFunction, headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false);
table.addColumn({title:name, field:value, align:"center", headerFilter:dateFilterEditor, headerFilterFunc:dateFilterFunction, headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false);
break;
case 'answered':
case 'flagged':
//case 'attachments':
table.addColumn({title:name, field:value, align:"center", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }, formatter:printIcon, headerFilter:"tickCross", headerFilterParams:{"tristate":true},headerFilterEmptyCheck:function(value){return value === null}}, false);
table.addColumn({title:name, field:value, align:"center", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }, formatter:printIcon, headerFilter:"tickCross", headerFilterParams:{"tristate":true},headerFilterEmptyCheck:function(value){return value === null}}, false);
break;
case 'subject':
table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }, responsive:2}, false);
table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }, responsive:2}, false);
case 'fromaddress':
table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false);
table.addColumn({title:name, field:value, width: 400, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false);
break;
default:
table.addColumn({title:name, field:value, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#flagged').removeClass('inTable'); refreshTableControls(); }}, false);
table.addColumn({title:name, field:value, sorter:"string", headerFilter:"input", headerContext:function(e, column){ column.delete(); $('#' + value).removeClass('inTable'); refreshTableControls(); }}, false);
}
}