Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You're dead, Jim. -- McCoy, "The Tholian Web", stardate unknown


computers / comp.mail.sendmail / Re: Subject header check question

SubjectAuthor
* Subject header check questionStefan Parvu
+- Re: Subject header check questionStefan Parvu
`* Re: Subject header check questionClaus Aßmann
 +* Re: Subject header check questionStefan Parvu
 |`* Re: Subject header check questionClaus Aßmann
 | `- Re: Subject header check questionStefan Parvu
 `* Re: Subject header check questionStefan Parvu
  `* Re: Subject header check questionClaus Aßmann
   `- Re: Subject header check questionStefan Parvu

1
Subject header check question

<44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=395&group=comp.mail.sendmail#395

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:a37:e209:0:b0:648:b0eb:3bab with SMTP id g9-20020a37e209000000b00648b0eb3babmr4964333qki.229.1646595602490;
Sun, 06 Mar 2022 11:40:02 -0800 (PST)
X-Received: by 2002:a81:7556:0:b0:2dc:6ea9:8d53 with SMTP id
q83-20020a817556000000b002dc6ea98d53mr6082645ywc.413.1646595602349; Sun, 06
Mar 2022 11:40:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Sun, 6 Mar 2022 11:40:02 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:70cc:8c09:ad19:7e0e;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:70cc:8c09:ad19:7e0e
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
Subject: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Sun, 06 Mar 2022 19:40:02 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 26
 by: Stefan Parvu - Sun, 6 Mar 2022 19:40 UTC

Hi,

I need a bit help to understand what Im doing wrong. From the BAT book I have tried to reuse 7.3.1 Virus Screening by Subject on FreeBSD 13 with sendmail 8.17.1.

I have created a flat file where I keep some email subjects, called spamsubjects. the content of the file is something like this:

This is a spam REJECT
Another line REJECT

and create a hash out of it using makemap.
makemap -t\tab hash spamsubjects < spamsubjects

Then inside my .mc file I have defined:

LOCAL_CONFIG
Kspamsubdb hash /etc/mail/spamsubjects
HSubject: $>ScreenSubject

LOCAL_RULESETS
SScreenSubject
R $* $: $(spamsubdb $&{currHeader} $: OK $) $1
R REJECT $* $#error $: "553 Subject:" $1 ": Not allowed"

But it does not work. Nothing gets blocked. Any ideas what I am doing wrong?

Thanks,
Stefan

Re: Subject header check question

<e4d0f631-0cd3-4901-927e-c66544f6b0a0n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=396&group=comp.mail.sendmail#396

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:a37:96c3:0:b0:67b:31d5:e1c3 with SMTP id y186-20020a3796c3000000b0067b31d5e1c3mr187817qkd.465.1646595666473;
Sun, 06 Mar 2022 11:41:06 -0800 (PST)
X-Received: by 2002:a25:b004:0:b0:621:f386:f10a with SMTP id
q4-20020a25b004000000b00621f386f10amr5474939ybf.314.1646595666308; Sun, 06
Mar 2022 11:41:06 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Sun, 6 Mar 2022 11:41:06 -0800 (PST)
In-Reply-To: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:70cc:8c09:ad19:7e0e;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:70cc:8c09:ad19:7e0e
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e4d0f631-0cd3-4901-927e-c66544f6b0a0n@googlegroups.com>
Subject: Re: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Sun, 06 Mar 2022 19:41:06 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 3
 by: Stefan Parvu - Sun, 6 Mar 2022 19:41 UTC

> This is a spam REJECT
> Another line REJECT

In the real file, I have TAB between the spam subject and REJECT.

Re: Subject header check question

<t04mk0$6ci$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=397&group=comp.mail.sendmail#397

  copy link   Newsgroups: comp.mail.sendmail
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ca+sendm...@mine.informatik.uni-kiel.de (Claus Aßmann)
Newsgroups: comp.mail.sendmail
Subject: Re: Subject header check question
Date: Mon, 7 Mar 2022 10:26:08 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Sender: <ca+sendmail(-no-copies-please)@mine.informatik.uni-kiel.de>
Message-ID: <t04mk0$6ci$1@dont-email.me>
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 7 Mar 2022 10:26:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eb8409e67e98c3dea24e3c0c5012461a";
logging-data="6546"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VEu3bWtYMOo8Vm8Qi/M/BEaNU9X//rJQ="
Cancel-Lock: sha1:5YLC2rhYlfC5pu7YRPHhBO7p/b8=
Originator: ca@x2.esmtp.org (Claus Assmann)
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Mail-Copies-To: never
 by: Claus Aßmann - Mon, 7 Mar 2022 10:26 UTC

Stefan Parvu wrote:

> This is a spam REJECT

> makemap -t\tab hash spamsubjects < spamsubjects

> Kspamsubdb hash /etc/mail/spamsubjects
> HSubject: $>ScreenSubject

> SScreenSubject
> R $* $: $(spamsubdb $&{currHeader} $: OK $) $1
> R REJECT $* $#error $: "553 Subject:" $1 ": Not allowed"

> But it does not work. Nothing gets blocked. Any ideas what I am doing wrong?

"It's complicated"

op.txt: {currHeader} ... ``Header value as quoted string''
which means
'a b c'
is represented as
'" a b c "'
BUT for the map lookup the quotes are removed leaving us with:
' a b c'
"interesting", isn't it?

So this should work:
This is a spam REJECT
(space.........tab)

In general it is better to use a regex map to match the values
of "unstructured" headers (non-address fields).

--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

Re: Subject header check question

<8f45f266-c7aa-486e-b5f5-4fc2d2128fa1n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=398&group=comp.mail.sendmail#398

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:a05:620a:2946:b0:67b:3047:6d9d with SMTP id n6-20020a05620a294600b0067b30476d9dmr2367699qkp.691.1646649687963;
Mon, 07 Mar 2022 02:41:27 -0800 (PST)
X-Received: by 2002:a25:48a:0:b0:629:1821:99df with SMTP id
132-20020a25048a000000b00629182199dfmr6676262ybe.530.1646649687784; Mon, 07
Mar 2022 02:41:27 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Mon, 7 Mar 2022 02:41:27 -0800 (PST)
In-Reply-To: <t04mk0$6ci$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:70cc:8c09:ad19:7e0e;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:70cc:8c09:ad19:7e0e
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com> <t04mk0$6ci$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f45f266-c7aa-486e-b5f5-4fc2d2128fa1n@googlegroups.com>
Subject: Re: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Mon, 07 Mar 2022 10:41:27 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 14
 by: Stefan Parvu - Mon, 7 Mar 2022 10:41 UTC

Thanks for message.

> So this should work:
> This is a spam REJECT
> (space.........tab)

Let me see if I understood you correctly. Are you saying I should reformat my spamsubjects file? Not to use spaces within?
Or

Even If I have a single word like:

MYPATTERN\tabREJECT

won't work

Re: Subject header check question

<t04o6o$pt6$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=399&group=comp.mail.sendmail#399

  copy link   Newsgroups: comp.mail.sendmail
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.veps.esmtp.org!not-for-mail
From: INVALID_...@esmtp.org (Claus Aßmann)
Newsgroups: comp.mail.sendmail
Subject: Re: Subject header check question
Date: Mon, 7 Mar 2022 05:53:12 -0500 (EST)
Organization: MGT Consulting
Sender: <ml+sendmail(-no-copies-please)@esmtp.org>
Message-ID: <t04o6o$pt6$1@news.misty.com>
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com> <t04mk0$6ci$1@dont-email.me> <8f45f266-c7aa-486e-b5f5-4fc2d2128fa1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 7 Mar 2022 10:53:12 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="veps.esmtp.org:155.138.203.148";
logging-data="26534"; mail-complaints-to="abuse@misty.com"
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: ca@x2.esmtp.org (Claus Assmann)
 by: Claus Aßmann - Mon, 7 Mar 2022 10:53 UTC

Stefan Parvu wrote:

> > This is a spam REJECT
> > (space.........tab)

What removed the leading space and changed the TAB?

> Let me see if I understood you correctly. Are you saying I should reformat my
> spamsubjects file? Not to use spaces within?

No. The LHS must be (without the quotes):
`` This is a spam''
that is, it has a _leading_ space.

Run something like
sendmail -bs -d38.20 -d39.20
....
to see what's going on (or start a daemon with
-D/tmp/sm.log -d89.9 -d38.20 -d39.20
and send a message through it).

--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

Re: Subject header check question

<bfa2f55e-03bd-488b-8390-8210f6bfac72n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=400&group=comp.mail.sendmail#400

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:ac8:7e87:0:b0:2e0:5e20:5fe9 with SMTP id w7-20020ac87e87000000b002e05e205fe9mr7545944qtj.382.1646650983327;
Mon, 07 Mar 2022 03:03:03 -0800 (PST)
X-Received: by 2002:a25:b905:0:b0:61e:23e4:949f with SMTP id
x5-20020a25b905000000b0061e23e4949fmr7618899ybj.373.1646650983173; Mon, 07
Mar 2022 03:03:03 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Mon, 7 Mar 2022 03:03:02 -0800 (PST)
In-Reply-To: <t04o6o$pt6$1@news.misty.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:70cc:8c09:ad19:7e0e;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:70cc:8c09:ad19:7e0e
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
<t04mk0$6ci$1@dont-email.me> <8f45f266-c7aa-486e-b5f5-4fc2d2128fa1n@googlegroups.com>
<t04o6o$pt6$1@news.misty.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bfa2f55e-03bd-488b-8390-8210f6bfac72n@googlegroups.com>
Subject: Re: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Mon, 07 Mar 2022 11:03:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Stefan Parvu - Mon, 7 Mar 2022 11:03 UTC

> `` This is a spam''
> that is, it has a _leading_ space.

Huh. Got it. 10 x thanks.
It works fine. I will continue experimenting with this.

Thanks again!

Re: Subject header check question

<85ee1c3e-42ef-4130-957f-324205244df7n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=401&group=comp.mail.sendmail#401

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:ad4:5c83:0:b0:435:8969:57f8 with SMTP id o3-20020ad45c83000000b00435896957f8mr4178256qvh.50.1646661082105;
Mon, 07 Mar 2022 05:51:22 -0800 (PST)
X-Received: by 2002:a25:c241:0:b0:61d:8fd1:2954 with SMTP id
s62-20020a25c241000000b0061d8fd12954mr7756951ybf.584.1646661081941; Mon, 07
Mar 2022 05:51:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Mon, 7 Mar 2022 05:51:21 -0800 (PST)
In-Reply-To: <t04mk0$6ci$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:70cc:8c09:ad19:7e0e;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:70cc:8c09:ad19:7e0e
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com> <t04mk0$6ci$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <85ee1c3e-42ef-4130-957f-324205244df7n@googlegroups.com>
Subject: Re: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Mon, 07 Mar 2022 13:51:22 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: Stefan Parvu - Mon, 7 Mar 2022 13:51 UTC

> In general it is better to use a regex map to match the values
> of "unstructured" headers (non-address fields).

how could I change and improve the rulesets to use a regex map to match the values from my spam subject file?
Is it difficult? Any pointers?

Right now, Im using something like this:

LOCAL_RULESETS
SScreenSubject
R $* $: $(subdb $&{currHeader} $: OK $) $1
R REJECT $* $#error $: "553 Subject:" $1 ": Not allowed"

Thank you
Stefan

Re: Subject header check question

<t05pio$1su$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=402&group=comp.mail.sendmail#402

  copy link   Newsgroups: comp.mail.sendmail
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.veps.esmtp.org!not-for-mail
From: INVALID_...@esmtp.org (Claus Aßmann)
Newsgroups: comp.mail.sendmail
Subject: Re: Subject header check question
Date: Mon, 7 Mar 2022 15:22:48 -0500 (EST)
Organization: MGT Consulting
Sender: <ml+sendmail(-no-copies-please)@esmtp.org>
Message-ID: <t05pio$1su$1@news.misty.com>
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com> <t04mk0$6ci$1@dont-email.me> <85ee1c3e-42ef-4130-957f-324205244df7n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 7 Mar 2022 20:22:48 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="veps.esmtp.org:155.138.203.148";
logging-data="1950"; mail-complaints-to="abuse@misty.com"
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: ca@x2.esmtp.org (Claus Assmann)
 by: Claus Aßmann - Mon, 7 Mar 2022 20:22 UTC

Stefan Parvu wrote:

> how could I change and improve the rulesets to use a regex map to match the
> values from my spam subject file?

You would have to put all of the data into the regex. If you have
many entries or if you change the content often, then it might be
better to use milter-regex so you don't have to restart sendmail
after each change.

Otherwise it's fairly simple: just replace the map definition,
e.g., something like this:
Kspamsubdb regex (This is spam|Another line)

--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

Re: Subject header check question

<e2aa3331-eb5a-4243-9440-f25e5be35847n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=403&group=comp.mail.sendmail#403

  copy link   Newsgroups: comp.mail.sendmail
X-Received: by 2002:a05:6214:c4b:b0:435:7a60:8f87 with SMTP id r11-20020a0562140c4b00b004357a608f87mr8532573qvj.85.1646729286211;
Tue, 08 Mar 2022 00:48:06 -0800 (PST)
X-Received: by 2002:a81:8506:0:b0:2db:dcfe:c731 with SMTP id
v6-20020a818506000000b002dbdcfec731mr12429923ywf.207.1646729286000; Tue, 08
Mar 2022 00:48:06 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.mail.sendmail
Date: Tue, 8 Mar 2022 00:48:05 -0800 (PST)
In-Reply-To: <t05pio$1su$1@news.misty.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:14bb:675:4d34:1959:c95:7167:5d38;
posting-account=pxxzawoAAADcaCkg0ZmN2lfRjBsyQH5q
NNTP-Posting-Host: 2001:14bb:675:4d34:1959:c95:7167:5d38
References: <44d38772-22d7-4627-bba6-5d2c34e8cdd2n@googlegroups.com>
<t04mk0$6ci$1@dont-email.me> <85ee1c3e-42ef-4130-957f-324205244df7n@googlegroups.com>
<t05pio$1su$1@news.misty.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e2aa3331-eb5a-4243-9440-f25e5be35847n@googlegroups.com>
Subject: Re: Subject header check question
From: spa...@kronometrix.com (Stefan Parvu)
Injection-Date: Tue, 08 Mar 2022 08:48:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Stefan Parvu - Tue, 8 Mar 2022 08:48 UTC

> You would have to put all of the data into the regex. If you have
> many entries or if you change the content often, then it might be
> better to use milter-regex so you don't have to restart sendmail
> after each change.

I see. Im not familiar with milter-regex (plugins to sendmail
written in C AFAIK) but probable will just use the basic regex
within the ruleset. Lets see if I can make it happen.

>
> Otherwise it's fairly simple: just replace the map definition,
> e.g., something like this:
> Kspamsubdb regex (This is spam|Another line)

Thanks

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor