rules don't work

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
arto
New user
New user
Posts: 1
Joined: 2013-09-08 14:33

rules don't work

Post by arto » 2013-09-09 09:22

Hello
I installed hmailserver couple of days ago, and everything else seems to work ok except rules.
I have a simple rule where from equals spam@spammer.com, delete message but I can not make it work. I have also tried wildcard *@spammer.com.
Log looks like this:
"SMTPD" 932 26810 "2013-09-09 02:52:11.597" "1.2.3.4" "RECEIVED: MAIL FROM:<spam@spammer.com> SIZE=11493"
I have also tested with custom header "Received", but result is the same, nothing match to rule.
One thing, which I don't understand is that documentation say that I can make global rule or account rule. I haven't found any explanation how do I make a global rule or how do I make account rule. How do I know if my rule is global or account rule??
I don't have any accounts, I don't have any domains I just have routes and forwarding works ok.

My installed version:
http://www.hmailserver.com/index.php?pa ... loadid=221

I forward all messages to other server, so i configured route:
"Start hMailServer Administrator
Go to Settings -> Protocols -> SMTP -> Routes
Click on Add
In the Domain field, enter example.com
In the Target SMTP host field, enter the host name where email for this domain should be forwarded.
Click on Save"


I only have route, nothing under domains. Dns blacklist, surbl servers works, but rules never match.
Actually I have made all kind of rules (just for the test), from the log I can see that server apply rules but they never match.

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2013-09-09 11:13

try using 'contains' instead of 'equals' and don't use the wildcard '*'

Are you using global rules or account rules?
Are you testing for SMTP envelope FROM or the header FROM?

rules certainly work.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: rules don't work

Post by percepts » 2013-09-09 11:27

Matt replied as I was typing. Here's a bit more info.

Global rules are applied to both incoming and outgoing mail. They are set in

hmailadmin / rules

Account level rules work on incoming mail only and also only for the specific account they set on. They are set in

hmailadmin / domains / select a domain / accounts / select an account / rules tab

The From header value will frquently contain an email address in the format

"some spammer " <spam@spammer.com>

so use the Contains Search Type and not Equals

Also note that any mail header can be checked by using the Custom Header option of the criteria and specifying the header name. You can see the header nmaes by viewing your mail headers/source(full headers are not usually shown unless you specifically ask to view them in email client)
Sometimes testing custom Header "Return-Path" (without a colon) is a better option. Look at mail headers from several of your received mails from a spammer to see if from and return-path always contain same address.
And / or checking the custom header "Received" for an IP address can stop spam from a specific senders mail server. Again look at mail headers to see whats in there.

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-18 18:44

Global rule on Return-Path isn't working. This is the first rule in my list of global rules.

Header in email:
Return-Path: asfauae-004+bncBAABBQX3WK6AKGQEZ57MYKQ@dolphinadvertisers.com
Attachments
DolphinAdsRule.JPG

User avatar
jimimaseye
Moderator
Moderator
Posts: 7955
Joined: 2011-09-08 17:48

Re: rules don't work

Post by jimimaseye » 2016-07-18 19:48

I doubt return path is populated at the time of global rules being run. It seems return path is only populated last thing at delivery time to the account.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-18 20:25

Code: Select all

   Sub OnAcceptMessage(oClient, oMessage)
      If oClient.Username <> "" Then Exit Sub
      oMessage.HeaderValue("Return-Path") = oMessage.FromAddress
      oMessage.Save
   End Sub
Keine Hexerei nur Behändigkeit... :mrgreen:
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-18 21:30

SorenR wrote:

Code: Select all

   Sub OnAcceptMessage(oClient, oMessage)
      If oClient.Username <> "" Then Exit Sub
      oMessage.HeaderValue("Return-Path") = oMessage.FromAddress
      oMessage.Save
   End Sub
Ummm....no. I'd imagine I'd end up with two Return-Path headers in delivered mail.

If I was going to deal with this in the EventHandlers script, I'd do it this way:

Code: Select all

Sub OnSMTPData(oClient, oMessage)
    Select Case True
        Case oClient.Username <> ""
            ' Authenticated User
        Case InStr(oMessage.FromAddress, "dolphinadvertisers") > 0
            Result.Value = 2
            Result.Message = "Go to hell spammer"
    End Select
End Sub

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2016-07-19 14:19

jimimaseye wrote:I doubt return path is populated at the time of global rules being run. It seems return path is only populated last thing at delivery time to the account.
I've checked and it is

I called a script from a global rule that logs all headers, and 'Return-Path' is included (although it often seems blank)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-19 14:49

mattg wrote:
jimimaseye wrote:I doubt return path is populated at the time of global rules being run. It seems return path is only populated last thing at delivery time to the account.
I've checked and it is

I called a script from a global rule that logs all headers, and 'Return-Path' is included (although it often seems blank)
Return-Path can only be blank if you enabled "Allow empty sender address" in Settings->Protocol->SMTP[RFC compliance].

Return-Path should always contain the emailaddress from the SMTP LOG -> "RECEIVED: MAIL FROM:<noreply@ajax.inc>"

Not sure about current version but my 5.4.2 have NO reference of the Return-Path header in "Sub OnDeliverMessage(oMessage)" which is run AFTER Global Rules and BEFORE Local Rules...
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2016-07-19 15:07

Yes I had allowed empty sender (many NDR are sent with an empty sender)

Here is my script

Code: Select all

Function LogItTest(oMessage)
	Dim i, txt
	Call CustomMonthlyLog(oMessage.Subject & "   " & oMessage.FromAddress, "TestLog")
	For i = 1 To oMessage.Headers.Count 
		txt = "Message Subject is: " & oMessage.Subject & "   " & i & " name is: " & oMessage.Headers.Item(i-1).Name
		txt = txt & " value is: " & oMessage.Headers.Item(i-1).Value
		Call CustomMonthlyLog(txt, "TestLog")
	Next 'i
End Function
The CustomMonthlyLog takes two arguments, the text to be logged and the log file name, and creates a log file with the year and month number appended to the log file name sent via argument.
In this instance it would create a log file called 'TestLog_2016-07.log' if it didn't already exist and writes a log entry like this

Code: Select all

2016-07-19 22:46:27.062   XXXXX  YYYYY   wants to be friends on Facebook   10 name is: Subject value is: XXXXX  YYYYY wants to be friends on Facebook
2016-07-19 22:46:27.078   XXXXX  YYYYY   wants to be friends on Facebook   11 name is: X-Priority value is: 3
2016-07-19 22:46:27.078   XXXXX  YYYYY   wants to be friends on Facebook   12 name is: X-Mailer value is: ZuckMail [version 1.00]
2016-07-19 22:46:27.078   XXXXX  YYYYY   wants to be friends on Facebook   13 name is: Return-Path value is: notification@facebookmail.com
2016-07-19 22:46:27.093   XXXXX  YYYYY   wants to be friends on Facebook   14 name is: From value is: "Facebook" <notification@facebookmail.com>
2016-07-19 22:46:27.093   XXXXX  YYYYY   wants to be friends on Facebook   15 name is: Reply-to value is: noreply <noreply@facebookmail.com>
2016-07-19 22:46:27.093   XXXXX  YYYYY   wants to be friends on Facebook   16 name is: Errors-To value is: notification@facebookmail.com
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-19 15:26

Global rule or local rule ??
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2016-07-19 15:47

Global rule

If
Message size > -1
Action
Run Function 'logittest'
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-19 16:20

Sounds like at least some of you think my global rule on Return-Path (image above) should work, but it definitely does not.

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-19 16:23

Hmm...

If I do like you do with the rule...

Code: Select all

   Sub OnDeliveryStart(oMessage)
      oMessage.HeaderValue("X-hMailServer-Event") = "OnDeliveryStart"
      oMessage.Save
   End Sub

'  ********** Antivirus check, Global rules

   Sub OnDeliverMessage(oMessage)
      oMessage.HeaderValue("X-hMailServer-Event") = "OnDeliverMessage"
      oMessage.Save

      Call CustomLogger(oMessage)
   End Sub

'  ********** Local rules, Message delivered to recipient(s)

   Function LogItTest(oMessage)
      Dim i, txt
      EventLog.Write(oMessage.Subject & "   " & oMessage.FromAddress)
      For i = 1 To oMessage.Headers.Count 
         txt = "Message Subject is: " & oMessage.Subject & "   " & i & " name is: " & oMessage.Headers.Item(i-1).Name
         txt = txt & " value is: " & oMessage.Headers.Item(i-1).Value
         EventLog.Write(txt)
      Next 'i
   End Function
I can see from the output that the rule is executed after X-hMailServer-Event: OnDeliveryStart and before X-hMailServer-Event: OnDeliverMessage and Return-Path has a value... The strange thing is when I add a line to my CustomLogger(oMessage) function to log oMessage.HeaderValue("Return-Path") then it comes out blank...
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-19 17:21

Now I have tried all sorts of things... The ONLY situation I am able to generate a "Return-Path" header is if I redirect my gmail to my hmail and send an email to my gmail... Then - and ONLY then - will I get a "Return-Path" header using the rule that Matt posted...
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
RvdH
Senior user
Senior user
Posts: 746
Joined: 2008-06-27 14:42
Location: Netherlands

Re: rules don't work

Post by RvdH » 2016-07-19 19:40

The missing Return-Path is a bug that was introduced in 5.x series, in 4.x series the Return-Path header was added before a message was send to SA, and i guess also before OnDeliveryStart and/or OnDeliverMessage
https://github.com/hmailserver/hmailserver/issues/116
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2016-07-20 00:16

Looking back through my TestLog for the last couple of days, about 1 in ten messages have a return path header.
I'm guessing that these are added by the message sender, not by my hMailserver.

I have Return-Path header from Facebook and at least a dozen other domains unrelated to facebook, but I don't get them from Twitter.

Sometimes the Return-Path is in the middle of the header group (Facebook is about #13 of 25), but some are at the end of the header group
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
mattg
Moderator
Moderator
Posts: 19811
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: rules don't work

Post by mattg » 2016-07-20 00:32

Also the first header is the one added by my SpamAssassin install
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: rules don't work

Post by percepts » 2016-07-20 10:33

Doesn't really matter what anyone else has in Return-Path. Its what MrGadget has in Return-Path of the message that he says the rule is failing on that counts.

So I would like to see the full headers of the mail in question posted here and then we can make a sensible assessment of what might be happening.

For example a mail sent via relay may not have what you are expecting in return-path. And Return-Path sometimes appears several times in the headers of a mail. Since you haven't shown the headers of this mail we have no idea what you are really testing against. So please show the full headers of the mail in question.

User avatar
jimimaseye
Moderator
Moderator
Posts: 7955
Joined: 2011-09-08 17:48

Re: rules don't work

Post by jimimaseye » 2016-07-20 10:42

It's not uncommon to get 2x RETURN-PATHS in the headers (especially if coming in by External Download). For example:

[code]Return-Path: donotreply@ivcgroup.net <<<<<----------- ONE HERE
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mailserver
X-Spam-Level:
X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,TVD_SPACE_RATIO,
UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no
version=3.4.0
X-Spam-Report:
* -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4)
* [81.246.22.35 listed in wl.mailspike.co]
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no
* trust
* [81.246.22.35 listed in list.dnswl.org]
* -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
* 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines
* 0.0 TVD_SPACE_RATIO No description available.
*
X-hMailServer-ExternalAccount: POPdaily
Return-Path: <No.Reply@ivcgroup.net> <<<<<----------- ONE HERE
Received: from mailin5.myhost.net (mailin5.myhost.net [195.26.90.115])
(authenticated user=sylvester@mydomain.net bits=0)
by ms7.myhost.net (Cyrus v2.4.16-Kolab-2.4.16-1.el6) with LMTPSA
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256/256 verify=YES);
Wed, 20 Jul 2016 06:47:10 +0100
X-Sieve: CMU Sieve 2.4
Received: from mail.ivcgroup.net ([81.246.22.35] helo=ivcgroup.net)
by mailin5.myhost.net with esmtp (Exim 4.85)
(envelope-from <No.Reply@ivcgroup.net>)
id 1bPkLe-0003u3-Fc
for sylvester@mydomain.net; Wed, 20 Jul 2016 06:47:10 +0100
Received: from Internal Mail-Server by IVCMRL03 (envelope-from No.Reply@ivcgroup.net)
with ESMTPS (AES128-SHA encrypted); 20 Jul 2016 07:47:06 +0200
Received: from IVCGROUP.net (192.168.188.171) by IVCCOM01 (192.168.188.74)
with Microsoft SMTP Server id 14.3.146.0; Wed, 20 Jul 2016 07:47:06 +0200[/code]


(Note: they are not even the same! But that raises other questions.)
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-20 16:20

percepts wrote:So I would like to see the full headers of the mail in question posted here and then we can make a sensible assessment of what might be happening.

Code: Select all

Return-Path: asfauae-004+bncBC6KH7PW34PBBLMGXC6AKGQEZ2IDWDA@dolphinadvertisers.com
Delivered-To: chris@redacted.com
Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by
 mail.redacted.net with ESMTP ; Tue, 19 Jul 2016 06:38:43 -0400
Received: by mail-it0-f69.google.com with SMTP id i64sf34879840ith.2 for <chris@redacted.com>;
 Tue, 19 Jul 2016 03:38:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolphinadvertisers-com.20150623.gappssmtp.com;
 s=20150623; h=from:reply-to:to:references:in-reply-to:subject:date:message-id
 :mime-version:thread-index:content-language:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id
 :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=1DuOVclmG3dG7EzeN1v7SRvPdPdtVcieGJGeHgfLF6Y=;
 b=NxqOun0U5fX7L/G1Aw2YNFiT8LjH021Uppm/loJ6klHHeK3o3WtlW6ileEKi20h/AG
 LgYB1LpF7Y6MXcMHJ2iNnUDIKrXLeVv4AEBk1jEWXpFs8p7Uxvl9qyyAA9z9ilDPF7iM
 tbzaljt1TNNa5rPEZIjELfjCexlyQ4E08YPGDFxmSxi06Gy7HDSDZ1eOATi4HrPEQaD0
 aAq09w9kiDTKcgwhJB33ZbaME+IlHHn77V3ru3AEEDoHhz57l336qdw8yoDVIcBGrOAW
 LYyZ7WFM+q7gDu3bMg6jxdO18zhMmUft6SUMJi3V692Ng0XT525DGflcVa8RyKnkNMrM f62A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:reply-to:to:references:in-reply-to:subject
 :date:message-id:mime-version:thread-index:content-language :x-original-sender:x-original-authentication-results:precedence
 :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe;
 bh=1DuOVclmG3dG7EzeN1v7SRvPdPdtVcieGJGeHgfLF6Y=; b=lkqEFJ0GYYjauLxzq3vLCtajj4KTwJ/4GRlQjpABZ4OQxqtx1TM1/aT03kFTTua9Rd
 2StzcmQa3VHka+q/lMKpPp15lhe40FIL/1uuxJc16Q91jatJfbY29t8wTng7qP3O/P4c
 xErTjNdnfUEmaDngHKGMZn+chmsbDJdP7Le+6cgVIpCmt10voictiF9jDOCkcoCrxpmK
 ZsxCsmQDodX5X+Nd4ubCkAEV6jUxJlaWmCuTCay/xzIU+g7vD9Qc/iF0Z3Axojl5tt+I
 tI1yc9sugGf3e5qrfuLwch/Ri1DKTdNlUpNHJaiZyJf0LCPj2T/Xawnwim1zZ6PH+Xww x3xQ==
X-Gm-Message-State: ALyK8tL4bLxJhaMqgV5P6SfodcHNsR9RXPwAoJWbCuhk13sJ+ZH7BPG2VuagZX47CxP7fA==
X-Received: by 10.107.148.204 with SMTP id w195mr31082869iod.33.1468924722107; Tue, 19
 Jul 2016 03:38:42 -0700 (PDT)
X-BeenThere: asfauae-004@dolphinadvertisers.com
Received: by 10.107.180.200 with SMTP id d191ls3794471iof.13.gmail; Tue, 19 Jul 2016
 03:38:37 -0700 (PDT)
X-Received: by 10.98.20.196 with SMTP id 187mr26482985pfu.0.1468924717529; Tue, 19 Jul
 2016 03:38:37 -0700 (PDT)
Received: by 10.36.7.196 with SMTP id f187msitf; Mon, 18 Jul 2016 22:25:04 -0700 (PDT)
X-Received: by 10.98.46.70 with SMTP id u67mr51454288pfu.134.1468905904499; Mon, 18 Jul
 2016 22:25:04 -0700 (PDT)
Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com. [2607:f8b0:400e:c00::244])
 by mx.google.com with ESMTPS id h2si30767931pab.63.2016.07.18.22.25.04 (version=TLS1_2
 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 22:25:04
 -0700 (PDT)
Received-SPF: pass (google.com: domain of karachimkt17@gmail.com designates 2607:f8b0:400e:c00::244
 as permitted sender) client-ip=2607:f8b0:400e:c00::244;
Received: by mail-pf0-x244.google.com with SMTP id i6so649952pfe.0; Mon, 18 Jul 2016
 22:25:04 -0700 (PDT)
X-Received: by 10.98.87.138 with SMTP id i10mr47879372pfj.16.1468905904104; Mon, 18 Jul
 2016 22:25:04 -0700 (PDT)
Received: from DESKTOPAB6096V ([119.159.218.38]) by smtp.gmail.com with ESMTPSA id
 s23sm990989pfd.23.2016.07.18.22.24.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256
 bits=128/128); Mon, 18 Jul 2016 22:25:02 -0700 (PDT)
From: Anoopkrishnan <karachimkt17@gmail.com>
Reply-To: <anoop@brainsphereit.com>
To: <anoop@brainsphereit.com>
References: 
In-Reply-To: 
Subject: [G] Cost Effective ERP Solution
Date: Tue, 19 Jul 2016 10:24:32 +0500
Message-ID: <000001d1e17d$df6513c0$9e2f3b40$@brainsphereit.com>
MIME-Version: 1.0
Content-Type: multipart/related; boundary="----=_NextPart_000_0001_01D1E1A7.C89B8B40"
X-Mailer: Microsoft Outlook 15.0
Thread-Index: AdHg1NBDxwnnE7fASxWcRvqBFMAmaQAJFORAAABbtVAAAAe5wAAAE2oAACCoHVA=
Content-Language: en-us
X-Original-Sender: karachimkt17@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass header.i=@gmail.com;       spf=pass (google.com:
 domain of karachimkt17@gmail.com designates 2607:f8b0:400e:c00::244 as
 permitted sender) smtp.mailfrom=karachimkt17@gmail.com;       dmarc=pass (p=NONE
 dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list asfauae-004@dolphinadvertisers.com; contact asfauae-004+owners@dolphinadvertisers.com
List-ID: <asfauae-004.dolphinadvertisers.com>
X-Google-Group-Id: 770884930820
List-Post: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/post>,
 <mailto:asfauae-004@dolphinadvertisers.com>
List-Help: <https://support.google.com/a/dolphinadvertisers.com/bin/topic.py?topic=25838>,
 <mailto:asfauae-004+help@dolphinadvertisers.com>
List-Archive: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/>
List-Subscribe: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/subscribe>,
 <mailto:asfauae-004+subscribe@dolphinadvertisers.com>
List-Unsubscribe: <mailto:googlegroups-manage+770884930820+unsubscribe@googlegroups.com>, <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/subscribe>

User avatar
SorenR
Senior user
Senior user
Posts: 3140
Joined: 2006-08-21 15:38
Location: Denmark

Re: rules don't work

Post by SorenR » 2016-07-20 18:58

dolphinadvertisers is a Google group... Log in to the group and unsubscribe.
SørenR.

The quantum rule of insecurity which states that the act of observing how vulnerable a host or service is changes the insecurity level of the service.

User avatar
jimimaseye
Moderator
Moderator
Posts: 7955
Joined: 2011-09-08 17:48

Re: rules don't work

Post by jimimaseye » 2016-07-20 19:10

HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: rules don't work

Post by percepts » 2016-07-20 21:12

unsubscribing from the group would seem to be the most logical and sensible thing to do.

Doesn't answer your question of why rules don't seem to work though. There are numerous headers in that mail which could be used in your rule to delete posts from that listgroup. Try another one and see if that works. You can pick from the following but

Mailing-list contains dolphinadvertisers

should do it. If it doesn't then there is something very odd happening with your setup.

Code: Select all

X-BeenThere: asfauae-004@dolphinadvertisers.com
Mailing-list: list asfauae-004@dolphinadvertisers.com; contact asfauae-004+owners@dolphinadvertisers.com
List-ID: <asfauae-004.dolphinadvertisers.com>
List-Post: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/post>,
 <mailto:asfauae-004@dolphinadvertisers.com>
List-Help: <https://support.google.com/a/dolphinadvertisers.com/bin/topic.py?topic=25838>,
 <mailto:asfauae-004+help@dolphinadvertisers.com>
List-Archive: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/>
List-Subscribe: <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/subscribe>,
 <mailto:asfauae-004+subscribe@dolphinadvertisers.com>
List-Unsubscribe: <mailto:googlegroups-manage+770884930820+unsubscribe@googlegroups.com>, <https://groups.google.com/a/dolphinadvertisers.com/group/asfauae-004/subscribe>

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-21 15:55

I never subscribed to any such group to begin with, and I've tried the unsub link several times and they keep coming, and I've sent them as attachments to abuse@gmail.com.

I'm over it...time for an event handler to kill them in OnSMTPData.

User avatar
jimimaseye
Moderator
Moderator
Posts: 7955
Joined: 2011-09-08 17:48

Re: rules don't work

Post by jimimaseye » 2016-07-21 16:08

Looks simple.

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if InStr(oMessage.HeaderValue("List-ID"), "dolphinadvertisers.com") > 0 then
      Result.Value = 1
   End if
End sub
Rejects delivery in the first place. (Possibly also leading to automatic removal of your address from their mailing list. Bonus.).

(Note: it must be 'OnAcceptMessage' and not 'OnSMTPData' as OnSMTPData doesnt have such information populated.)

EDIT: (or, as Percepts mentions in the next post, do as a rule but to simply delete the message after it has already been accepted. That wont remove you from their list though and possibly still confirms your address as a valid recipient to go on to spam lists.)
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: rules don't work

Post by percepts » 2016-07-21 16:22

you should be able to do that with a rule and not need to use script for it.

use a global rule if you want it to apply to all of your email addresses. If its just one email address which is the problem then use an account level rule.

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-21 17:44

I already have script code in OnSMTPData and added the bit I posted above to reject.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: rules don't work

Post by percepts » 2016-07-21 18:23

does it work?

MrGadget
Normal user
Normal user
Posts: 42
Joined: 2011-10-23 23:47
Location: Midwest USA

Re: rules don't work

Post by MrGadget » 2016-07-22 21:26

Yes...yes it does :)

Code: Select all

"TCPIP"	14640	"2016-07-22 09:37:41.188"	"TCP - 209.85.218.72 connected to 11.22.33.44:25."
"SMTPD"	14640	3127	"2016-07-22 09:37:41.188"	"209.85.218.72"	"SENT: 220 mail.redacted.net ESMTP"
"SMTPD"	13400	3127	"2016-07-22 09:37:41.219"	"209.85.218.72"	"RECEIVED: EHLO mail-oi0-f72.google.com"
"SMTPD"	13400	3127	"2016-07-22 09:37:41.219"	"209.85.218.72"	"SENT: 250-mail.redacted.net[nl]250-SIZE 20480000[nl]250-AUTH LOGIN[nl]250 HELP"
"SMTPD"	14548	3127	"2016-07-22 09:37:41.250"	"209.85.218.72"	"RECEIVED: MAIL FROM:<asfauae-004+bncBAABBH6DZC6AKGQELPFVEHQ@dolphinadvertisers.com> SIZE=679912"
"SMTPD"	14548	3127	"2016-07-22 09:37:41.250"	"209.85.218.72"	"SENT: 250 OK"
"SMTPD"	14640	3127	"2016-07-22 09:37:41.282"	"209.85.218.72"	"RECEIVED: RCPT TO:<chris@redacted.com>"
"SMTPD"	14640	3127	"2016-07-22 09:37:41.297"	"209.85.218.72"	"SENT: 250 OK"
"SMTPD"	13400	3127	"2016-07-22 09:37:41.313"	"209.85.218.72"	"RECEIVED: DATA"
"SMTPD"	13400	3127	"2016-07-22 09:37:41.329"	"209.85.218.72"	"SENT: 554 Go to hell spammer"
"SMTPD"	14548	3127	"2016-07-22 09:37:41.360"	"209.85.218.72"	"RECEIVED: QUIT"
"SMTPD"	14548	3127	"2016-07-22 09:37:41.360"	"209.85.218.72"	"SENT: 221 goodbye"

Post Reply