1

Topic: How can block senders using the from field

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.0 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu server 20.04.5 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
====

Dear Sirs, I want to completely block all incoming emails with from starting with deszy{xxx}  e.x. manager@deszyinfo.com   jim@deszydesign.info  rose@deszystudio.in  etc.
The spammer is using Gmail email servers, so the only possibility to block them is by using the from field, that as I explained, is in the form of (random name}@deszy{whatever}.{whatever}
Please help me.
Given the command:
python3 /opt/iredapd/tools/wblist_admin.py --add --blacklist @.deszy
or
python3 /opt/iredapd/tools/wblist_admin.py --add --blacklist @.deszy*
doesn't seem to work, so please tell me what is the correct command to achieve this blocking?

Thanks

----

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

2

Re: How can block senders using the from field

Better use Postfix header_checks and/or body_checks to match it with regular expression.

3

Re: How can block senders using the from field

Thanks for your answer.
Can you give me a configuration example because I am not sure what to set and what R.E. is the needed.

ZhangHuangbin wrote:

Better use Postfix header_checks and/or body_checks to match it with regular expression.

4

Re: How can block senders using the from field

To answer to my own question, I just put at the file:
/etc/postfix/header_checks

the line:
/^From:.*deszy/ REJECT ACCESS DENIED. Your email was rejected because you are a spammer...

then I restarted the postfix:
systemctl restart postfix

After the above, the spammer got what it's deserved...

P.S. I am wondering nobody here can give me this instruction ???  ...

5

Re: How can block senders using the from field

mikekgr wrote:

P.S. I am wondering nobody here can give me this instruction ???  ...

You already figured it out, why wait for other's instruction ...