1 (edited by purathal 2017-07-11 03:49:25)

Topic: Block email based on exact keywords

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.6
- Linux/BSD distribution name and version:  CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue: /var/log/maillog
====

Is there any way to block incoming emails based on certain keywords on the subject line or on the email content?  Someone is trying to sell me something, I add their email address/domain to the blacklist, and the next thing I know is the same emails comes from a different email address/domain. The "product" name on the email is the same always, so I am looking for any ability to block all emails based on that exact word. It can either go to SPAM or be rejected at the SMTP level - either one is fine.

----

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

2

Re: Block email based on exact keywords

2 solutions:

- Use Postfix parameter "header_checks =", you can reject the emails directly during smtp session.
- Use SpamAssassin, its config file is /etc/mail/spamassassin/local.cf. Create a custom rule to score matched email a high score, then Amavisd will mark it as spam.