1

Topic: Roundcube filters, check_sender_access and header_checks do not work

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.81
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: OpenBSD 7.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? NO
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello all,

First, i set filter in Roundcube. The filter looks OK, I also have it in managesieve.sieve.

What I want to achieve is to block some senders (testing with my gmail account) with no success.

Here is  managesieve.sieve content for this mail:

require ["reject"];
# rule:[delete]
if allof (header :is "from" "maymail@gmail.com")
{
        reject "YOUR MAIL IS SPAM";
        discard;
        stop;
}

Then I try to achieve the same goal via check_sender_access and header_checks without success.

I will appreciate your help to resolve these issues.

Thanks,
Ivo

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube filters, check_sender_access and header_checks do not work

What's your rule used in check_sender_access and header_checks?

3

Re: Roundcube filters, check_sender_access and header_checks do not work

Hi Zhang,

Here is the part of the main.cf

None of these work:

header_checks = pcre:/etc/postfix/header_checks

header_checks = regexp:/etc/postfix/header_checks

check_sender_access pcre:/etc/postfix/sender_access.pcre

I use:
postmap /etc/postfix/header_checks

postmap /etc/postfix/sender_access.pcre

Then restart postfix with "postfix reload"

Content of sender_access.pcre:

/\.gmail.com$/ REJECT

Content of header_checks:

/^From:mymail@gmail.com/ REJECT

I took this config from my very old iRedMail installation, where it was working.

Thanks,
Ivo

4

Re: Roundcube filters, check_sender_access and header_checks do not work

I suggest reading Postfix manual page to understand its syntax and usage:
https://www.postfix.org/header_checks.5.html

5

Re: Roundcube filters, check_sender_access and header_checks do not work

chutkin wrote:

Content of header_checks:
/^From:mymail@gmail.com/ REJECT

From: header usually contains display name and email address, for example:

From: John Smith <user@domain.com>
From: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0JPQu9GD0YjQutC10LLQuNGH?= <user@domain.com>

Your rule won't match them at all.