BOOST lib = Perl RegEx syntax ...
This is the correct one says my hMailAdmin
Code: Select all
(?:^.*([\x{2E80}-\x{2FD5}\x{3190}-\x{319f}\x{3400}-\x{4DBF}\x{4E00}-\x{9FCC}\x{F900}-\x{FAAD}]).*$)
Code: Select all
(?:^.*([\x{2E80}-\x{2FD5}\x{3190}-\x{319f}\x{3400}-\x{4DBF}\x{4E00}-\x{9FCC}\x{F900}-\x{FAAD}]).*$)
SA? It is others that keep recommending it as the solution, but I have no time for it.jimimaseye wrote: ↑2019-03-23 10:15
I believe it is because he is still focusing on wanting to delete mail recognised as Chinese Japanese etc (which spamassassin does) and not understanding that the appearance and dealing with "utf8" (which your script deals with) has nothing to do with it. It seems he thinks spamassassin handles utf-8 better and therefore determines Chinese text more efficiently or, at least, it's functionality can be replicated in a rule.
While you were asleep we found a solution using Rules and RegEx. I just posted the correct (corrected) RegEx to capture chinese and japanese characters. The Rule is described a few posts back.Kendo wrote: ↑2019-03-23 22:30SA? It is others that keep recommending it as the solution, but I have no time for it.jimimaseye wrote: ↑2019-03-23 10:15
I believe it is because he is still focusing on wanting to delete mail recognised as Chinese Japanese etc (which spamassassin does) and not understanding that the appearance and dealing with "utf8" (which your script deals with) has nothing to do with it. It seems he thinks spamassassin handles utf-8 better and therefore determines Chinese text more efficiently or, at least, it's functionality can be replicated in a rule.
Which script deals with UTF8 that works without specifically targeting only one string?
[Entered by mobile. Excuse my spelling.]SorenR wrote: ↑2019-03-21 18:14Combine Script and Rules.
Rule: "Exterminate"Code: Select all
Sub OnAcceptMessage(oClient, oMessage) ' ' Save state of Encode Flag ' Dim ECFlag : ECFlag = oMessage.EncodeFields ' ' Disable Encoding of Header Fields ' oMessage.EncodeFields = False ' ' Do stuff with RAW headers ' If oMessage.Subject = "=?utf-8?B?5LyB5Lia566h55CG6LWE5paZ?=" Then _ oMessage.HeaderValue("X-hMailServer-Exterminate") = "YES" ' ' Save new header into message. ' oMessage.Save ' ' Restore Encoding of Header Fields ' oMessage.EncodeFields = ECFlag End Sub
Criteria - Custom Header "X-hMailServer-Exterminate" CONTAINS "YES"
Action - Oh well... DELETE.... Or get in line like Daleks and shout "EXTERMINATE"
The string "=?utf-8?B?5LyB5Lia566h55CG6LWE5paZ?=" is Base64 encoded using UTF-8 charset.
How does this detect anything that is not specifically "=?utf-8?B?5LyB5Lia566h55CG6LWE5paZ?="?jimimaseye wrote: ↑2019-03-23 22:38
If oMessage.Subject = "=?utf-8?B?5LyB5Lia566h55CG6LWE5paZ?=" Then
Code: Select all
Sub OnDeliverMessage(oMessage)
Const strRecipient = "nospam@example.com" ' <-- Change to reflect actual user!
Const strRegEx = "(\?)(GB2312|GBK|GB18030)(\?)" ' <-- Here you can add search params!
Dim i, ECFlag : ECFlag = oMessage.EncodeFields
For i = 0 To oMessage.Recipients.Count-1
If oMessage.Recipients(i).Address = strRecipient Then
oMessage.EncodeFields = False
With CreateObject("VBScript.RegExp")
.Pattern = strRegEx
.Global = True
.MultiLine = True
.IgnoreCase = True
If .Test(oMessage.From) Then
oMessage.HeaderValue("X-hMailServer-Mime-Ban") = "YES"
End If
If .Test(oMessage.Subject) Then
oMessage.HeaderValue("X-hMailServer-Mime-Ban") = "YES"
End If
End With
oMessage.Save
oMessage.EncodeFields = ECFlag
End If
Next
End Sub
Code: Select all
Return-Path: return-to@ec.chinahomelife247.cn
Delivered-To: katip@...
X-Spam-Checker-Version: SpamAssassin 3.4.2 (svnunknown) on Server
X-Spam-Flag: YES
X-Spam-Level: ***************
X-Spam-Status: Yes, score=16.0 required=5.0 tests=BAYES_99,BAYES_999, BH_LIST_UNSUBSCRIBE,DKIM_INVALID,DKIM_SIGNED,HTML_FONT_LOW_CONTRAST,
HTML_MESSAGE,MPART_ALT_DIFF autolearn=disabled version=3.4.2
X-Spam-Test-Scores: BAYES_99=4.5,BAYES_999=0.5,BH_LIST_UNSUBSCRIBE=10, DKIM_INVALID=0.1,DKIM_SIGNED=0.1,HTML_FONT_LOW_CONTRAST=0.001,
HTML_MESSAGE=0.001,MPART_ALT_DIFF=0.79
X-Spam-Total-Score: 16.0
X-Spam-Report: * 4.5 BAYES_99 BODY: Bayes spam probability is 99 to 100% * [score: 1.0000]
* 0.5 BAYES_999 BODY: Bayes spam probability is 99.9 to 100% * [score:
1.0000] * 10 BH_LIST_UNSUBSCRIBE Found a List-Unsubscribe header * 0.0
HTML_MESSAGE BODY: HTML included in message * 0.8 MPART_ALT_DIFF BODY:
HTML and text parts are different * 0.0 HTML_FONT_LOW_CONTRAST BODY: HTML
font color similar or * identical to background * 0.1 DKIM_SIGNED
Message has a DKIM or DK signature, not necessarily * valid * 0.1
DKIM_INVALID DKIM or DK signature exists, but is not valid
X-Spam-Virus: No
Received: from smtp.ceopxkc.com (smtp.kenji1205.win [103.42.106.106]) by mail....
with ESMTP ; Wed, 6 Mar 2019 09:11:40 +0300
Received: from 127.0.0.1 by ESMTP (Postfix) for yasin.yilmaz@...; Wed,
06 Mar 2019 14:11:35 +0800 (CST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ec.chinahomelife247.cn; s=dmddkim;
t=1551852655; bh=bD1A2ZXPb9nMVz+/5yAgiPVHyTVeZhyIMX5hbyCvcRw=; h=Date:Message-Id:To:From:Subject:Content-Type;
b=QnPnhms3kB53aRGa+Cn2ujtk0ycfTeQQIyvglViJu7v31lsS8kw/PVKQsdoUB0DxZ
mM+NA1dKYI3mkyLU0xEFwI0XzhULQ3pAc5WbZYu4ldWZBrmJcoZ3zRm8LcF29gTonE
lYi+b35RXqnlHSbMiXFlVi6Py8BkxwDQtYXx8MBw=
Date: Wed, 06 Mar 2019 14:10:55 +0800
MIME-Version: 1.0
Message-Id: <S7Y1tPyfa2tsav6.CEgaWxr_z7E1NjEFAAA32@ec.chinahomelife247.cn>
To: yasin.yilmaz@....com
From: Chinahomelife247 <qijialing@ec.chinahomelife247.cn>
Reply-To: "Chinahomelife247" <qijialing@meorient.com>
Subject: [SA][16.0][1.0000] YASIN YILMAZ get the best quotation from China, the free tool could help you.
X-Mailer: DMD-MTA
X-Hash: DcRBCgAhCADAHwVlER18TLiGQhrE.t.dOQxhHmEIrcf9h5FjI9QWgkyJRH3KMd66uNSeyEMfND5X2d8PA88
Feedback-ID: ec.chinahomelife247.cn:19:357:webpower
List-Unsubscribe: <http://ec.chinahomelife247.cn/x/unsubscribe/?MIDRID=S7Y1tPyfa2tsav6.CEgaWxr_z7E1NjH9X5BfXGJrCAAA74>,
<mailto:unsubscribe@ec.chinahomelife247.cn?subject=DcRBCgAhCADAHwVlER18TLiGQhrE.t.dOQxhHmEIrcf9h5FjI9QWgkyJRH3KMd66uNSeyEMfND5X2d8PA88>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
List-Help: <http://ec.chinahomelife247.cn/x/plugin/?pName=list_help&MIDRID=S7Y1tPyfa2tsav6.CEgaWxr_z7E1NjEFAAA32&Z=1542863102>
Content-Type: multipart/alternative; boundary="D155185265388836963"
X-Spam-Prev-Subject: YASIN YILMAZ get the best quotation from China, the free tool could help
you.
X-HMS-Envelope-From: return-to@ec.chinahomelife247.cn
X-HMSwl-From: No
X-Envelope-From: return-to@ec.chinahomelife247.cn
X-Envelope-To: yasin.yilmaz@....com
X-hMailServer-LoopCount: 1
YASIN YILMAZ get the best quotation from China, the free tool could help you.
Hello yasin.yilmaz@....com,
看上去似乎您的e-mail软件不支持HTML。
请访问下面的网页使您能够在网页浏览其中阅读这条信息:
http://ec.chinahomelife247.cn/x/?S7Y1tPyfa2tsav6.CEgaWxr_z7E1NjEFAAA32
haha, i know, but is ok with our content.
(as a globally connected shipping agency) we DO receive legit mails where correspondance (Subject/Body) is in EN but people tend to write their names in "From" in CJK - which we totally respect of course. but not only this. after initial message, Subject sometimes adds initials "Re:" or "Fwd:" in CJK too...
definitely +1
for me, not in this world i think
Hmm... Script is designed to catch NON-utf8 mime charset like "?gb2312?".
Code: Select all
Const strRegEx = "(gb(k|2312|18030)|big5|euc-(cn|tw)|iso-2022-(cn|jp))" ' <-- Here you can add search params!
Code: Select all
Const strRecipient = "nospam@example.com" ' <-- Change to reflect actual user!
Without the "?"SorenR wrote: ↑2019-03-27 02:06Code: Select all
Const strRegEx = "(gb(k|2312|18030)|big5|euc-(cn|tw)|iso-2022-(cn|jp))" ' <-- Here you can add search params!
Can add the "?", no problem..Kendo wrote: ↑2019-03-27 22:22Without the "?"SorenR wrote: ↑2019-03-27 02:06Code: Select all
Const strRegEx = "(gb(k|2312|18030)|big5|euc-(cn|tw)|iso-2022-(cn|jp))" ' <-- Here you can add search params!
You dont need and shouldn't [Reload Scripts] to check syntax. You should [check syntax] first (this checks the current script saved to disk) and then, if correct and OK, hit [RELOAD SCRIPT] to make it live. (Otherwise you risk temporarily loading a failing script in to memory as live that will error every time there is a connection or message whilst you go about trying to figure out what to correct. It's best to correct it without loading it.)
I think I always knew that, I have no idea when the other procedure became part of my unconscious mind.jimimaseye wrote: ↑2019-03-28 09:55You dont need and shouldn't [Reload Scripts] to check syntax. You should [check syntax] first (this checks the current script saved to disk) and then, if correct and OK, hit [RELOAD SCRIPT] to make it live. (Otherwise you risk temporarily loading a failing script in to memory as live that will error every time there is a connection or message whilst you go about trying to figure out what to correct. It's best to correct it without loading it.)
For some reason this does not work. It works for 1 but not for 2.
Code: Select all
Const strRegEx = "(\?)(gb(k|2312|18030)|big5|euc-(cn|tw)|Shift|iso-2022-(cn|jp))(\?)"