You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by sp...@dwd.hu on 2018/12/23 11:52:56 UTC

Help needed - Regex filter with exclude

Hi,
I want to filter all mails incoming to info@*ANY_DOMAIN*.hu except to
info@asdf.hu
I have a lot of domains and spamming to info@ is legal in Hungary. :S
Thank you!

Re: Help needed - Regex filter with exclude

Posted by Bowie Bailey <Bo...@BUC.com>.
On 12/23/2018 6:52 AM, spamassassin_forum@dwd.hu wrote:
> Hi,
> I want to filter all mails incoming to info@*ANY_DOMAIN*.hu except to
> info@asdf.hu
> I have a lot of domains and spamming to info@ is legal in Hungary. :S
> Thank you!

If you are just looking for a regex, this should do it:

/\binfo\@(?!asdf\.hu)[^.]+\.hu\b/

This regex should match info at any domain other than asdf.hu.  I'll leave it up to
you how to apply it.  This is untested, so I don't give any guarantees.  This is in
Perl format, so it should work with SA.  It may or may not work if you are using it
in some sort of other MTA filter.

-- 
Bowie

Re: Help needed - Regex filter with exclude

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 23.12.18 12:52, spamassassin_forum@dwd.hu wrote:
>I want to filter all mails incoming to info@*ANY_DOMAIN*.hu except to
>info@asdf.hu

I believe simple directives "whitelist_to", "more_spam_to" and "all_spam_to"

>I have a lot of domains and spamming to info@ is legal in Hungary. :S

is blocking mail to info@ illegal in Hungary? if not, why bother?

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Microsoft dick is soft to do no harm

Re: Help needed - Regex filter with exclude

Posted by John Hardin <jh...@impsec.org>.
On Sun, 23 Dec 2018, spamassassin_forum@dwd.hu wrote:

> I want to filter all mails incoming to info@*ANY_DOMAIN*.hu except to
> info@asdf.hu
> I have a lot of domains and spamming to info@ is legal in Hungary. :S
> Thank you!

Filtering like that is much better done in the MTA before the message 
content is ever accepted and passed to SpamAssassin.


-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   "Bother," said Pooh as he struggled with /etc/sendmail.cf, "it never
   does quite what I want. I wish Christopher Robin was here."
                                            -- Peter da Silva in a.s.r
-----------------------------------------------------------------------
  2 days until Christmas