1

Topic: How to block a specific email address

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Centos 607
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySql
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro?N/A
- Related log if you're reporting an issue:
====

I am looking for some assistance on blocking a particular email address. This person is harassing one of my users, but since it is a gmail account I do not want to block the whole domain, just the specific email address.

----

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

2

Re: How to block a specific email address

user@gmail.com  REJECT Sorry, you're not welcome here.
or
user@gmail.com DISCARD

Discard one doesn't give a notification, takes the mail in and gets rid of it after that. Whereas Reject sends the mail back by not even accepting.

Put it under /etc/postfix/sender_access.pcre
The file is already in the config so just restarting postfix will do.

3

Re: How to block a specific email address

Thank you.

I did see the file under postfix, but was unsure of the file structure. Do I not have to hash this file?

4

Re: How to block a specific email address

Nope, just save it.

5

Re: How to block a specific email address

Another way is storing the blacklist in SQL database. Try this:

cd /opt/iredapd/tools/
python wblist_admin.py --add --blacklist 'user@domain.com'

Reference: http://www.iredmail.org/docs/manage.iredapd.html

6

Re: How to block a specific email address

Zhang,

Does it apply to all backends? Or just for MySQL backend?

Editing the .pcre file is easy and if you're not in for blocking thousands,  easier to manage. Also works with any backend and you can move the files to other setups easily as well.

7

Re: How to block a specific email address

nomad wrote:

Does it apply to all backends? Or just for MySQL backend?

It works for all backends supported by iRedMail.