From adf9daa9b7ec757a0cdc7ed92a5ad53579c2f32c Mon Sep 17 00:00:00 2001
From: Fabian Schlenz
Date: Fri, 16 Nov 2018 12:09:55 +0100
Subject: [PATCH 1/4] Modified the update check in update.sh to fetch the
newest revision directly from github without having to run git fetch first.
---
update.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/update.sh b/update.sh
index 5b38d7d0..fe5aafe0 100755
--- a/update.sh
+++ b/update.sh
@@ -62,8 +62,12 @@ while (($#)); do
case "${1}" in
--check|-c)
echo "Checking remote code for updates..."
- git fetch origin #${BRANCH}
- if [[ -z $(git log HEAD --pretty=format:"%H" | grep $(git rev-parse origin/${BRANCH})) ]]; then
+ LATEST_REV=$(git ls-remote --exit-code --refs --quiet https://github.com/mailcow/mailcow-dockerized ${BRANCH} | cut -f1)
+ if [ $? -ne 0 ]; then
+ echo "A problem occurred while trying to fetch the latest revision from github."
+ exit 99
+ fi
+ if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then
echo "Updated code is available."
exit 0
else
From 40a826a3471db61349eb64f58dd35bdddd0ae19e Mon Sep 17 00:00:00 2001
From: Aaron Larisch
Date: Mon, 11 Mar 2019 15:29:30 +0100
Subject: [PATCH 2/4] Fix rejected mails not being quarantized properly if they
are tagged
---
data/conf/rspamd/meta_exporter/pipe.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/data/conf/rspamd/meta_exporter/pipe.php b/data/conf/rspamd/meta_exporter/pipe.php
index 3e29d207..692a0c2e 100644
--- a/data/conf/rspamd/meta_exporter/pipe.php
+++ b/data/conf/rspamd/meta_exporter/pipe.php
@@ -84,6 +84,9 @@ $rcpt_final_mailboxes = array();
// Loop through all rcpts
foreach (json_decode($rcpts, true) as $rcpt) {
+ // Remove tag
+ $rcpt = preg_replace('/^(.*?)\+.*(@.*)$/', '$1$2', $rcpt);
+
// Break rcpt into local part and domain part
$parsed_rcpt = parse_email($rcpt);
From 8f6c24e60abc32323695aac0fa10afdb9c9323bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Peters?=
Date: Tue, 12 Mar 2019 17:21:45 +0100
Subject: [PATCH 3/4] Update update.sh
---
update.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/update.sh b/update.sh
index fe5aafe0..2d528e64 100755
--- a/update.sh
+++ b/update.sh
@@ -66,7 +66,7 @@ while (($#)); do
if [ $? -ne 0 ]; then
echo "A problem occurred while trying to fetch the latest revision from github."
exit 99
- fi
+ fi
if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then
echo "Updated code is available."
exit 0
From 9d5758362405015b22f5a69df60af9883544af56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristia=CC=81n=20Feldsam?=
Date: Tue, 12 Mar 2019 21:54:31 +0100
Subject: [PATCH 4/4] Quarantine - Enhanced JS + Show btn fix event binding
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Kristián Feldsam
---
data/web/js/site/quarantine.js | 86 +++++++++++++++++-----------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/data/web/js/site/quarantine.js b/data/web/js/site/quarantine.js
index 090b5054..4df1dbd4 100644
--- a/data/web/js/site/quarantine.js
+++ b/data/web/js/site/quarantine.js
@@ -1,11 +1,13 @@
// Base64 functions
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(r){var t,e,o,a,h,n,c,d="",C=0;for(r=Base64._utf8_encode(r);C>2,h=(3&t)<<4|(e=r.charCodeAt(C++))>>4,n=(15&e)<<2|(o=r.charCodeAt(C++))>>6,c=63&o,isNaN(e)?n=c=64:isNaN(o)&&(c=64),d=d+this._keyStr.charAt(a)+this._keyStr.charAt(h)+this._keyStr.charAt(n)+this._keyStr.charAt(c);return d},decode:function(r){var t,e,o,a,h,n,c="",d=0;for(r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");d>4,e=(15&a)<<4|(h=this._keyStr.indexOf(r.charAt(d++)))>>2,o=(3&h)<<6|(n=this._keyStr.indexOf(r.charAt(d++))),c+=String.fromCharCode(t),64!=h&&(c+=String.fromCharCode(e)),64!=n&&(c+=String.fromCharCode(o));return c=Base64._utf8_decode(c)},_utf8_encode:function(r){r=r.replace(/\r\n/g,"\n");for(var t="",e=0;e127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t},_utf8_decode:function(r){for(var t="",e=0,o=c1=c2=0;e191&&o<224?(c2=r.charCodeAt(e+1),t+=String.fromCharCode((31&o)<<6|63&c2),e+=2):(c2=r.charCodeAt(e+1),c3=r.charCodeAt(e+2),t+=String.fromCharCode((15&o)<<12|(63&c2)<<6|63&c3),e+=3);return t}};
+
jQuery(function($){
acl_data = JSON.parse(acl);
// http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};
function escapeHtml(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return entityMap[n]})}
function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e' + value[0] + ' (' + value[1] + ')' +
- ' - ' + lang.check_hash + '
'
- );
- });
- }
- else {
- $( "#qid_detail_atts" ).text('-');
- }
+ $('body').on('click', '.show_qid_info', function (e) {
+ e.preventDefault();
+ var qitem = $(this).data('item');
+ var qError = $("#qid_error");
+
+ $('#qidDetailModal').modal('show');
+ qError.hide();
+
+ $.ajax({
+ url: '/inc/ajax/qitem_details.php',
+ data: { id: qitem },
+ dataType: 'json',
+ success: function(data){
+ if (typeof data.error !== 'undefined') {
+ qError.text(data.error);
+ qError.show();
}
- });
- })
- }
+ $('[data-id="qitems_single"]').each(function(index) {
+ $(this).attr("data-item", qitem);
+ });
+
+ $('#qid_detail_subj').text(data.subject);
+ $('#qid_detail_text').text(data.text_plain);
+ $('#qid_detail_text_from_html').text(data.text_html);
+
+ if (typeof data.attachments !== 'undefined') {
+ qAtts = $("#qid_detail_atts");
+ qAtts.text('');
+ $.each(data.attachments, function(index, value) {
+ qAtts.append(
+ '' + value[0] + ' (' + value[1] + ')' +
+ ' - ' + lang.check_hash + '
'
+ );
+ });
+ }
+ else {
+ qAtts.text('-');
+ }
+ }
+ });
+ });
+
// Initial table drawings
draw_quarantine_table();
});