Email Mail Filter does not appear to block tld

Discussion in 'Installation/Configuration' started by ACS_Martin, Mar 27, 2023.

  1. ACS_Martin

    ACS_Martin New Member

    Hi,

    I am trying to use mail filters on a mailbox, to block certain tld for a client ( e.g .info .biz .autos ).
    I have set it up 2 different ways ( at the same time ), and neither appears to work.

    The first method was to set it as follows:
    Name: dot autos
    Source: From
    Matches Regex
    /.+?@.+?\.autos/
    Action: Delete
    (--BLANK--)
    Active ( ticked )

    This didn't appear to work, so in addition to this, I then set up a second mail filter as follows:
    Name: dot autos2
    Source: From
    Ends With
    .autos
    Action: Delete
    (--BLANK--)
    Active ( ticked )

    I am on:
    ISPConfig 3.2.8p1
    php7.4
    Ubuntu 20.04.5 LTS

    Am I doing something wrong? or do I have an issue with the server that I need to troubleshoot?
    Thanks for any help you can offer.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you used the complete from line from an email as source in a regex tester and tested your regex against that?

    This can't work as the from address does not end with .autos. Take a look at the source code of an email in your mail client, then you see the from line looks something like this:

    Code:
    From: John Doe <[email protected]>
    so it typically ends with ".autos>", it would end up with ".autos" only in case the mail client sets no from name, which is very untypical.
     
    ahrasis likes this.
  3. ACS_Martin

    ACS_Martin New Member

    It appears to work on the regex tester??

    .autos
    https://regex101.com/r/DAc8qE/1
    https://www.regextester.com/?fam=127345

    .info
    https://regex101.com/r/N1hDJ0/1


    ahhh, ok. Thanks :)

    So I have now added another mail filter as follows:
    Name: dot autos3
    Source: From
    Ends With
    .autos>
    Action: Delete
    (--BLANK--)
    Active ( ticked )

    I will see how that works over the next 24 hours.
     
  4. ACS_Martin

    ACS_Martin New Member

    This appears to have worked perfectly. :)
    Thanks Till.

    Any clues as to why the regex didn't work though??
    Do you think that is also a case of adding a > at the end?
     
    ahrasis likes this.
  5. Alex Mamatuik

    Alex Mamatuik Member

    In the hope of blocking an e-mail from any subdomain, containing 2-nd tier domain name like: [email protected]
    i have added this:
    Code:
    if header :regex    "/<.+?@.+?\.sub\.domain>/" [""] {
        reject "";
        stop;
    }
    but still receive from annoying spammers.

    Despite of several unsolved my questions, including:
    1
    2
    i still hope that someone would have helped me.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Then your regex rule does not match the email you want to block. A good start is using a regex tester and testing against the whole email header line or even the entire email headers.

    Posting in a forum does not mean that any issue you post must get resolved by someone. If someone has an idea what the issue might be and he has free time to post in the forum, you'll likely get an answer. Reposting this to other threads will likely not get you an answer faster. If you need an issue resolved urgently, then it's often better to contact business support directly: https://www.ispconfig.org/get-support/?type=ispconfig
     
  7. Alex Mamatuik

    Alex Mamatuik Member

    Absolutely, and i didn't make a statement, that someone MUST to solve it.

    But what struck me - absence of interest and/or will.

    This one topic: https://forum.howtoforge.com/threads/restore-snapshots-and-how-hosters-deal-with-them.90456/
    When i was asking how to upload a snapshot back, it was replied just:
    - hey, ask your hoster... not here.
    (it looks like, the answer was given just to give it)
    if i wanted to ask my hoster, then i would do it there.

    Next:
    https://forum.howtoforge.com/threads/mount-borg-as-a-fuse-to-browse-remote-backups-repository.90470/
    - no reply to any of matters

    what i appreciate is the efforts.

    Last one: https://forum.howtoforge.com/threads/ispconfig-3-running-nginx-and-nodejs.84017/#post-445510
    I asked Mr. Thom to help me with the question about aliases, because i thought it would take an interest from his side.
    No answer at all whether he can help or not.

    This is a list a kind of my pretences.

    Having explained this, i stop posting to this forum at all due to all these contradictions.
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I resent strongly your comment about https://forum.howtoforge.com/thread...how-hosters-deal-with-them.90456/#post-445378
    Furthermore, you distort what I answered. Here is my answer verbatim, not at all what you insinuate:
    How can you expect getting information specific to a hosting provider you do not reveal (you wrote it was OVH only after I had answered).
     

Share This Page