mailcow / mailcow-dockerized

mailcow: dockerized - ๐Ÿฎ + ๐Ÿ‹ = ๐Ÿ’•
https://mailcow.email
GNU General Public License v3.0
8.83k stars 1.18k forks source link

Pushover messages contain utf8 encoded text (not decoded) #6028

Closed bluewalk closed 2 months ago

bluewalk commented 2 months ago

Contribution guidelines

I've found a bug and checked that ...

Description

Pushover notifications contain utf8 encoded characters since the last august update.

For example: =?UTF-8?Q?Terug_van_weggewee?= =?UTF-8?Q?st=21_=E2=9B=BD=F0=9F=8E=89?=
This should actually just say: Terug van weggeweest โ›ฝ๐ŸŽ‰

Logs:

No logs

Steps to reproduce:

1. Setup pushover messages for mail notifications
2. Send an encoded message, by including emoji's for example.

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Ubuntu 22.04.4 LTS

Server/VM specifications:

4GB, 2 cores

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

VMware

Docker version:

27.0.3

docker-compose version or docker compose version:

v2.28.1

mailcow version:

2024-08

Reverse proxy:

nginx/haproxy

Logs of git diff:

diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf
index 6a87f2ec..7696442c 100644
--- a/data/conf/postfix/main.cf
+++ b/data/conf/postfix/main.cf
@@ -173,3 +173,43 @@ parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks

 # DO NOT EDIT ANYTHING BELOW #
 # Overrides #
+
+postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
+  hostkarma.junkemailfilter.com=127.0.0.1*-2
+  list.dnswl.org=127.0.[0..255].0*-2
+  list.dnswl.org=127.0.[0..255].1*-4
+  list.dnswl.org=127.0.[0..255].2*-6
+  list.dnswl.org=127.0.[0..255].3*-8
+  ix.dnsbl.manitu.net*2
+  bl.spamcop.net*2
+  bl.suomispam.net*2
+  hostkarma.junkemailfilter.com=127.0.0.2*3
+  hostkarma.junkemailfilter.com=127.0.0.4*2
+  hostkarma.junkemailfilter.com=127.0.1.2*1
+  backscatter.spameatingmonkey.net*2
+  bl.ipv6.spameatingmonkey.net*2
+  bl.spameatingmonkey.net*2
+  b.barracudacentral.org=127.0.0.2*7
+  bl.mailspike.net=127.0.0.2*5
+  bl.mailspike.net=127.0.0.[10;11;12]*4
+  dnsbl.sorbs.net=127.0.0.10*8
+  dnsbl.sorbs.net=127.0.0.5*6
+  dnsbl.sorbs.net=127.0.0.7*3
+  dnsbl.sorbs.net=127.0.0.8*2
+  dnsbl.sorbs.net=127.0.0.6*2
+  dnsbl.sorbs.net=127.0.0.9*2
+  zen.spamhaus.org=127.0.0.[10;11]*8
+  zen.spamhaus.org=127.0.0.[4..7]*6
+  zen.spamhaus.org=127.0.0.3*4
+  zen.spamhaus.org=127.0.0.2*3
+
+# User Overrides
+myhostname = mydomain.com
+mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.16.0.0/12 192.168.0.0/16 [fe80::]/10 [fc00::]/7
+
+smtpd_recipient_restrictions = permit_sasl_authenticated,
+  permit_mynetworks,
+  check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
+  reject_invalid_helo_hostname,
+#  reject_unknown_reverse_client_hostname,
+  reject_unauth_destination
diff --git a/data/conf/rspamd/local.d/greylist.conf b/data/conf/rspamd/local.d/greylist.conf
index c43c907f..6b2ed8b8 100644
--- a/data/conf/rspamd/local.d/greylist.conf
+++ b/data/conf/rspamd/local.d/greylist.conf
@@ -2,3 +2,4 @@ whitelisted_ip = "http://nginx:8081/forwardinghosts.php";
 ipv4_mask = 24;
 ipv6_mask = 64;
 message = "Greylisted, please try again later";
+enabled = false;
diff --git a/data/conf/rspamd/local.d/multimap.conf b/data/conf/rspamd/local.d/multimap.conf
index 888bf363..8496de41 100644
--- a/data/conf/rspamd/local.d/multimap.conf
+++ b/data/conf/rspamd/local.d/multimap.conf
@@ -9,6 +9,7 @@ WHITELISTED_FWD_HOST {
   type = "ip";
   map = "redis://WHITELISTED_FWD_HOST";
   symbols_set = ["WHITELISTED_FWD_HOST"];
+  score = -10000
 }
bluewalk commented 2 months ago

Related: https://github.com/rspamd/rspamd/issues/4808

bluewalk commented 2 months ago

I have now changed a line in pushover.php to wrap subject in iconv_mime_decode

$subject  = iconv_mime_decode($headers['X-Rspamd-Subject']);

Will report back if this fixes the issue, if so will make a PR

bluewalk commented 2 months ago

PR is approved